1

I am trying to get a node.js+node-java app that calls an API from a commercial product, and have gotten it to the point it almost runs, but now, when I run it, it is giving me a "java.lang.NoClassDefFoundError".

Here's the ending of the output when it gets this error:

THIS IS CONSOLE.LOG!!
Finished STARTING TO DO MyFactoryImplClass.getPepRequestFactory()...
About to do pepReqF1.newPepRequest()...
/apps/Oracle/OESCLIENT/oes_sm_instances/smtest8-java-PULL-NODEJS/testOES.js:97
var pepReq1 = pepReqF1.newPepRequestSync("Administrators", "GET" , "test/foo2/fooresource" );
                       ^

Error: Error running instance method
java.lang.NoClassDefFoundError: javax/security/jacc/PolicyContext
        at oracle.security.jps.runtime.AppSecurityContext$2.run(AppSecurityContext.java:223)
        at oracle.security.jps.runtime.AppSecurityContext$2.run(AppSecurityContext.java:221)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.runtime.AppSecurityContext.getApplicationID(AppSecurityContext.java:221)
        at oracle.security.jps.internal.api.runtime.AppSecurityContext.getApplicationID(AppSecurityContext.java:66)
        at oracle.security.jps.openaz.pep.SubjectObjMapper$2.run(SubjectObjMapper.java:234)
        at oracle.security.jps.openaz.pep.SubjectObjMapper$2.run(SubjectObjMapper.java:231)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.openaz.pep.SubjectObjMapper.mapStringSubject(SubjectObjMapper.java:231)
        at oracle.security.jps.openaz.pep.SubjectObjMapper.mapToJpsObject(SubjectObjMapper.java:173)
        at oracle.security.jps.openaz.pep.PepRequestImpl.setAccessSubject(PepRequestImpl.java:429)
        at oracle.security.jps.openaz.pep.PepRequestFactoryImpl.newPepRequest(PepRequestFactoryImpl.java:202)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)

    at Error (native)
    at Object.<anonymous> (/apps/Oracle/OESCLIENT/oes_sm_instances/smtest8-java-PULL-NODEJS/testOES.js:97:24)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
[root@nodejs smtest8-java-PULL-NODEJS]#

I found that PolicyContext class is in jacc-api.jar, so I put a copy of jacc-api.jar in my directory and then added:

enter code herejava.classpath.push("/apps/node-v6.6.0-linux-x64/code/jacc-api.jsr");

However, even after doing that, I am still getting the same error when I run my node.js+node-java app.

I am guessing that when I call out to the commercial product's API, that THAT is looking for this PolicyContext class, so I tried exporting CLASSPATH set to the path that the jacc-api.jar file, but even then I get the same error.

Where can I add that JAR to the CLASSPATH so that I can eliminate this error?

Thanks, Jim

user555303
  • 1,146
  • 3
  • 20
  • 44

0 Answers0