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

failed to create comet support class #912

Closed
thomasverbeke opened this issue Feb 19, 2013 · 14 comments
Closed

failed to create comet support class #912

thomasverbeke opened this issue Feb 19, 2013 · 14 comments

Comments

@thomasverbeke
Copy link

Hey;
I'm trying to run the chat sample (not just run it using the war file).
However when connecting to the server I run into this problem.

"java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyAsyncSupportWithWebSocket has bad signature."

I'm using run jetty run and maven eclipse plugin.

my maven dependencies are correct as far as I know.

12:23:37.027 [qtp1561244285-12] INFO  o.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
12:23:37.053 [qtp1561244285-12] DEBUG o.atmosphere.cpr.AtmosphereFramework - Atmosphere's Service Annotation Not Supported. Please add https://github.com/rmuller/infomas-asl as dependencies or your own AnnotationProcessor to support @Service
12:23:37.066 [qtp1561244285-12] INFO  o.atmosphere.cpr.AtmosphereFramework - Auto detecting atmosphere handlers /WEB-INF/classes/
12:23:37.067 [qtp1561244285-12] INFO  o.atmosphere.cpr.AtmosphereFramework - Auto detecting WebSocketHandler in /WEB-INF/classes/
12:23:37.067 [qtp1561244285-12] INFO  o.atmosphere.cpr.AtmosphereFramework - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
12:23:37.081 [qtp1561244285-12] ERROR o.a.cpr.DefaultAsyncSupportResolver - failed to create comet support class: class org.atmosphere.container.JettyAsyncSupportWithWebSocket, error: null
12:23:37.089 [qtp1561244285-12] ERROR o.atmosphere.cpr.AtmosphereFramework - Failed to initialize Atmosphere Framework
java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyAsyncSupportWithWebSocket has bad signature.
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:233) ~[atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:296) ~[atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:284) ~[atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:1163) ~[atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:534) ~[atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:191) [atmosphere-runtime-1.0.10.jar:1.0.10]
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:516) [jetty-servlet-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:398) [jetty-servlet-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:642) [jetty-servlet-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445) [jetty-servlet-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:564) [jetty-security-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1054) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372) [jetty-servlet-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:988) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.Server.handle(Server.java:410) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:245) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.server.HttpConnection$1.run(HttpConnection.java:75) [jetty-server-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:597) [jetty-util-9.0.0.M3.jar:9.0.0.M3]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528) [jetty-util-9.0.0.M3.jar:9.0.0.M3]
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_13]
Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_13]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_13]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_13]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525) ~[na:1.7.0_13]
    at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:229) 

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.atmosphere</groupId>
  <artifactId>chat_test</artifactId>
  <packaging>war</packaging>
  <version>1.0.10</version>
  <name>chat_test Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <build>
    <finalName>chat_test</finalName>
  </build>

  <dependencies>
    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-runtime</artifactId>
        <version>1.0.10</version>
    </dependency>
    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-jquery</artifactId>
        <version>1.0.10</version>
        <type>war</type>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.9</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.0.9</version>
    </dependency>
    <dependency>
       <groupId>eu.infomas</groupId>
       <artifactId>annotation-detector</artifactId>
       <version>3.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.12</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-server</artifactId>
        <version>9.0.0.M3</version>
    </dependency>
  </dependencies>
</project>
@thomasverbeke
Copy link
Author

ok i guess it doesn't work with jetty 9 M3 yet; and that's the only version of jetty 9 supported in run jetty run.

@jfarcand
Copy link
Member

Jetty 9 is only supported with the 1.1.x release. Try the latest 1.1.0-SNAPSHOT and RC0. Thanks

@jfarcand
Copy link
Member

1.1.0.beta3 should work. Try it and let me know, I will patch to make it work.

@jfarcand jfarcand reopened this Feb 19, 2013
@ayasinskiy
Copy link

With 1.1.0RC3 I see (I use Jetty 9)
java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket has bad signature.
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:248) ~[atmosphere-runtime-1.1.0.RC3.jar:1.1.0.RC3]
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:306) ~[atmosphere-runtime-1.1.0.RC3.jar:1.1.0.RC3]
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:293) ~[atmosphere-runtime-1.1.0.RC3.jar:1.1.0.RC3]
at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:1338) ~[atmosphere-runtime-1.1.0.RC3.jar:1.1.0.RC3]
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:579) ~[atmosphere-runtime-1.1.0.RC3.jar:1.1.0.RC3]
...

@jfarcand
Copy link
Member

I cannot reproduce this issue...please paste the entire stack trace

@jfarcand jfarcand reopened this May 29, 2013
@jfarcand jfarcand reopened this May 29, 2013
@jfarcand
Copy link
Member

OK found the issue. Seems the order the classes are loaded cause this to happen.

@pmullot
Copy link

pmullot commented Sep 11, 2013

Hi,

Got the same issue. Could you please give us the correct order of the jar, for Tomcat 7, please?

Thanks a lot

This is the stack:
11-sep-2013 17:01:31 org.atmosphere.cpr.AtmosphereFramework autoConfigureService
INFO: Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
11-sep-2013 17:01:31 org.atmosphere.cpr.AtmosphereFramework autoDetectAtmosphereHandlers
INFO: Auto detecting atmosphere handlers /WEB-INF/classes/
11-sep-2013 17:01:31 org.atmosphere.cpr.AtmosphereFramework autoDetectWebSocketHandler
INFO: Auto detecting WebSocketHandler in /WEB-INF/classes/
11-sep-2013 17:01:32 org.atmosphere.cpr.AtmosphereFramework initWebSocket
INFO: Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
11-sep-2013 17:01:32 org.atmosphere.cpr.DefaultAsyncSupportResolver newCometSupport
GRAVE: failed to create comet support class: class org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket, error: null
11-sep-2013 17:01:32 org.atmosphere.cpr.AtmosphereFramework init
GRAVE: Failed to initialize Atmosphere Framework
java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket has bad signature.
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:249)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:308)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:294)
at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:1360)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:583)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:512)
at org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:74)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:245)
... 19 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/WebSocketFactory$Acceptor
at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.(JettyServlet30AsyncSupportWithWebSocket.java:46)
... 24 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.WebSocketFactory$Acceptor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
... 25 more

@jfarcand
Copy link
Member

@pmullot : you are using Atmospherer 2.0.0.RC4 right? 1.0.x is not supported with Jetty 9.

@pmullot
Copy link

pmullot commented Sep 11, 2013

Atmospherer 2.0.0.RC3 actually, but as far as I know, I'm not using jetty.. I'm just trying to make it work inside Eclipse (Kepler) on a Tomcat v7.0 server
My production server will also be a Tomcat 7.0. (so no portability needed)
So should I include the atmosphere-compat-tomcat-2.0.0.jar, atmosphere-compat-tomcat7-2.0.0.jar and atmosphere-compat-jbossweb-2.0.0.jar ?

@jfarcand
Copy link
Member

You have Jetty classes in your classpath somewhere. To fix that, just add in your web.xml

<init-param>
   <param-name>org.atmosphere.cpr.asyncSupport</param-name>
   <param-value>org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket</param-value>
</init-param>

You don't need any of those dependencies. Let's continue the discussion on the mailing list as this is unrelated to that issue.

@pmullot
Copy link

pmullot commented Sep 11, 2013

Thanks!
Previous error disapeared! But I have a new one...
I'll open a new thread for it.

@mchaudhary
Copy link

Facing similar problem. I am getting following error
12:51:48.554 [main] ERROR o.a.cpr.DefaultAsyncSupportResolver - Failed to create comet support class: class org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket, error: java.lang.reflect.InvocationTargetException

I am using Nettosphere. I do have a something in path which contains Jetty. I am using following in pom.xml so version of Atmosphere is also 2.3.1

nettosphere-version---2.3.
atmosphere-version---2.3.1

Is there a recommendation ?

@mchaudhary
Copy link

This causes nettosphere to not start.

@jfarcand
Copy link
Member

@mchaudhary Please use the mailing list for question. Your issue: you have jetty's jar in the classpath, so either set the AsyncSupport class in web.xml, or remove Jetty. Please ask question on the ML

https://groups.google.com/group/atmosphere-framework?pli=1

Thanks!

@Atmosphere Atmosphere locked and limited conversation to collaborators Jul 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants