-
Notifications
You must be signed in to change notification settings - Fork 22
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
[RuntimeException: java.lang.NoClassDefFoundError: com/sun/jersey/spi/MessageBodyWorkers] #38
Comments
This can happen only if you use this lib directly without a dependency management tool like maven. |
no. that's not the case. I'm using sbt which fetches the paymill java sdk from the given maven repository in the readme. |
This sounds like dependency issue. |
jersey-client 1.17.1 is in classpath, i had to add jersey-core 1.17.1 manually. now it works. thanks. |
+1 Same problem here with grails framework wich uses maven for dependency management. Adding jersey-core to dependencies worked for me. |
@stoilkov, can you please have a look at this issue? Sorry for this late response guys! |
@nikoloff looking at the jersey-client pom, the dependency to jersey-core might depend on the maven profile in use. we should include a dependency to jersey-core directly in our pom. |
#41 adds explicit dependency to jersey-core |
FYI, I had a similar error using Paymill's client version 5.0.0. While trying to use SBT with that dependency, I got the following error:
After some digging around, I found out that I had a previous dependency that was depending on Jersey's 1.X API. So that might be your problem as well if you run into this issue again.
I 'solved' it by removing the offending library (I was lucky that I wasn't using it yet.. and I think I can use something else) but still I had to add the following dependencies by hand:
Maybe you won't need all of the above, try playing around with it in case you have the same problema and what a smaller footprint for your configuration files When will Java solve these kinds of dependency problems.. sigh |
@joantune thanks for the feedback. glad that you solved the dependency problem. unfortunately we cannot do a lot on our side :) |
Yes @stoilkov , I only posted this here in case anyone has the same problem and finds this thread like I did, by googling the exception, to give them some guidance. That's it :) Although I wonder why I had to put the explicit dependencies
by hand in SBT and on Maven everything worked fine. But anyway, I'm not an expert on SBT, I only deal with it because I have to when using Play. And again, if anyone has that problem without a conflict issue with JAX-RS 1.X API like I did, they can just also copy and paste the librarydependencies on SBT |
I'm using the paybutton to generate the token. when processing the token on server with the java api, I get this error (I'm using scala, playframework on server).
already inlcuded:
"com.sun.jersey" % "jersey-server" % "1.18",
"com.sun.jersey" % "jersey-client" % "1.18",
"com.sun.jersey" % "jersey-json" % "1.18"
my code is:
val paymill: PaymillContext = new PaymillContext(privateKey);
val transactionService: TransactionService = paymill.getTransactionService()
val transaction: Transaction = transactionService.createWithToken(token, 25, "EUR", "test transaction")
println(transaction)
The text was updated successfully, but these errors were encountered: