2014-09-29 84 views
1

我正在嘗試編寫一個示例以從Java類連接到Intersystems緩存。我正在使用Intersystems Cache中的eXtreme Data Objects框架。這裏是源代碼 -從Java連接到系統間緩存時出現問題

package demo; 

import com.intersys.xdo.DatabaseConnection; 
import com.intersys.xdo.DatabaseConnectionFactory; 
import com.intersys.xdo.XDOException; 

class XDODemo { 
    public static void main(String[] args) { 

     java.sql.Connection jdbcConnection = null; 
     DatabaseConnection xdoConnection = null; 
     String namespc = "USER"; 
     String url = "jdbc:Cache://localhost:1972/" + namespc; 
     String user = "admin"; 
     String password = "admin"; 
     try { 
      xdoConnection = DatabaseConnectionFactory 
        .createJNIDatabaseConnection(); 
      xdoConnection.connect(namespc, user, password); 
     } catch (XDOException e) { 
      System.out.println(e.getMessage()); 
     } catch (Exception e) { 
      System.out.println(e.getMessage()); 
     } finally { 
      try { 
       if (xdoConnection != null) 
        xdoConnection.disconnect(); 
      } catch (XDOException e) { 
       System.out.println(e.getMessage()); 
      } catch (Exception e) { 
       System.out.println(e.getMessage()); 
      } 
     } 
    } 
} 

當我運行這個類,我看到以下異常 -

lc_conn :: connect_device退換Db_err:來源:lc_conn :: connect()的消息:lc_conn: :連接:CacheSecureStart返回-15:

# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000045ab78, pid=5132, tid=9084 
# 
# JRE version: Java(TM) SE Runtime Environment (7.0_60-b19) (build 1.7.0_60-b19) 
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.60-b09 mixed mode windows-amd64 compressed oops) 
# Problematic frame: 
# C [lcbjni.dll+0xab78] 
# 
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows 
# 
# An error report file with more information is saved as: 
# c:\intersystems\trycache1\mgr\hs_err_pid5132.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.sun.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 

請您在解決此問題的幫助?

這裏是審計表的詳細信息 -

enter image description here

+0

莫非您檢查審覈日誌中是否有任何條目? (登錄失敗或保護錯誤?) – 2014-09-29 17:58:04

+0

謝謝你的回覆。 「審計日誌」給了我一個查找文檔的提示。然後文檔幫助我。請在下面看到我自己的答案。我還用審計日誌更新了我的問題。 – user3600073 2014-09-30 03:35:01

回答

2
  1. 從魔方公開賽ManagementPortal。
  2. 進入首頁 - >系統管理 - >安全 - >服務
  3. 點擊%Service_Callin打開編輯窗口
  4. 檢查服務啓用複選框

這應該讓你通過JNI

登錄
+0

我收到了一個類似的錯誤:com.intersys.globals.GlobalsException:lc_conn :: connect_device返回Db_err:source:lc_conn :: connect()消息:lc_conn :: connect:CacheSecureStart返回-1:'它可能是什麼? – Andrew 2018-02-25 11:12:49

+0

沒有審計記錄('LoginFailures' /'ProtectErrors') – Andrew 2018-02-25 11:20:24