CrystalEnterprise.getSessionMgr() failed

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

}
catch(SDKException e)
{
	System.out.println(e.getLocalizedMessage());
}

failed without SDKException , but with

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 :hb:

Thank you


Roland Jentsch (BOB member since 2006-02-07)

I don’t think this is a BO problem – it looks like you’re using Spring and missing a library.


joepeters :us: (BOB member since 2002-08-29)

I have the same issue… Is there any further tipp?

What did “using Spring” mean? The Framework?

Im not using any Framework… I just use the Core Jars, described in the SDK

bcm.jar
biarengine.jar
ceaspect.jar
cecore.jar
celib.jar
ceplugins_core.jar
cesession.jar
corbaidl.jar
ebus405.jar
logging.jar
TraceLog.jar

Can anyone help?


aemwell :de: (BOB member since 2017-01-04)

Include aspectjrt.jar, too.


joepeters :us: (BOB member since 2002-08-29)

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! :slight_smile: I just dont wont to use my BO-System as my Java-Testserver… :([/code]


aemwell :de: (BOB member since 2017-01-04)

Looks like you need cryptojFIPS.jar, too.

This is the complete classpath that I use:
boconfig.jar
celib.jar
ceplugins_core.jar
cesession.jar
corbaidl.jar
ebus405.jar
logging.jar
ceaspect.jar
TraceLog.jar
bcm.jar
sdk.core.jar
sdk.core.session.jar
sdk.core.server.jar
sdk.core.server.common.jar
sdk.core.server.corba.jar
sdk.core.session.cms.jar
inproc_container.jar
CTPlugin_idl.jar
cdz_cluster_mgmt_types_idl.jar
dsl_sdk_services.jar
org.eclipse.emf.ecore_2.4.2.v200902171115.jar
org.eclipse.emf.common_2.4.0.v200902171115.jar
cdzidl.jar
GenericContainer_proxy.jar
GenericContainer_idl.jar
IEPlugin_idl.jar
ie_proxies.jar
commons-codec-1.3.jar
ccis.jar
biplugins.jar
SL_plugins.jar
aspectjrt.jar
cvom.jar
cryptojFIPS.jar
certjFIPS.jar
cecore.jar


joepeters :us: (BOB member since 2002-08-29)

Wow, it seems that i was missing a lot .jar’s ^^

I’ve imported all the missing jars into my project and now it works! Thank you very much.


aemwell :de: (BOB member since 2017-01-04)

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.


joepeters :us: (BOB member since 2002-08-29)

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… :shock:

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?


aemwell :de: (BOB member since 2017-01-04)

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.


joepeters :us: (BOB member since 2002-08-29)

Okay, wow… This ist actually pretty helpful! Thanks for sharing! I just “unziped” me that little helper-file! :wink:

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?


aemwell :de: (BOB member since 2017-01-04)

Yes, you can specify multiple classpaths, but the format is different for Windows vs. UNIX servers (it doesn’t matter what your workstation is).

For Windows, specify the full backslash-delimited path, with multiple values separated by semicolon, ex:

c:\jars\ojdbc6.jar;c:\jars\activation.jar

Similar for UNIX, but use forward slashes and a colon separator:

/opt/jars/ojdbc6.jar:/opt/jars/activation.jar

You can also use a wildcard instead:

c:\jars\*

which will include all jars in the specified directory.

Joe


joepeters :us: (BOB member since 2002-08-29)

Joe, you have helped me a lot! Thank you very much for that! Its my second day with the BO SDK but have achieved so much with your help… wow! :crazy_face:

But i think we have to rename the topic to “useful beginner tips” if we proceed here… :rotf:

Have a nice day.


aemwell :de: (BOB member since 2017-01-04)

Glad I could help!


joepeters :us: (BOB member since 2002-08-29)