on 2021 Feb 09 5:58 AM
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
User | Count |
---|---|
69 | |
13 | |
10 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.