From: Bill B. <bb...@re...> - 2013-02-05 14:13:28
|
What does "in you classpath" mean? The jars are in WEB-INF/lib? On 2/5/2013 8:51 AM, Marcus Cavalcanti wrote: > Hi Weinan, > > I tried what you recommended and the error to deploy still, but the > stacktrace change. > > Now my web.xml is look like below: > > <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> > <servlet> > <servlet-name>Resteasy</servlet-name> > > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > <init-param> > <param-name>javax.ws.rs.Application</param-name> > > <param-value>com.br.ideais.core.CoreApplication</param-value> > </init-param> > </servlet> > <context-param> > <param-name>resteasy.media.type.mappings</param-name> > <param-value>html : text/html, txt : text/plain, xml : > application/xml</param-value> > </context-param> > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > </web-app> > > The stackstrace at deploy time: > > INFO: Marking servlet Resteasy as unavailable > > Feb 5, 2013 11:38:16 AM org.apache.catalina.core.StandardWrapperValve invoke > > SEVERE: Allocate exception for servlet Resteasy > > java.lang.ClassNotFoundException: > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher > > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) > > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) > > at > org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527) > > at > org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509) > > at > org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) > > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1137) > > at > org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:858) > > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136) > > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) > > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) > > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) > > at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) > > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) > > at > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) > > at > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) > > at > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) > > 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:680) > > The *resteasy-cdi-2.3.5.Final.jar* is not in the classpath. > > I noticed that the HttpServletDispatcher is in > *resteasy-jaxrs-2.3.5.Final.jar *and this JAR is in the classpath. > > This class (HttpServletDispatcher) can be duplicated in the classpath > (in the classpath of Tomcat7)? > > > > -- > Marcus Cavalcanti > 21 9144-5068 > www.marcuscavalcanti.net/blog <http://www.marcuscavalcanti.net/blog> > > > On Tue, Feb 5, 2013 at 5:04 AM, Weinan Li <we...@re... > <mailto:we...@re...>> wrote: > > Hi Marcus, > > Seems the J2EE container integration is triggered in your settings. > Have you used @ApplicationPath in your Application class? Please > remove it if you have done so and register your resources manually. > In a non-j2ee container we must use the standalone way to register > our resources. There are two ways to achieve this: > > - Put your resources into your Application class: > ... > classes.add(MyResource) > … > > And enable your Application class in your web.xml: > > <servlet> > <servlet-name>Resteasy</servlet-name> > > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > <init-param> > <param-name>javax.ws.rs.Application</param-name> > <param-value>com.my.MyApplication</param-value> > </init-param> > </servlet> > > - Use the context-param: > > <context-param> > <param-name>resteasy.resources</param-name> > <param-value>com.my.MyResource </param-value> > </context-param> > > Please refer to the RESTEasy document to get more details :-) > > -- > Weinan Li > > On Tuesday, February 5, 2013 at 3:50 AM, Marcus Cavalcanti wrote: > >> Hi everybody, >> >> I have problems to deploy an application using Resteasy 2.3.5 in >> Tomcat 7. >> >> The project is very simple and my web.xml <http://web.xml> is as >> below: >> <servlet> >> <servlet-name>Resteasy</servlet-name> >> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> >> </servlet> >> <listener> >> <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> >> </listener> >> <servlet-mapping> >> <servlet-name>Resteasy</servlet-name> >> <url-pattern>/services/*</url-pattern> >> </servlet-mapping> >> <context-param> >> <param-name>resteasy.servlet.mapping.prefix</param-name> >> <param-value>/services</param-value> >> </context-param> >> In deploy time, the error below occurs: >> >> java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual >> 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.getConstructor(Class.java:1657) >> at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:140) >> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:67) >> at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.init(FilterDispatcher.java:39) >> at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) >> at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262) >> at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107) >> at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656) >> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5312) >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) >> at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3926) >> at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426) >> at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345) >> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530) >> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540) >> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540) >> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519) >> at java.lang.Thread.run(Thread.java:680) >> Caused by: java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual >> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) >> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) >> ... 21 more >> Feb 4, 2013 5:32:14 PM org.apache.catalina.core.StandardContext startInternal >> SEVERE: Error filterStart >> >> I have saw many sites recommending to delete the >> *resteasy-cdi-2.3.5.Final.jar* file, but if I remove this file >> another error occurs: >> >> SEVERE: Error configuring application listener of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap >> java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap >> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) >> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) >> at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527) >> at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509) >> at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) >> at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4733) >> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291) >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) >> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) >> at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) >> 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:680) >> Feb 4, 2013 5:44:51 PM org.apache.catalina.core.StandardContext listenerStart >> SEVERE: Skipped installing application listeners due to previous error(s) >> >> Is it possible to run resteasy 2.3.5 with Tomcat7? If it is >> possible, how can I solve this problem? >> >> Thanks in advanced. >> >> -- >> Marcus Cavalcanti >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_jan >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> <mailto:Res...@li...> >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > ------------------------------------------------------------------------------ > Free Next-Gen Firewall Hardware Offer > Buy your Sophos next-gen firewall before the end March 2013 > and get the hardware for free! Learn more. > http://p.sf.net/sfu/sophos-d2d-feb > > > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |