on 2018 Oct 04 6:36 PM
I have a program that I've written that uses the Java SDK to pull information out of the CMS database and export it to .csv file. This has worked against a number of versions of BOBJ - I just point it to the correct version of the SDK and export to a .jar file with the dependencies "packaged" into it when I need it.
I've recently been working with BOBJ 4.2 SP5 and SP6. It runs fine through Eclipse on my laptop. However, the compiled .jar files throw an error when trying to log in to a CMS anywhere I try to run them. I realize that the security libraries were all updated with SP4, so I've updated the library files in the Build Path. Here are the SDK libraries that are in the Build Path:
I believe the stack trace is showing that I'm missing something with the security libraries. Here the stack trace:
Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.rsa.cryptoj.o.co.F(Unknown Source)
at com.rsa.cryptoj.o.co.d(Unknown Source)
at com.rsa.cryptoj.o.co.J(Unknown Source)
at com.rsa.cryptoj.o.co.<clinit>(Unknown Source)
at com.rsa.jsafe.CryptoJ.isFIPS140Compliant(Unknown Source)
at com.businessobjects.bcm.internal.BcmRsaLib.initialize(BcmRsaLib.java:214)
at com.businessobjects.bcm.internal.BcmRsaLib.<clinit>(BcmRsaLib.java:289)
at com.businessobjects.bcm.BCM.<clinit>(BCM.java:1158)
at com.crystaldecisions.enterprise.ocaframework.BCMInitializer.run(BCMInitializer.java:29)
at java.lang.Thread.run(Unknown Source)
Caused by: com.rsa.crypto.CryptoException: java.lang.SecurityException: java.lang.SecurityException: Toolkit not encapsulated by a jar.
at com.rsa.crypto.jcm.ModuleLoader.<clinit>(Unknown Source)
... 12 more
Caused by: java.lang.SecurityException: java.lang.SecurityException: Toolkit not encapsulated by a jar.
at com.rsa.jcm.f.hx.a(Unknown Source)
at com.rsa.jcm.f.jq.c(Unknown Source)
at com.rsa.crypto.jcm.ModuleLoader.b(Unknown Source)
... 13 more
Caused by: java.lang.SecurityException: Toolkit not encapsulated by a jar.
at com.rsa.jcm.f.f.b(Unknown Source)
at com.rsa.jcm.f.f.a(Unknown Source)
at com.rsa.jcm.f.hx.f(Unknown Source)
... 16 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.businessobjects.bcm.BCM
at com.crystaldecisions.sdk.occa.security.internal.ConfidentialChannelService.establishConfidentialChannel(ConfidentialChannelService.java:189)
at com.crystaldecisions.sdk.occa.security.internal.ConfidentialChannelService.createConfidentialChannel(ConfidentialChannelService.java:149)
at com.crystaldecisions.sdk.occa.security.internal.CCMap.locateCCItem(CCMap.java:63)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:846)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:806)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:211)
at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:166)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody0(SessionMgr.java:915)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody1$advice(SessionMgr.java:521)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon(SessionMgr.java:1)
What am I missing?
Thanks!
Request clarification before answering.
I figured it out. When I export from Eclipse, I have to select "Copy required libraries into a sub-folder next to the generated JAR". Then I have to SET CLASSPATH=<folder with runnable jar>;<required libraries sub-folder>;"<path to SDK>"; "<path to SDK>\external" before I run the jar.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer Dell.
I wrote code with sl sdk. The code runs perfectly in Eclipse with below run configuration;
VM arguments;
- Dbusinessobjects.connectivity.directory="C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer"
- Xmx1024m
Environment;
- Variable: PATH Value: C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86
But I don't know how to run these with jar file. I tried to create bat file like below;
java - Dbusinessobjects.connectivity.directory="C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer" -Xmx1024m -jar myRunnableJar.jar
and it gives me error like when i didn't put Environment variable in eclipse. Tried to create normal jar file with manifest.mf file (to show classpath for my exported jar), but didn't work. So, can u help to show how should i build my bat file with my above run configurations?
I figured out my problem. It was because of java bit version. Eclipse compiled my software with 64 bit jre. If i write "-java" to batch file to start my jar, it automatically runs with 64 bit jre. Then I wrote exact position of my 32 bit jre ("C:\Program Files(x86)\Java\jre1.8.0_171\bin\javaw.exe"). So the code runs perfectly.
benwong1989, not for 4.2 SP4 and later. There's something about the new security jars that doesn't work when you do that.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.