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

ClassNotFound when run with -javaagent #45

Open
naivefun opened this issue Jan 15, 2016 · 8 comments
Open

ClassNotFound when run with -javaagent #45

naivefun opened this issue Jan 15, 2016 · 8 comments
Assignees

Comments

@naivefun
Copy link

Even I add the dependency to pom the same exception occurs. How to fix this? Thanks.

run with spring boot 3.1.0 & undertow

Caused by: java.lang.NoClassDefFoundError: com/esotericsoftware/kryo/Serializer
    at co.paralleluniverse.springframework.web.method.support.FiberInvocableHandlerMethod.fiberDispatchInvoke(FiberInvocableHandlerMethod.java:108) ~[comsat-spring-webmvc-0.5.0.jar:na]
    at co.paralleluniverse.springframework.web.method.support.FiberInvocableHandlerMethod.doInvoke(FiberInvocableHandlerMethod.java:92) ~[comsat-spring-webmvc-0.5.0.jar:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at co.paralleluniverse.springframework.web.servlet.mvc.method.annotation.FiberServletInvocableHandlerMethod.invokeAndHandle(FiberServletInvocableHandlerMethod.java:110) ~[comsat-spring-webmvc-0.5.0.jar:na]
    at co.paralleluniverse.springframework.web.servlet.mvc.method.annotation.FiberRequestMappingHandlerAdapter.invokeHandleMethod(FiberRequestMappingHandlerAdapter.java:784) ~[comsat-spring-webmvc-0.5.0.jar:na]
    at co.paralleluniverse.springframework.web.servlet.mvc.method.annotation.FiberRequestMappingHandlerAdapter.handleInternal(FiberRequestMappingHandlerAdapter.java:727) ~[comsat-spring-webmvc-0.5.0.jar:na]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE]
    ... 65 common frames omitted
@circlespainter circlespainter self-assigned this Jan 15, 2016
@circlespainter
Copy link
Member

Can you share the POM (or even better a small project) that triggers the problem?

@circlespainter
Copy link
Member

@naivefun Does it still happen? If you can't share a project or a POM, what's your project setup? Is there a chance that you have Kryo version conflicts or classloading issues or are you excluding it explicitly? Kryo is a direct compile-time and run-time (but not instrumentation-time) Quasar dependency so it's quite strange that it can't be loaded. Do you have Quasar as a dependency?

@ariloudev
Copy link

Happens for me as well with

  • Quasar 0.7.9
  • Spring Boot

@bbarin
Copy link

bbarin commented Mar 26, 2018

anyone managed to circumvent this problem? it works with spring-boot:run but fails while running regular java -jar.....

@ariloudev
Copy link

Sorry @bbarin. I don’t remember if I solved this or not. This was an experimental task where I compared using various async IO frameworks. In tthe end of the day I decided to use AsyncHttpClient because it produced best results in my tests.

@bbarin
Copy link

bbarin commented Mar 28, 2018

Hey just to let anyone who is interested in this subject know.
It turns out that spring boot uses a different classloader when packaged via its maven plugin.
So I switched to shade plugin and after some tweaks, I've managed to make it work as an uber jar.

@sheldonkreger
Copy link

I'm also running into this with Quasar 0.7.9 and Sprint Boot 1.5.3.RELEASE. So far unable to get the uber jar to work using Maven shade plugin. However, I can run it with the mvn command, for example mvn test works fine. Going to fiddle with the shade config and see what I can do.

@enryold
Copy link

enryold commented Aug 1, 2018

Hi Guys, I've solved basically using Capsule.

  • I've started from scratch with this project:
  • I converted the project from maven to gradle. (gradle init)
  • Than I add the gradle-capsule-plugin
  • I Add to build.gradle the fatCapsule task:

task fatCapsule(type: FatCapsule) { applicationClass 'com.myCompany.Application' }

  • Finally I create the Jar file using gradle fatCapsule

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

6 participants