5 Replies Latest reply on Jun 6, 2011 5:35 AM by jonne.deprez

    Seam Solder classloading issue on JBoss6

    jonne.deprez

      Hi,


      I encountered a weird issue when deploying one of the modules of our project on a JBossAS6-Final after I had just added Seam 3 as a dependency to the Maven POM file.


      There seems to be a conflict between Seam Solder and the JODReports library, that itself depends on jython and freemarker. The deployment fails with a NoClassDefFoundError caused by a missing class org.python.core.PyException. In an attempt to solve this I explicitly added jython 2.2 as a dependency to the pom, but the deployment now fails with a NoClassDefFoundError caused by freemarker.ext.jdom.NodeListModel$AttributeXMLOutputter. This is strange, because this class is clearly part of the deployed package. Somehow, just adding Seam Solder to the project prevents a class on the classpath from being loaded. In the maven tree no conflicts are visible.


      I have stripped down the module to the simplest pom file that can still reproduce the issue. Can someone explain me what's happening and - if possible - how I can find a workaround? It is currently blocking us from using Seam 3. To reproduce the error I deployed a package that was built with the following pom.xml and contained a single EJB with a local interface and nothing more than a doNothing() method.


      Thanks in advance.


      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>eu.eee.synaptiq</groupId>
          <artifactId>seam-solder-compatibility</artifactId>
          <name>Seam solder compatibility check</name>
          <version>0.1</version>
          <packaging>jar</packaging>
      
          <properties>
              <jdk.source>1.6</jdk.source>
              <jdk.target>1.6</jdk.target>
          </properties>
      
          <repositories>
              <repository>
                  <id>repository.jboss.org</id>
                  <name>JBoss Repository</name>
                  <url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
                  <releases>
                      <enabled>true</enabled>
                  </releases>
                  <snapshots>
                      <enabled>false</enabled>
                  </snapshots>
              </repository>
          </repositories>
      
          <build>
              <finalName>
                  ${project.artifactId}-${project.version}
              </finalName>
              <plugins>
                  <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <configuration>
                          <source>${jdk.source}</source>
                          <target>${jdk.target}</target>
                          <encoding>utf-8</encoding>
                          <debug>${jdk.debug}</debug>
                          <optimize>${jdk.optimize}</optimize>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-shade-plugin</artifactId>
                      <version>1.4</version>
                      <executions>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>shade</goal>
                              </goals>
                              <configuration>
                                  <filters>
                                      <filter>
                                          <artifact>eu.eee.synaptiq:seam-solder-compatibility</artifact>
                                          <excludes>
                                              <exclude>META-INF/ejb-jar.xml</exclude>
                                              <exclude>META-INF/beans.xml</exclude>
                                          </excludes>
                                      </filter>
                                  </filters>
                                  <shadedArtifactAttached>true</shadedArtifactAttached>
                                  <shadedClassifierName>component</shadedClassifierName>
                              </configuration>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      
          <dependencies>
              <dependency>
                  <groupId>org.jboss.ejb3</groupId>
                  <artifactId>jboss-ejb3-api</artifactId>
                  <scope>provided</scope>
                  <version>3.1.0</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.seam.solder</groupId>
                  <artifactId>seam-solder</artifactId>
                  <version>3.0.0.Final</version>
              </dependency>
              <dependency>
                  <groupId>net.sf.jodreports</groupId>
                  <artifactId>jodreports</artifactId>
                  <version>2.4.0</version>
              </dependency>
              <dependency>
                  <groupId>com.artofsolving</groupId>
                  <artifactId>jodconverter</artifactId>
                  <version>2.2.1</version>
              </dependency>
              <dependency>
                  <groupId>org.python</groupId>
                  <artifactId>jython</artifactId>
                  <version>2.2</version>
              </dependency>
          </dependencies>
      
      </project>




        • 1. Re: Seam Solder classloading issue on JBoss6
          lightguard

          Sounds like you're deploying an EAR, is this correct? If that's the case where are the libraries?

          • 2. Re: Seam Solder classloading issue on JBoss6
            jonne.deprez

            No it's a jar that in the real project bundles EJB's. The dependent libraries are included using the maven shade plugin. 


            The complete project is of course much too big to post on this forum, but just this pom is already enough to produce a jar package that can not be deployed on JBoss6. You can build it by running 'mvn package' in the directory where you placed the pom file.

            • 3. Re: Seam Solder classloading issue on JBoss6
              lightguard

              You're adding this jar into a war? If not, how are you deploying just a jar?

              • 4. Re: Seam Solder classloading issue on JBoss6
                asiandub

                I took your pom, changed packaging to war and deployed it to JBoss AS 6 GA without problems (using eclipse / m2eclipes, the latter adds some basic files to make it a war project).


                These are the dependencies from the WEB-INF/lib



                commons-io-1.4.jar     
                jodreports-2.4.0.jar  
                jython-2.2.jar             
                slf4j-api-1.6.1.jar
                freemarker-2.3.16.jar     
                juh-2.3.0.jar           
                ridl-2.3.0.jar             
                unoil-2.3.0.jar
                jodconverter-2.2.1.jar     
                jurt-2.3.0.jar           
                seam-solder-3.0.0.Final.jar  
                xom-1.2.5.jar




                If you didn't strip off too much I suspect that your local JBoss is somehow misconfigured or simply needs its temp folder cleared...


                • 5. Re: Seam Solder classloading issue on JBoss6
                  jonne.deprez

                  Thank you very much for your help, it helped me solve the problem. By changing the packaging to war it worked.


                  Deploying just a jar file on JBossAS6 is perfectly possible for a EJB3 package. At least, that's what we've been doing for the last 6 months.
                  But apparently it is not possible to use Weld inside such a package...