Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Jetty Servlet Unavailable Exception

Srijith,
This sounds like something simple to do however I'm not certain on the details of how the WebAppClassLoader is parented in Jetty when running in an OSGi container however it looks like your webapp cannot see the servlet bundles exports. I'd suggest asking on the jetty-dev or jetty-user list.
Equinox provides an implementation of the OSGi Http Service and to be honest if you're running in an OSGi container I would suggest using that approach over trying to sort out deploying a WAR.
-Simon

Inactive hide details for "Srijith Kochunni" ---06/10/2010 01:17:42 AM---$(UHi Simon,"Srijith Kochunni" ---06/10/2010 01:17:42 AM---$(UHi Simon,


From:

"Srijith Kochunni" <ksrijith@xxxxxxxxxx>

To:

"Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>

Date:

06/10/2010 01:17 AM

Subject:

Re: [equinox-dev] Jetty Servlet Unavailable Exception

Sent by:

equinox-dev-bounces@xxxxxxxxxxx




Hi Simon,

You were right.! There was a javax.servlet bundle in my osgi runtime, as well as a servlet-api.jar in my webapps shared library folder, which must have caused this issue. However I find that my problem does not go away. The only thing is the exception is different this time.


2010-06-10 10:25:46.093::WARN: failed MyServlet
java.lang.NoClassDefFoundError: javax/servlet/Servlet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:667)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)


I did a 'packages javax.servlet' in the osgi prompt and see that the only provider is a javax.servlet bundle and both mortbay jetty server as well as my application which basically deploys war files from a folder to the jetty server instance, both import from this same bundle. I am not sure, why still it is throwing this noClassDefFound Error now. How can I make sure that WebaAppClassLoader is always able to pick up this javax.servlet.Servlet class.?



Thanks,
Srijith.


>>> Simon Kaegi <Simon_Kaegi@xxxxxxxxxx> 6/9/2010 11:06 PM >>>

Hi Srijith,
This sort of error happens when you have more than one provider of the Servlet API. In this case your application is binding to a different exporter of the Servlet API than what's being used by Jetty. It's usually simplest to just have the one javax.servlet bundle exporting the Servlet API in an application.
HTH
-Simon

Inactive hide details for "Srijith Kochunni" ---06/09/2010 06:51:14 AM---Hi, I have a webApp which I am deploying with Equinox Jetty Server. It works fine, however at


From:

"Srijith Kochunni" <ksrijith@xxxxxxxxxx>

To:

<equinox-dev@xxxxxxxxxxx>

Date:

06/09/2010 06:51 AM

Subject:

[equinox-dev] Jetty Servlet Unavailable Exception

Sent by:

equinox-dev-bounces@xxxxxxxxxxx




Hi,


I have a webApp which I am deploying with Equinox Jetty Server. It works fine, however at times, when I stop and start the application, I get the following exception and my Application is then not accessible.


2010-06-09 15:18:35.014:/MyWebApp:WARN: unavailable

javax.servlet.UnavailableException: Servlet class com.test.MyServlet is not a javax.servlet.Servlet

at org.mortbay.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:353)

at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:243)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:667)

at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239)

at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)

at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466)

at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)


MyServlet class extends from HttpServlet and implements javax.servlet.Servlet interface. Not sure why this exception happens. My application is running in an equinox osgi runtime. Any help in this regard would be greatly appreciated.


Thanks,

Srijith.
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image


Back to the top