cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BO connector in Spring boot and Docker - java.lang.NoClassDefFound

0 Kudos
542

I am creating application which sends data to SAP BO system.

It works fine when I start app from IntelliJ, but when I start it from Docker I have exception:

Exception in thread "Thread-17" java.lang.NoClassDefFoundError: Could not initialize class com.rsa.cryptoj.o.co
        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(Thread.java:748)

I know those jars are placed in jar lib folder, but I wanted to put them in separate folder as you can see in my Dockerfile:

FROM openjdk:8-jre
VOLUME /tmp
ARG APP_NAME
COPY build/libs/${APP_NAME}.jar app.jar

RUN mkdir sapLibs
COPY libs/certjFIPS.jar /sapLibs/certjFIPS.jar
COPY libs/cryptojce.jar /sapLibs/cryptojce.jar
COPY libs/cryptojFIPS.jar /sapLibs/cryptojFIPS.jar
COPY libs/jcmFIPS.jar /sapLibs/jcmFIPS.jar
COPY libs/ssljFIPS.jar /sapLibs/ssljFIPS.jar
RUN chmod a+x -R  /sapLibs/certjFIPS.jar
RUN chmod a+x -R  /sapLibs/cryptojFIPS.jar
RUN chmod a+x -R  /sapLibs/cryptojce.jar
RUN chmod a+x -R  /sapLibs/jcmFIPS.jar
RUN chmod a+x -R  /sapLibs/ssljFIPS.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom","-jar","-Djava.library.path=/sapLibs", "/app.jar"]

My build.gradle:

compile files("libs/bcm.jar")
compile files("libs/biarengine.jar")
compile files("libs/ceaspect.jar")
compile files("libs/cecore.jar")
compile files("libs/celib.jar")
compile files("libs/ceplugins_core.jar")
compile files("libs/ceplugins_core.jar")
compile files("libs/cesession.jar")
compile files("libs/corbaidl.jar")
compile files("libs/ebus405.jar")
compile files("libs/logging.jar")
compile files("libs/TraceLog.jar")
compile files("libs/cryptojFIPS.jar")

//external
compile files("libs/certjFIPS.jar")
compile files("libs/cryptojce.jar")
compile files("libs/jcmFIPS.jar")
compile files("libs/ssljFIPS.jar")

I tried compileOnly, to make sure those external jars are not in jar, but still no luck. Should I put those libs in some other places or add it to classpath? Please help. I dont have more ideas to fix this

former_member937567
Discoverer
0 Kudos

I am also running into exactly same problem when I dockerize spring boot app with Java11/Java8 and have BO libraries you have mentioned. Have you been able to figure this out? However, it runs fine locally or deploy to weblogic systems.

former_member937567
Discoverer
0 Kudos

Hi Issac,

I am also having the same problem when I BO libraries to make a connection to BO from spring boot application (java8/java11). Works absolutely fine from Eclipse and deployed weblogic but having problem when I dockerize as you did. Were you able to figure this out? and it would be a great help if you can point out in the right direction.

jerryjanda
Community Manager
Community Manager
0 Kudos

This thread is nearly a year old, and this member hasn't posted anything since (issaclouis#content). You're unlikely to get answers in an inactive thread. Try asking a new question instead at https://answers.sap.com/questions/ask.html.

I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers, as it provides tips for preparing questions that draw responses from our members. Feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will also help you when preparing questions for the community.

Kind regards,

--Jerry

Moderation Lead

former_member937567
Discoverer
0 Kudos

Thank you Jerry for the advice and I will post as new question. I was hoping notification will go out to the user and may respond to it. Thanks again!

marcel_metzen
Member
0 Kudos

Hello Isaac,

did you solved that issue?

I have a sam issue with spring boot and boe libraries.

Kind regards

Marcel Metzen

former_member937567
Discoverer

Hi Marcel,

For me the issue was that BO libraries ( especially com.rsa.* ) were not loading them into class path though those were part of the BOOT_INF/WEB_INF when packaged.

So how I solved it is by placing the all the BO libraries in lib\external directory of tomcat. So that they will be available with the class loader. I didn't like this idea since I have to deploy it on Tomcat (external installation with the docker) instead of using embedded tomcat when containerize the application. Hope this will help you. However, if you solve this issue with embedded tomcat I had be interested in it too. Please share.

Thanks,

Srinivas

Accepted Solutions (0)

Answers (0)