2 Replies Latest reply on Mar 7, 2012 10:53 AM by zeeman

    Correct way for (not) deploying RestEasy in JBoss 7.1 Apps?

    tim99

      Hi,

       

      my servlet uses resteasy-jaxrs and resteasy-jaxb-provider, both in version 2.3.1.GA. I configured the POM to use them. I can deploy my servlet with both of them and it runs in JBoss 7.1.

       

      However, as JBoss provides these modules, I would like to use the JBoss ones. When I mark both dependencies as "provided" in my Maven POM together with the following plugin, JBoss deploys the app:

       

      <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-war-plugin</artifactId>

            <configuration>

          <archive>

            <manifestEntries>

              <Dependencies>org.jboss.resteasy.resteasy-jaxrs</Dependencies>

              <Dependencies>org.jboss.resteasy.resteasy-jaxb-provider</Dependencies>

            </manifestEntries>

          </archive>

           </configuration>

      </plugin>

       

      However, at runtime, I get this error message:

       

      java.lang.NoClassDefFoundError: org/jboss/resteasy/client/ClientRequest

       

      I wonder why JBoss can't find it. Can anyone tell me what's wrong with my approach? Any help is greatly appreciated! Of course, I can provide more information about this case.

       

      Thanks!

       

       

      Tim

        • 1. Re: Correct way for (not) deploying RestEasy in JBoss 7.1 Apps?
          tim99

          No ideas?

          • 2. Re: Correct way for (not) deploying RestEasy in JBoss 7.1 Apps?
            zeeman

            Your mvn config does not look right. Find a good example of how to add dependencies to as7 via maven.

             

            An alternative way of doing this: create a file named jboss-deployment-structure.xml under web-inf and put in it your depenendencies. What I use:

             

            <jboss-deployment-structure>

               <deployment>

            <!--               <exclusions> -->

            <!--               </exclusions>  -->

                          <dependencies>

                            <module name="org.apache.commons.collections" />

                            <module name="org.apache.commons.codec" />

                            <module name="org.codehaus.jackson.jackson-mapper-asl" />

                            <module name="org.codehaus.jackson.jackson-core-asl" />

                            <module name="org.jboss.resteasy.resteasy-jaxrs" />

                                   <module name="org.jboss.logging" />

                                  <module name="org.jboss.logmanager" />

                                  <module name="org.apache.httpcomponents" />

                          </dependencies>

                </deployment>  

            </jboss-deployment-structure>