2 Replies Latest reply on Jun 5, 2009 10:09 AM by je.a.le

    dependence of libraries - the wide scope of EAR

      I am defining the scope of the EAR level. So have the JAR used by all modules in the folder / lib of the EAR, and WAR's WEB-INF/lib folder in the JAR for this specific module.

      The problem is that when you start JBoss java.lang.NoClassDefFound the error occurs.

      I have several different configurations and tests and also noticed that .xml or .properties files that are in the JARs folder / lib of the EAR are not seen by the WAR module.

      The structure of the EAR is configured as follows

      - myapp.ear
      | - / Lib (default jar)
      | - myapp.war
      | --WEB-INF/lib (Specific jars of WAR)
      | - myejb-ejb.jar
      | META-INF / (configured xml)

      How solve this problem.

      Thank you.

        • 1. Re: dependence of libraries - the wide scope of EAR

          Someone went through this problem?

          • 2. Re: dependence of libraries - the wide scope of EAR
            je.a.le

            Your ear tree doesn't look right (you should use netbeans...)

            Here one :

            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/META-INF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/META-INF/application.xml
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/META-INF/jboss-app.xml
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/META-INF/MANIFEST.MF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/jai_codec.jar <--lib ejb and war depend on (if not on class path, e.i. in a jboss lib dir already)
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/jai_core.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/JaiExt.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/JBoss4.dpf
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/jstl.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/lucene-analyzers-2.3.2.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/lucene-core-2.3.2.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/mlibwrapper_jai.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/VostokStringUtilLib.jar
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-ejb.jar <--- jar with ejb
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-ejb.jar/META-INF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-ejb.jar/META-INF/jboss.xml
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-ejb.jar/META-INF/MANIFEST.MF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-ejb.jar/webtv <--- tree of classes...
            .... (etc)
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war <--- war archive !
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/META-INF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/META-INF/MANIFEST.MF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/WEB-INF
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/WEB-INF/web.xml
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/WEB-INF/portlet.xml
            .... (jsp, xml for jboss portal , etc...)
            zip:/opt/jboss-4.2.1.GA/server/all/deploy/WebTv.ear/WebTv-war.war/index.jsp <-- everything that's public inside this domain

            content of application.xml :

            <?xml version="1.0" encoding="UTF-8"?>
            <application version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
             <display-name>WebTv</display-name>
             <module>
             <ejb>WebTv-ejb.jar</ejb>
             </module>
             <module>
             <web>
             <web-uri>WebTv-war.war</web-uri>
             <context-root>/WebTv-war</context-root>
             </web>
             </module>
            </application>
            


            content of jboss-app.xml :
            <?xml version="1.0" encoding="UTF-8"?>
            <jboss-app>
             <loader-repository>
             webtv:archive=WebTv.ear
             </loader-repository>
            </jboss-app>