Re: [jetty-user] RestEasy and Jetty 7.x ClassNotFoundException
Jan Bartel <[email protected]>
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Organization | Webtide |
| Message-ID | <[email protected]> |
John, Where is the cdi jar? Is it located inside your webapp? If so, the web container cannot load it, because a webapp is not allowed to replace "javax." package. These have to be on the container's classpath. Did you copy a cdi api jar perhaps into your jetty-6/lib, but not into your jetty-7 installation? If there is still a problem, can you post a small webapp that demonstrates the problem (ie succeeds on a clean jetty-6.1.26 install, but fails on a clean jetty-7.2.0 install). thanks Jan On 03/11/10 16:17, John Smith wrote: > I'm trying to run RestEasy on GigaSpaces XAP and I get a > ClassnotFoundException: javax.enterprise.context.spi.Contextual > at java.net.URLClassLoader$1.run(URLClassLoader.java:202) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:190) > at > org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:360) > at > org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:322) > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) > at java.lang.Class.getConstructor0(Class.java:2699) > at java.lang.Class.newInstance0(Class.java:326) > at java.lang.Class.newInstance(Class.java:308) > at > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:154) > at > org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) > at > org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:645) > at > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:200) > at > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:995) > at > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:588) > at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:381) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) > at > org.openspaces.pu.container.jee.jetty.JettyJeeProcessingUnitContainerProvider.createContainer(JettyJeeProcessingUnitContainerProvider.java:532) > at > org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.startPU(PUServiceBeanImpl.java:583) > at > org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.doStart(PUServiceBeanImpl.java:204) > at org.jini.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:291) > at org.jini.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:304) > at org.jini.rio.jsb.JSBLoader.create(JSBLoader.java:106) > at org.jini.rio.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:276) > at org.jini.rio.cybernode.JSBDelegate.startServiceBean(JSBDelegate.java:461) > at org.jini.rio.cybernode.JSBDelegate.load(JSBDelegate.java:316) > at org.jini.rio.cybernode.JSBContainer.activate(JSBContainer.java:213) > at org.jini.rio.cybernode.CybernodeImpl.instantiate(CybernodeImpl.java:1034) > at > org.jini.rio.core.provision.ServiceBeanInstantiatorGigaspacesMethodinternalInvoke3.internalInvoke(Unknown > Source) > at > com.gigaspaces.internal.reflection.fast.AbstractMethod.invoke(AbstractMethod.java:34) > at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:372) > at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:462) > at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:551) > at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:161) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > 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:619) > > I pretty much get the same error using Jetty alone. > > XAP uses 7.1.4 I also tried 7.2 in standalone and I get the same > exception but obviously the stack is a bit different. > > With 6.1.26 standalone everything works perfect. All I'm doing is > deploying the same war to the 3 different servers. the application is > quite simple. All it does is say Hello World on a REST URL like... > http://myhost/myapp/myservice/hello > > It seems that the the dependency injection is missing? > > Also my web.xml > > <?xml version="1.0" encoding="UTF-8"?> > <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" > version="2.5"> > <display-name>TestRestEasy</display-name> > > <context-param> > <param-name>javax.ws.rs.core.Application</param-name> > <param-value>com.xxxx.services.TestApplication</param-value> > </context-param> > > <listener> > <listener-class> > org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> > </listener> > > <servlet> > <servlet-name>Resteasy</servlet-name> > <servlet-class> > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > </servlet> > > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > > </web-app> > -- Jan Bartel, Webtide LLC | [email protected] | http://www.webtide.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email