Havaing trouble upgrading from 2.4.3 to higher, class loading issue

67 views
Skip to first unread message

Shahryar Sedghi

unread,
May 14, 2013, 12:07:09 PM5/14/13
to cometd...@googlegroups.com
Currently I  have my cometd jars in Jetty-home/lib/ext with 2.4.3 and everything works fine with Jetty 8.1.5,, with some required jar file packaged in the war (not cometd)

 I see an ssl engine issue that kills my oort in one machine  that has 8.1.7  with IPAD Safari, so I decided to move everything to 8.1.10  and the  latest cometd,  but  when replacing them with jars of 2.5.1 or 2.6 I get :
java.lang.ClassNotFoundException: org.cometd.java.annotation.AnnotationCometdServlet

I tried to move everything that exist in cometd-demo war to the war file (except old jetty jars, keeping new jars ), still getting the same error. Even I replaced what is in my war file/lib with cometd-demo (7.6.10) jars, still does not work.

Please help

Thanks in advance

Simone Bordet

unread,
May 14, 2013, 3:13:27 PM5/14/13
to cometd-users
Hi,
This is mentioned in the release notes for 2.5.0, it is enough that
you search on the mailing list archives.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Pawel Magrian

unread,
May 17, 2014, 4:35:20 PM5/17/14
to cometd...@googlegroups.com

Hi Simone,

I'm having the same problem. I've followed instructions to set up initial structure with cometd 2.8.0 and Jetty8, then I've followed server stock price tutorial at http://docs.cometd.org/tutorials/#server_stock_price and I'm unable to proceed. I spent the whole day investigating this and browsing through the internet, but I couldn't find the mailing list archives for release 2.5.0 mentioned by you and any hits that would actually work.

Would you mind sharing a bit more information about this, please?

Kind Regards
Pawel

On Tuesday, 14 May 2013 20:13:27 UTC+1, Simone Bordet wrote:
Hi,

Simone Bordet

unread,
May 17, 2014, 6:01:27 PM5/17/14
to cometd-users
Hi,

On Sat, May 17, 2014 at 10:35 PM, Pawel Magrian <magr...@gmail.com> wrote:
>
> Hi Simone,
>
> I'm having the same problem. I've followed instructions to set up initial
> structure with cometd 2.8.0 and Jetty8, then I've followed server stock
> price tutorial at http://docs.cometd.org/tutorials/#server_stock_price and
> I'm unable to proceed. I spent the whole day investigating this and browsing
> through the internet, but I couldn't find the mailing list archives for
> release 2.5.0 mentioned by you and any hits that would actually work.
>
> Would you mind sharing a bit more information about this, please?

Sure.

java.lang.ClassNotFoundException:
org.cometd.java.annotation.AnnotationCometdServlet

is due to the fact that in 2.5.0+ the package for that class changed
and it's now org.cometd.annotation.AnnotationCometdServlet, i.e.
dropped the "java" middle package name.

Pawel Magrian

unread,
May 17, 2014, 6:27:18 PM5/17/14
to cometd...@googlegroups.com
Thank you for your response. It seems that I have a different issue then, because I didn't notice the 'java' middle package name in Shahryar's issue description. I also should correct that I'm using cometd 2.9.0 (not 2.8.0). I've found your CometD tutorials very helpful, but unfortunately the Tutorial: Server-Side Stock Price Notification doesn't seem to be working for me.

I've setup everything same way (using Maven) and I'm getting the following error:

2014-05-17 23:07:10.444:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
2014-05-17 23:07:11.600:WARN:oejs.Holder:
java.lang.ClassNotFoundException: org.cometd.annotation.AnnotationCometdServlet
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)
        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)
        at org.eclipse.jetty.util.Loader.loadClass(Loader.java:100)
        at org.eclipse.jetty.util.Loader.loadClass(Loader.java:79)
        at org.eclipse.jetty.servlet.Holder.doStart(Holder.java:107)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:298)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
        at org.eclipse.jetty.server.Server.doStart(Server.java:282)
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:520)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:365)
        at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:523)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
2014-05-17 23:07:11.672:WARN:/webapp:unavailable
javax.servlet.UnavailableException: org.cometd.annotation.AnnotationCometdServlet
        at org.eclipse.jetty.servlet.Holder.doStart(Holder.java:114)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:298)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:298)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)

I'm still stuck at this and I'm wondering if maybe you would have any suggestions for me that will help me in solving it?

Kind Regards
Pawel

Simone Bordet

unread,
May 17, 2014, 6:43:23 PM5/17/14
to cometd-users
Hi,

On Sun, May 18, 2014 at 12:27 AM, Pawel Magrian <magr...@gmail.com> wrote:
> Thank you for your response. It seems that I have a different issue then,
> because I didn't notice the 'java' middle package name in Shahryar's issue
> description. I also should correct that I'm using cometd 2.9.0 (not 2.8.0).
> I've found your CometD tutorials very helpful, but unfortunately the
> Tutorial: Server-Side Stock Price Notification doesn't seem to be working
> for me.
>
> I've setup everything same way (using Maven) and I'm getting the following
> error:
>
> 2014-05-17 23:07:10.444:INFO:oejpw.PlusConfiguration:No Transaction manager
> found - if your webapp requires one, please configure one.
> 2014-05-17 23:07:11.600:WARN:oejs.Holder:
> java.lang.ClassNotFoundException:
> org.cometd.annotation.AnnotationCometdServlet

Make sure your pom has the right dependency to
org.cometd.java:cometd-java-annotations and that the jar is in
WEB-INF/lib of your war.
It should already be so if you have cloned the skeleton project.

Pawel Magrian

unread,
May 17, 2014, 7:00:16 PM5/17/14
to cometd...@googlegroups.com
I've created a new skeleton and I had added that dependency in there ...but it was version 3.0.0 beta2. I just changed it manually to 2.9.0 and it seems to be working for me now.

Thank you very much for your help and replies Simone, I can now continue with it. Have good night!

Kind Regards
Pawel

Naveen Chawla

unread,
Oct 18, 2014, 7:33:32 AM10/18/14
to cometd...@googlegroups.com
That's because in 3 it was changed to AnnotationCometDServlet, with a capital "D". You are using a small "d" which is for pre 3 CometD.
Reply all
Reply to author
Forward
0 new messages