intersystems-cacheintersystems

Issues while connecting to the intersystems cache from Java


I am trying to write an example to connect to the Intersystems Cache from a Java class. I am using the eXtreme Data Objects framework from Intersystems Cache`. Here is the source code -

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());
            }
        }
    }
}

When I run this class, I see the following exception -

lc_conn::connect_device returned Db_err: source: lc_conn::connect() message: lc_conn::connect: CacheSecureStart returned -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.
#

Could you please help in fixing this issue?

Here is the audit table details -

enter image description here


Solution

    1. Open ManagementPortal from Cube.
    2. go to Home->System Administration -> Security -> Services
    3. Click %Service_Callin to open edit window
    4. Check Service enabled checkbox

    This should let you login via JNI