Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: org/bouncycastle/util/Pack #1723

Closed
fabiBorja3 opened this issue Jun 28, 2024 · 1 comment
Closed

java.lang.NoClassDefFoundError: org/bouncycastle/util/Pack #1723

fabiBorja3 opened this issue Jun 28, 2024 · 1 comment

Comments

@fabiBorja3
Copy link

fabiBorja3 commented Jun 28, 2024

Hello everyone, I wanted to ask for your help in this problem, I implemented the JpassKit library in a Springboot application and it uses the bcpkix-jdk15on-1.70.jar, bcprov-jdk15on-1.70.jar and bcutil-jdk15on-1.70.jar libraries to generate boarding passes, everything works correctly until the moment I generate the .war and deploy it to a Tomcat server, it shows me the following error:

2024-06-28 06:58:35,192 [http-nio-8080-exec-251] [3856417a-fe79-449e-a2f6-d5321042c342] ERROR org.springframework.boot.web.servlet.support.ErrorPageFilter - Forwarding to error page from request [/ticket/F#######/173642B721145525/pkpass] due to exception [org/bouncycastle/util/Pack]
java.lang.NoClassDefFoundError: org/bouncycastle/util/Pack
at org.bouncycastle.crypto.digests.SHA1Digest.processWord(Unknown Source)
at org.bouncycastle.crypto.digests.GeneralDigest.update(Unknown Source)
at org.bouncycastle.jcajce.provider.digest.BCMessageDigest.engineUpdate(Unknown Source)
at java.security.MessageDigest.update(MessageDigest.java:325)
at org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder$DigestOutputStream.write(Unknown Source)
at org.bouncycastle.util.io.Streams.pipeAll(Unknown Source)
at org.bouncycastle.cms.CMSProcessableFile.write(Unknown Source)
at org.bouncycastle.cms.CMSSignedDataGenerator.generate(Unknown Source)
at de.brendamour.jpasskit.signing.PKAbstractSigningUtil.signManifestUsingContent(PKAbstractSigningUtil.java:116)
at de.brendamour.jpasskit.signing.PKFileBasedSigningUtil.signManifestFileAndWriteToDirectory(PKFileBasedSigningUtil.java:133)
at de.brendamour.jpasskit.signing.PKFileBasedSigningUtil.createSignedAndZippedPersonalizedPkPassArchive(PKFileBasedSigningUtil.java:98)
at de.brendamour.jpasskit.signing.PKFileBasedSigningUtil.createSignedAndZippedPkPassArchive(PKFileBasedSigningUtil.java:77)
at com.#############.service.BookingService.generatePkPass(BookingService.java:1150)
at com.#############.service.BookingService.buildPkPass(BookingService.java:945)
at com.#############.service.BookingService.getSinglePkPass(BookingService.java:930)
at com.#############.web.BookingControllerImpl.getSingleTicketWallet(BookingControllerImpl.java:126)

the class is correctly located in the .war component at path 0.war\WEB-INF\lib\bcprov-jdk15on-1.70.jar\org\bouncycastle\util\ as seen in this image
classInLibrary

I attach an image with the dependency tree
mvnTree

The application is using Java version 8 and we have implemented version 0.3.4 of JpassKit and this use these versions of your libraries, We tried adding the libraries to the pom.xml of web component the current version 1.70 and the1.76 doing a the previous exclusion of this way but show the same error

de.brendamour jpasskit 0.3.4 org.bouncycastle bcpkix-jdk15on org.bouncycastle bcprov-jdk15on org.bouncycastle bcprov-jdk18on 1.76 org.bouncycastle bcpkix-jdk18on 1.76

I would be very grateful if you can shed some light on this problem.

@dghgit
Copy link
Contributor

dghgit commented Sep 2, 2024

It'll be a class path issue. What I'm not sure though.

@dghgit dghgit closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants