8 Replies Latest reply on Dec 20, 2011 3:53 AM by sabbirali

    Deploy Ear in Jboss 7

    sabbirali

      My Project structure as below

       

      IASCommon -- Java Utility Classes

      IASEJB -- EJB's

      IASWeb -- web

      IASEar -- include common lib [log4j also] and application.xml

       

      My Application file as below

       

      <?xml version="1.0" encoding="ASCII"?>

      <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">

        <display-name>IASEar</display-name>

        <module>

          <web>

            <web-uri>IASWeb-Strust2.war</web-uri>

            <context-root>IASWeb</context-root>

          </web>

        </module>

        <module>

          <ejb>IASEJB.jar</ejb>

        </module>

        <library-directory>libs</library-directory>

      </application>

       

      When i deploy it to jboss 7 its giving eror

       

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."IASEar.ear"."IASEJB.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."IASEar.ear"."IASEJB.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "IASEJB.jar" of deployment "IASEar.ear"

       

      Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Logger;

                at java.lang.Class.getDeclaredFields0(Native Method) [:1.6.0_10]

                at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [:1.6.0_10]

                at java.lang.Class.getDeclaredFields(Class.java:1743) [:1.6.0_10]

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57)

                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)

                ... 11 more

        • 1. Re: Deploy Ear in Jboss 7
          sabbirali

          I resolve above problem when i added

          Dependencies: org.apache.log4j in Ear's MANIFEST.MF

           

          but got another error as below in EJB module class

           

          Caused by: java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO$Client

                    at java.lang.Class.getDeclaredMethods0(Native Method) [:1.6.0_10]

                    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [:1.6.0_10]

                    at java.lang.Class.getDeclaredMethods(Class.java:1791) [:1.6.0_10]

                    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]

                    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]

                    ... 11 more

           

          Caused by: java.lang.ClassNotFoundException: com.sap.mw.jco.JCO$Client from [Module "deployment.IASEar.ear.IASEJB.jar:main" from Service Module Loader]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)

                    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_10]

                    ... 16 more

           

          Quick response appreciate....

          • 2. Re: Deploy Ear in Jboss 7
            ctomc

            You are probably missing sap jconnector jar in your ear lib

            • 3. Re: Deploy Ear in Jboss 7
              sabbirali

              no sap connector jar file is already there

              • 4. Re: Deploy Ear in Jboss 7
                ctomc

                what does the output of jar tf <name-of-your-ear>.ear prints out?

                 

                Do you have MANIFEST.MF present in your ejb-jar? If yes, what are the entries?

                 

                 

                cheers,

                tomaz

                • 5. Re: Deploy Ear in Jboss 7
                  sabbirali

                  output of jar tf command as below

                   

                  D:\Temp Document>jar tf IASEar.ear


                  META-INF/MANIFEST.MF

                  IASCommon.jar

                  IASEJB.jar

                  IASWeb-Strust2.war

                  META-INF/

                  META-INF/application.xml

                  libs/ojdbc5.jar

                  libs/sapjco.jar

                  • 6. Re: Deploy Ear in Jboss 7
                    ebross

                    Some hints:
                    1 Find in which project “com.sap.mw.jco.JCO$Client” belongs and add it to the IASEJB build path
                    2. Since IASCommon is a utility project, it should go under IASEAR/libs
                    2. (Not the problem) You also what to update you xsd to:

                     

                    <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">

                    If it doesn't work, I would need to know more about com.sap.mw.jco.JCO$Client (i.e., nature of the project) to improve my next response.

                     

                    Cheers

                    • 7. Re: Deploy Ear in Jboss 7
                      ctomc

                      Does IASEJB.jar have any class-path defined in manifest.mf? if not, can you set it up for "sapjco.jar" ?

                       

                      If you use maven, you just say to add classpath for ejbs

                      • 8. Re: Deploy Ear in Jboss 7
                        sabbirali

                        I have resolved above error

                         

                        1. I copy all common jar in IASEar folder. not in libs folder.

                        2. Add Class-Path: sapjco.jar in Menifest file for IASEJB.

                        3. Add Class-Path: sapjco.jar in Menifest file fof IASCommon.

                         

                         

                        Thanx all for your reply