cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BI 4.2 SP6 - Can't log in with SDK

DellSC
Active Contributor
0 Kudos
3,467

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!

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

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

0 Kudos

Hello Dell, Im facing same issue for a while. How should i set classpath as u commented above?

DellSC
Active Contributor
0 Kudos

I'm running from Windows and I usually run my .jar files through at .bat file. So I just put the SET CLASSPATH= command before the call to run the jar in the .bat file.

-Dell

0 Kudos

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.

0 Kudos

HI, Christy, Is possible to Extract required libraries into generated JAR file. As I test, It can not work when I select this type of export jar.

DellSC
Active Contributor

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

Answers (1)

Answers (1)

ayman_salem
Active Contributor

Hi Dell,

I had the same problem before, and I realized that we now also need the JAR file "jcmFIPS.jar". and it works well by me. so, make sure you have the latest version of it.

here are the jars I used (minimal)

DellSC
Active Contributor
0 Kudos

I already have jcmFIPS.jar along with all the rest of the .jar files you have. Thanks for the response, though.

-Dell

ayman_salem
Active Contributor
0 Kudos

I see it in your XI42 DEPENDENTS.

if it works in Eclipse, as you said, then it seems that it is not correctly included in compiled jar.

So, just make a test for your jar with -classpath and include this jar and see if it works or not. (that's what I used)

.....