0 Replies Latest reply on Mar 3, 2009 7:40 AM by Robert Buck

    EAR With no WAR: java.lang.NoClassDefFoundError

    Robert Buck Newbie

      I get NoClassDefFoundError when I attempt to start up a JBoss service packaged into an EAR file. There is no WAR file in this application as there is no web interface. I get this error even if I put my JAR file into the server/default/lib directory. Yes, the JAR does indeed contain the .class file JBoss says no definition exists.

      I did this:

      * created a JBoss service
      * I packaged all the Java class files into a JAR file
      * I put this JAR file into the EAR file's lib/ directory
      * The ear has a manifest Class-Path entry pointing to the jar
      * I added a jboss-app.xml file to the EAR file (below)
      * I added an application.xml file to the EAR file (below)
      * I created a SAR file that contains the same manifest entry
      * In the SAR file I added a jboss-service.xml file (below)
      * I put the SAR file in the EAR file

      jboss-app.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
      <jboss-app>
       <loader-repository>verisign.submanager:loader=submanager.ear</loader-repository>
       <module>
       <service>submanager.sar</service>
       </module>
      </jboss-app>


      jboss-service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
      <server>
       <loader-repository>verisign.submanager:loader=submanager.sar</loader-repository>
      ...
      


      application.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN"
       "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
      <application>
       <display-name>VeriSign Subscriptions Manager</display-name>
       <description>VeriSign Subscriptions Manager</description>
       <module>
       <ejb>submanager.sar</ejb>
       </module>
      </application>