9 Replies Latest reply on Jun 23, 2011 4:10 AM by Juergen Zimmermann

    Classloader issue with RESTEasy

    Juergen Zimmermann Master

      I'm trying to migrate a part of an EAR to JBoss 7 (Jenkins build 1241). The EAR contains an EJB module with session beans, and some session beans are impl classes for interfaces with JAX-RS annotations (@Path, @GET, ...). The web module just consists of web.xml declaring some functionality for RESTEasy. I inserted into the META-INF/Manifest.MF file the following lines, but get a stacktrace (see below) when a GET request is submitted.

       

      Addition to the web module's Manifest.MF:

      Dependencies: org.jboss.resteasy.resteasy-jaxrs,

      org.jboss.resteasy.resteasy-jaxb-provider,

      org.jboss.resteasy.resteasy-jackson-provider,

      org.jboss.resteasy.async-http-servlet-30,

      org.jboss.resteasy.resteasy-cdi,

      org.jboss.resteasy.resteasy-multipart-provider

       

      Stacktrace for GET request:

      [org.jboss.resteasy.core.SynchronousDispatcher] (http-127.0.0.1-127.0.0.1-8080-2) Failed executing GET /kundenverwaltung/kunden/1: org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: de.swe1.kundenverwaltung.domain.Privatkunde of media type: application/xml

              at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:202) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:563) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

      ...

      The message body writers for JAXB/XML are included in the resteasy-jaxb-provider module. Any hint is appreciated.

        • 1. Re: Classloader issue with RESTEasy
          jaikiran pai Master

          Is that the entire exception stacktrace? If not, please post the entire stacktrace.

          • 2. Re: Classloader issue with RESTEasy
            Juergen Zimmermann Master

            Here is the entire stacktrace.

            13:29:37,637 SCHWERWIEGEND [org.jboss.resteasy.core.SynchronousDispatcher] (http-127.0.0.1-127.0.0.1-8080-2) Failed executing GET /kundenverwaltung/kunden/1: org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: de.swe1.kundenverwaltung.domain.Privatkunde of media type: application/xml

                at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:202) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:563) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:484) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.core.AsynchronousDispatcher.invoke(AsynchronousDispatcher.java:243) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cresteasy%5Cresteasy-jaxrs%5Cmain%5Cresteasy-jaxrs-2.1.0.GA.jar:]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Cjavax%5Cservlet%5Capi%5Cmain%5Cjboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

                at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjboss-as-web-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]

                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cjpa%5Cmain%5Cjboss-as-jpa-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:893) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2054) [file:C:%5CSoftware%5Cjboss-7.0.0.CR1-b1241%5Cmodules%5Corg%5Cjboss%5Cas%5Cweb%5Cmain%5Cjbossweb-7.0.0.CR2.jar:7.0.0.Beta4-SNAPSHOT]

                at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

            • 3. Re: Classloader issue with RESTEasy
              jaikiran pai Master

              Off topic - Is it the forum editor messing up the stacktrace with all those % signs or is it actually reported like this by the server?

              • 4. Re: Classloader issue with RESTEasy
                Juergen Zimmermann Master

                %5C comes directly from server.log and means "\" on a Windows platform. I'm using JBoss Logging.

                • 5. Re: Classloader issue with RESTEasy
                  jaikiran pai Master

                  Can you attach a simple app for this too? I or someone else can give it a quick try.

                  • 6. Re: Classloader issue with RESTEasy
                    jaikiran pai Master

                    Juergen Zimmermann wrote:

                     

                    %5C comes directly from server.log and means "\" on a Windows platform. I'm using JBoss Logging.

                    Just a FYI - David Lloyd fixed this issue with the paths in JBoss Modules project, a few minutes back, and that'll be pushed to AS7 upstream today. 

                    • 7. Re: Classloader issue with RESTEasy
                      Juergen Zimmermann Master

                      The classloader issue is gone when using Jenkins build 1253: my RESTful webservice is working with JBoss 7. However, all log records are also gone :-( I'm logging via JBoss Logging and an EJB 3 interceptor.

                      • 8. Re: Classloader issue with RESTEasy
                        jaikiran pai Master

                        Juergen Zimmermann wrote:

                         

                        The classloader issue is gone when using Jenkins build 1253: my RESTful webservice is working with JBoss 7.

                        Stuart fixed it http://lists.jboss.org/pipermail/jboss-as7-dev/2011-June/002735.html

                         

                         

                        Juergen Zimmermann wrote:

                         

                        However, all log records are also gone :-( I'm logging via JBoss Logging and an EJB 3 interceptor.

                        Can you explain a bit more on what's happening? Any relevant code, configuration and/or logs?

                        • 9. Re: Classloader issue with RESTEasy
                          Juergen Zimmermann Master

                          In standalone.xml I'm having this entry: <logger category="de.swe1"><level name="TRACE"/></logger>

                          I'm also having an Interceptor to do the logging stuff. This is working since JBoss 4.2.3 -- in JBoss 6 I changed the Interceptor's implementation from SLF4J to JBoss Logging. Everything was logged as expected: in 4.2.3, in 5.1, in 6.0, and also in the 7.0 snapshots until the above change came on board.

                           

                          Now I have not any log records coming from my EAR app.