11 Replies Latest reply on Apr 25, 2013 10:30 AM by Prashanto Chatterjee

    Unable to deploy exploded SAR with module dependencies

    Prashanto Chatterjee Newbie

      Hi,

      I am facing some starter problems using JBoss AS 7. Please pardon my ignorance if this has been answered earlier. I searched the forum and searched the web and after 4 days of toil I resorted to posting on the forum.

       

      I am trying to deploy an exploded SAR with compiled classes. The compiled classes have a dependency on a few JARs that I have placed under a module 'xyz.common'. In my SAR, I have added jboss-deployment-structure.xml as follows:

      <jboss-deployment-structure>

              <deployment>

                      <dependencies>

                              <module name="xyz.common" export="true" />

                      </dependencies>

              </deployment>

      </jboss-deployment-structure>

       

      When I try to deploy the SAR, I am getting the following exception:

      10:27:48,224 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "AAATMProp.sar"

      10:27:48,391 ERROR [stderr] (MSC service thread 1-2) java.lang.ClassNotFoundException: com/avaya/mgmt/trust/data/TMClientInventory_Header

      10:27:48,392 ERROR [stderr] (MSC service thread 1-2) Continuing ...

      10:27:48,394 ERROR [stderr] (MSC service thread 1-2) java.lang.NoSuchMethodException: <unbound>=XMLDecoder.new();

      10:27:48,394 ERROR [stderr] (MSC service thread 1-2) Continuing ...

      10:27:48,395 ERROR [stderr] (MSC service thread 1-2) java.lang.IllegalStateException: The outer element does not return value

      10:27:48,395 ERROR [stderr] (MSC service thread 1-2) Continuing ...

      10:27:48,396 ERROR [stderr] (MSC service thread 1-2) java.lang.IllegalStateException: The outer element does not return value

      10:27:48,396 ERROR [stderr] (MSC service thread 1-2) Continuing ...

       

      The class is present in one of the JARs that I have packaged under the 'xyz.common' module.

       

      Can someone kindly point out what I have missed out? I am stuck for the last few days and no amount of searching on the web and pouring through the documentation has helped.

       

      My SAR structure is as follows:

      deployments

      - AAATMProp.sar

      - com

           - <compiled classes>

      - META-INF

           - jboss-deployment-structure.xml

                          - jboss-service.xml

                          - MANIFEST.MF

       

      The manifest file does not contain any dependencies or classpath settings.

       

      Regards,

      Prashanto Chatterjee

        • 2. Re: Unable to deploy exploded SAR with module dependencies
          Prashanto Chatterjee Newbie

          Any pointers would be appreciated. If this has been answered previously then kindly point me to the appropriate thread.

          • 3. Re: Unable to deploy exploded SAR with module dependencies
            Nicklas Karlsson Master

            Never used SARs, but let's look at the module, could you post the module.xml and the exact directory layout + files of the module directories?

            • 5. Re: Unable to deploy exploded SAR with module dependencies
              Prashanto Chatterjee Newbie

              Thanks Nicklas. Appreciate your response.

               

              I had already taken a look at the thread that you have pointed out. But my deployment is different. In my case I do not have any JARs bundled with the SAR. Instead I created a common module to hold the 3 related JARs. Here is the module descriptor of the common module:

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.1" name="com.avaya.mgmt.trust">

                      <dependencies>

                              <module name="com.avaya.mgmt.logging" export="true" />

                      </dependencies>

                      <resources>

                              <resource-root path="tmclient.jar"/>

                              <resource-root path="jboss-rmi-socket-factory.jar"/>

                              <resource-root path="jboss-trust-logging.jar"/>

                      </resources>

              </module>

               

              And here is how my deployment descriptor looks like:

              <jboss-deployment-structure>

                      <deployment>

                              <exclusions>

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

                              </exclusions>

                              <dependencies>

                                      <module name="com.avaya.mgmt.trust" export="true" />

                              </dependencies>

                      </deployment>

              </jboss-deployment-structure>

               

              The class it is complaining about:

              10:27:48,391 ERROR [stderr] (MSC service thread 1-2) java.lang.ClassNotFoundException: com/avaya/mgmt/trust/data/TMClientInventory_Header

              This class is present in the tmclient.jar archive. The other two jar names may be a bit misleading but they are our distribution and share the same package as the classes in tmclient.jar. Hence I have put these JARs together.

              • 6. Re: Unable to deploy exploded SAR with module dependencies
                Nicklas Karlsson Master

                How about the modules structure (entire dir/file list from modules down)?

                • 7. Re: Unable to deploy exploded SAR with module dependencies
                  Prashanto Chatterjee Newbie

                  My apologies for not listing the archive structure. Here is what it looks like:

                  AAATMProp.sar/com

                  AAATMProp.sar/com/avaya

                  AAATMProp.sar/com/avaya/mgmt

                  AAATMProp.sar/com/avaya/mgmt/installer

                  AAATMProp.sar/com/avaya/mgmt/installer/utils

                  AAATMProp.sar/com/avaya/mgmt/installer/utils/jboss

                  AAATMProp.sar/com/avaya/mgmt/installer/utils/jboss/TMPropertyWrapper.class

                  AAATMProp.sar/com/avaya/mgmt/installer/utils/jboss/TMPropertyWrapperMBean.class

                  AAATMProp.sar/META-INF

                  AAATMProp.sar/META-INF/maven

                  AAATMProp.sar/META-INF/maven/com.avaya.smgr.installer

                  AAATMProp.sar/META-INF/maven/com.avaya.smgr.installer/AAATMProp

                  AAATMProp.sar/META-INF/maven/com.avaya.smgr.installer/AAATMProp/pom.properties

                  AAATMProp.sar/META-INF/maven/com.avaya.smgr.installer/AAATMProp/pom.xml

                  AAATMProp.sar/META-INF/jboss-deployment-structure.xml

                  AAATMProp.sar/META-INF/MANIFEST.MF

                  AAATMProp.sar/META-INF/jboss-service.xml

                   

                  Its an exploded SAR. I have a few compiled classes and these refer to classes in the module dependencies.I have not put any configuration pieces in the manifest yet.

                  • 8. Re: Unable to deploy exploded SAR with module dependencies
                    Nicklas Karlsson Master

                    how about the module, is it

                     

                    modules

                        com

                            avaya

                                mgmt

                                    trust

                                        main

                                            module.xml

                                            jar files....

                     

                    ?

                    • 9. Re: Unable to deploy exploded SAR with module dependencies
                      Prashanto Chatterjee Newbie

                      Yes. Thats the structure.

                       

                      com/avaya/mgmt/trust/main/

                      com/avaya/mgmt/trust/main/jboss-rmi-socket-factory.jar

                      com/avaya/mgmt/trust/main/tmclient.jar.index

                      com/avaya/mgmt/trust/main/module.xml

                      com/avaya/mgmt/trust/main/jboss-trust-logging.jar

                      com/avaya/mgmt/trust/main/tmclient.jar

                      com/avaya/mgmt/trust/main/jboss-rmi-socket-factory.jar.index

                      com/avaya/mgmt/trust/main/jboss-trust-logging.jar.index

                       

                      Actually I should mention the fact that I got over the class loading issues in the deployment and the SAR shows up as deployed. However during service initialization, I again get these class loading problems.

                      Another point to note is that I am upgrading my JBoss from AS6 to AS7. I have already modified my jboss-service.xml as per the recommendation.

                      • 10. Re: Unable to deploy exploded SAR with module dependencies
                        Thorben Janssen Newbie

                        Hi Prashanto,

                         

                        could you please provide the log with the actual exception and a describtion of what you changed to fix the class loading issue.

                         

                        Regards,

                        Thorben

                        • 11. Re: Unable to deploy exploded SAR with module dependencies
                          Prashanto Chatterjee Newbie

                          Hi Thorben,

                          What I meant by fixing classloading issue is that earlier the SAR would not deploy citing classloading error. I was ablt to fix that by specifying dependencies and providing the jboss seployment descriptor. After that it shows that the SAR is properly deployed. However it gives following exception when trying to start the service:

                          10:27:48,224 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "AAATMProp.sar"

                          10:27:48,391 ERROR [stderr] (MSC service thread 1-2) java.lang.ClassNotFoundException: com/avaya/mgmt/trust/data/TMClientInventory_Header

                          10:27:48,392 ERROR [stderr] (MSC service thread 1-2) Continuing ...

                          10:27:48,394 ERROR [stderr] (MSC service thread 1-2) java.lang.NoSuchMethodException: <unbound>=XMLDecoder.new();

                          10:27:48,394 ERROR [stderr] (MSC service thread 1-2) Continuing ...

                          10:27:48,395 ERROR [stderr] (MSC service thread 1-2) java.lang.IllegalStateException: The outer element does not return value

                          10:27:48,395 ERROR [stderr] (MSC service thread 1-2) Continuing ...

                          10:27:48,396 ERROR [stderr] (MSC service thread 1-2) java.lang.IllegalStateException: The outer element does not return value

                          10:27:48,396 ERROR [stderr] (MSC service thread 1-2) Continuing ...

                           

                          The class it is complaining about is already provided via the dependency.

                           

                          Regards,

                          Prashanto