puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

ClassNotFound when run with -javaagent #45

Open naivefun opened 8 years ago

naivefun commented 8 years ago

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 commented 8 years ago

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

circlespainter commented 8 years ago

@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 commented 7 years ago

Happens for me as well with

bbarin commented 6 years ago

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

ariloudev commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Hi Guys, I've solved basically using Capsule.

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