Issue
We have SAP BO 4.2 installed in house, and I've been told that REST is not turned on. I've written several successful .NET apps using the SDK to connect to and run against our production SAP box, and now I'm trying to write a Java app to do the same, as the Java SDK exposes more (and required) functionality.
I can't seem to get my Eclipse/Java/project environment set up properly to even start coding.
- Windows 10, 64-bit
- Eclipse version: 2019-03 (4.11.0)
- Java version:
- openjdk version "12.0.2" 2019-07-16
- OpenJDK Runtime Environment (build 12.0.2+10)
- OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
I created a new "Java EE" -> "Application Client Project".
I'm not able to get the following code to "Run As Application":
import com.crystaldecisions.sdk.framework.CrystalEnterprise;
import com.crystaldecisions.sdk.exception.SDKException;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
public class Main {
public static void main(String[] args) {
IEnterpriseSession oEnterpriseSession = null;
String username = "username";
String password = "password";
String cmsname = "server";
String authenticationType = "secEnterprise";
try {
oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authenticationType);
if (oEnterpriseSession == null) {
System.out.print("login failed");
}
} catch (SDKException sdkEx) {
System.out.print(sdkEx);
}
//do processing here
}
public Main() {
super();
}
}
I have the following libraries referenced in the build path:
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/cecore.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/cesession.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/celib.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/logging.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/aspectjrt.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/ceaspect.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/TraceLog.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/corbaidl.jar
C:/Program Files (x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/java/lib/ebus405.jar
Everything I've searched online for has fallen into three categories:
- links to pages on SAP's site that no longer work (so redirected to general search page), or
- outdated information/code, such that I'm not able to do the same, or
- code that should work, once I get local environment set up and working properly
Additionally, all samples I've been able to find are for Java Server Pages, which is not what I want with this project.
When I try to run the above code, the error message I receive, even before it tries to connect, is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/CORBA/portable/IDLEntity at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initializeDefaultPolicies(ORB_impl.java:369) at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initialize(ORB_impl.java:196) at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.setParameters(ORB_impl.java:812) at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.init(ORB_impl.java:1313) at com.crystaldecisions.enterprise.ocaframework.idl.helper.ORBHelper.init(ORBHelper.java:57) at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.<init>(ServiceMgr.java:402) at com.crystaldecisions.enterprise.ocaframework.ServiceMgrFactory.getServiceMgr(ServiceMgrFactory.java:66) at com.crystaldecisions.sdk.occa.security.internal.LogonService.ensureServiceStub(LogonService.java:701) at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:885) at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:860) at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:240) at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:166) at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody0(SessionMgr.java:823) at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody1$advice(SessionMgr.java:523) at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon(SessionMgr.java:1) at Main.main(Main.java:17) Caused by: java.lang.ClassNotFoundException: org.omg.CORBA.portable.IDLEntity at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 34 more
I understand that starting with Java 9, java.CORBA has been deprecated (and removed in Java 11). I've tried changing the compiler compliance and facets to 1.8 with no change. Additionally, the jar file "ebus405.jar" contains the CORBA classes.
Although I would appreciate help on getting past this error message, I would more appreciate it if someone can tell me a more straight-forward approach to getting this started. I would embrace any of the following:
- using a different IDE (I'm not tied to Eclipse)
- referencing different/additional SDK Jars
- tackling this from a different angle (e.g., different Java project type)
Solution
SAP definitely does not support Java 12, and in BW Modeling tools it is clearly stated that recommended JREs for Eclipse are 8 or 11, but not 12.
I do not know whether you use these tools but I suppose this dependency applies to others cases as well.
SAP explicitly is not saying this anywhere, but previously in all the documentation it was stated that only Oracle Java was supported, which was confirmed by multiple user experiences. I never have any problem with Oracle JDK but with OpenJDK had. So I recommend you to switch to Oracle 11 JDK.
As a last cast, as recommended here (chapter 6.1.1), you can try SAP proprietary Java Virtual Machine, which is available on the Support Portal.
Answered By - Suncatcher
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.