SAP BI 4.1 SP3 (14.1.3.1257)
Windows 2008/2012
Eclipse Kepler service Release 20140224-0627 (on JRE 1.7)
as requested by SDK of 4.1 target is JDK 1.5
I’m developing a tool in JAVA, that will be used inside the CMC, scheduled by an administrator. I use a class, that extends IProgramBaseEx and launching it from the CMC it works fine.
As IDE i’m using Eclipse and i want to use the debug mode to work on the tool. So i created a public static void main(String args). Inside this (as i ever made) i try to create an enterprise session, but just the call
try
{
sessionMgr = CrystalEnterprise.getSessionMgr();
Exception in thread “main” java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at de.comgroup.JavaProgramObject.main(JavaProgramObject.java:230)
Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.Signature
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 1 more
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): […/…/…/src/share/back/util.c:838]
For sure i included all the needed JARs in the classpath. I made this a lot of times and I don’t understand, because this time it doesn’t work
thanks for your response… it worked - a little! ^^
now i get the following Exception:
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/rsa/jsafe/JSAFE_Exception
at com.businessobjects.bcm.BCM.<clinit>(BCM.java:1144)
at com.crystaldecisions.enterprise.ocaframework.BCMInitializer.run(BCMInitializer.java:29)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: com.rsa.jsafe.JSAFE_Exception
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 3 more
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.businessobjects.bcm.BCM
at com.crystaldecisions.sdk.occa.security.internal.ConfidentialChannelService.establishConfidentialChannel(ConfidentialChannelService.java:175)
at com.crystaldecisions.sdk.occa.security.internal.ConfidentialChannelService.createConfidentialChannel(ConfidentialChannelService.java:145)
at com.crystaldecisions.sdk.occa.security.internal.CCMap.locateCCItem(CCMap.java:63)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:845)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:805)
at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:210)
at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:166)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody0(SessionMgr.java:454)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody1$advice(SessionMgr.java:512)
at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon(SessionMgr.java:1)
at de.javaprog.Program.basicLogon(Program.java:50)
at de.javaprog.Program.main(Program.java:33)
BUT: The Exceptions get only thrown when i run my program on my local machine… When i upload the jar into the BO-System it works pretty fine! I just dont wont to use my BO-System as my Java-Testserver… :([/code]
You won’t necessarily need all of them, but it doesn’t hurt. Whenever I write something that needs another jar, I just add it to the general classpath that I use.
I think i need to learn a little bit more about classpathes and how they are used. I have just loaded the needed jars in my /lib folder and added them manualy to my BuildPath in Eclipse. That worked… But i dont know what a general classpath is…
When i upload my jar into the BO-System as a ProgramObject it works fine… So i dont have to worry about my classpath… i think it is already set so the /java/lib folder in the installation of BO?
It’s simply a list of libraries (jars) that contain classes that you reference from your program. Some of them are referenced directly (ex. IInfoStore, IEnterpriseSession). If you haven’t included these jars in your classpath, then Eclipse will tag it as an error and you won’t be able to proceed. But some classes are indirectly referenced. Your code will compile fine without them, but you’ll get the NoClassDefFoundError when you try to run them.
Here’s what I do: I open a DOS box and go to C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib
From there I run:
unzip -l *.jar > jars.txt
The jars.txt file then contains a list of all .class files included in all jar files in that directory. If I need to identify the jar that contains a particular class, I just search jars.txt. For example, “com/rsa/jsafe/JSAFE_Exception”. Then just scroll up to find the jar file that it’s contained in. Note that it’s important to look for the full path (not just JSAFE_Exception), since the same class might be present in different paths in different jars.
Correct… as far as the BOE Java SDK. If you want to use any third-party libraries for your program, then you’ll need to reference it specifically in the program object’s classpath setting.
Okay, wow… This ist actually pretty helpful! Thanks for sharing! I just “unziped” me that little helper-file!
I tried this one already with the oracle jdbc jar. It only worked when i write the full path (i.e. /this/that/ojdbc6.jar ) in the classpath. I cant define just the folder (i.e. /this/that/). Is it possible to adress more than one jar in this Classpath-Attribute, split by semikolon ( ; ) maybe?