• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SEVERE: Allocate exception for servlet - Tomcat

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two tomcat servers and the web application works fine on one while the other server gives the following error.

SEVERE: Allocate exception for servlet AtmosphereServlet
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1308)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:171)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:777)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:773)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:768)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:318)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.atmosphere.util.AtmosphereFilterChain.init(AtmosphereFilterChain.java:125)
at org.atmosphere.handler.ReflectorServletProcessor$FilterChainServletWrapper.init(ReflectorServletProcessor.java:294)
at org.atmosphere.handler.ReflectorServletProcessor.init(ReflectorServletProcessor.java:185)
at org.atmosphere.cpr.AtmosphereFramework.initAtmosphereHandler(AtmosphereFramework.java:912)


My web.xml looks like this:

 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.



All I can tell you is that jersey is not part of Tomcat. It's part of the web application.

The webapp apparently has not configured its resource model properly.
 
Prathy Maroor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I was using Dynamic web module 3.0, it was always failing in Tomcat 6 but working in Tomcat 7 (7 supports servlet 3.0). I just changed it to 2.5 to make it work with tomcat 6. But I still get the same exception.
 
Prathy Maroor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the nexessary changes to be compatible with tomcat 6 and now I get the error:

17553 [http-8080-2] WARN org.atmosphere.util.IOUtils - META-INF/services/org.atmosphere.cpr.AtmosphereFramework not found in class loader
17565 [http-8080-2] ERROR org.atmosphere.cpr.AtmosphereFramework - Failed to initialize Atmosphere Framework
java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.atmosphere.cpr.ApplicationConfig.<clinit>(ApplicationConfig.java:796)
at org.atmosphere.cpr.AtmosphereFramework.preventOOM(AtmosphereFramework.java:775)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:845)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:767)
at org.atmosphere.cpr.AtmosphereServlet.configureFramework(AtmosphereServlet.java:101)
at org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:80)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 25 more

Here is my updated dependency list:



In order to be compatible with tomcat 6, i changed the dynamic web module from 3.0 to 2.5. Could you please help me resolve this?
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I'm not mistaken, "Dynamic Web Module 3.0" is not a JEE thing, it's an Eclipse IDE thing. Which would explain why no one in this forum has suggested any solutions. If I'm wrong, let me know. Otherwise. I'll move this thread to our IDEs forum, where you're more likely to get an answer.
 
Prathy Maroor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I only mentioned the dynamic web module because that was the first step to get it to even run on tomcat 6. Now that I am able to deploy and run on tomcat 6, I get the ServletContainerInitialization error which apparently is a servlet 3.0 class. I checked my project libs and found no instance of servlet-api jar that depends on servlet 3.0. The only servlet-api jar I find is in the tomcat/libs folder. I am not sure where I am getting this error from. So now, I am not sure which forum to post it on.

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are correct in that the servlet classes should all be found in the TOMCAT/libs folder (and not in the WAR).

You are probably using WTP, which is the server interface that comes with the J2EE edition of Eclipse.

In my opinion, WTP is an abomination.

WTP extracts selected parts of your Tomcat configuration (but ONLY selected parts), builds up a new context and runs an embedded Tomcat using that information. It's not very good about picking up project changes (you generally have to handle that manually, and the parts of the Tomcat configuration that it does not pick up have sometimes been critical to me. It's very likely, in fact, that it's launching the wrong version of Tomcat.

I don't use the WTP server manager. I use a plugin developed by sysdeo, which keeps its tendrils out of Tomcat's internals and runs Tomcat more the way that Tomcat runs stand-alone while still keeping the conveniences of being able to start and stop Tomcat, use debugging services and route the console to the Eclipse console window pane. I think sysdeo has retired from active maintenance of that plugin, but someone else stepped in and spun it off to create "mongrel", which is essentially the same thing with support for the latest versions of Tomcat.

If you are actually running stand-alone Tomcats and getting this error, it's possible that your copy of Tomcat6 has become polluted.
 
Prathy Maroor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aahh. That makes a lot of sense. Thanks. Yes I have been using WTP.
I have been trying both via eclipse and deploy independently on server but both give me the same error. My tomcat 6 is a fresh installation as well. I just seem to be spinning my wheels. But yes, I ll try the other eclipse plugin to see if it helps.
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Incidentally, you might want to cause Maven or the Eclipse Maven plugin to display your full dependency pull. It's possible that one of your dependencies is doing an undercover include of the offending class.
 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic