9 Replies Latest reply on Sep 23, 2015 3:36 AM by rajivmani

    JBoss6.3 with JDK 1.6 Deployement Issue

    rajivmani

      Hi Everyone,

        I am Working On EJB's 2.1 Project.

        Facing Deployment issue while adding more then one EJB module and generated EAR file and Deployed in JBoss 6.3 EAP. Here I have Attached my Issue. please help me to solve this.

       

      Thanks Advance !!!

       

      13:00:44,608 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."testWar.ear"."codeMaintModule.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."testWar.ear"."codeMaintModule.jar".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment "codeMaintModule.jar" of deployment "testWar.ear"

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_29]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_29]

        at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_29]

      Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class cias.codeMaint.session.CodeMaintCtlrBean.ejb.CodeMaintCtlrEJB with ClassLoader ModuleClassLoader for Module "deployment.testWar.ear.codeMaintModule.jar:main" from Service Module Loader

        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findMethod(ClassReflectionIndexUtil.java:53) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.handleStatelessSessionBean(DeploymentDescriptorMethodProcessor.java:99)

        at org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.deploy(DeploymentDescriptorMethodProcessor.java:76)

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        ... 5 more

      Caused by: java.lang.NoClassDefFoundError: cias/system/exception/CodeMaintenanceException

        at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_29]

        at java.lang.Class.privateGetDeclaredFields(Unknown Source) [rt.jar:1.6.0_29]

        at java.lang.Class.getDeclaredFields(Unknown Source) [rt.jar:1.6.0_29]

        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        ... 9 more

      Caused by: java.lang.ClassNotFoundException: cias.system.exception.CodeMaintenanceException from [Module "deployment.testWar.ear.codeMaintModule.jar:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:447) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:414) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]

        ... 14 more

        • 1. Re: JBoss6.3 with JDK 1.6 Deployement Issue
          lylewang
          ClassNotFoundException: cias.system.exception.CodeMaintenanceException


          Is that cias.system.exception.CodeMaintenanceException class in the same codeMaintModule.jar, or another jar in same ear ? Or another ear ?


          Class Loading in AS7 - JBoss AS 7.2 - Project Documentation Editor

          • 2. Re: JBoss6.3 with JDK 1.6 Deployement Issue
            rajivmani

            Hi Lyle Wang,

            Thank u so much for your replay.

            ClassNotFoundException: cias.system.exception.CodeMaintenanceException - This is different JAVA 1.6 Helper Module.

            This java helper module, i have generated to jar and added it into EJB codeMaintModule. NO compilation issue


            Finally i have generated EAR file and Deployed into JBOSS 6.3. While Deploying am getting those exception.


            Notes:

              I could't get deployment issue for Single  EJB module, while deploying , when i add one more EJB module and Generated to EAR file and deployed into JBoss 6.3 EAP.  I am facing Deployment issue in this scenario. please help me.






            • 3. Re: JBoss6.3 with JDK 1.6 Deployement Issue
              rajivmani

              Hi Lyle Wang,

                As of My understanding , The Common helper jar in "EAP-6.3.0\jboss-eap-6.3\standalone\deployments"  Path are not Recognized at Run-time.

              Please help me, where to place my common jar files into JBoss 6.3 EAP to solve that ClassNotFoundException at Run time.  I am Eagerly waiting for your replay

               

              Thanks Advance

              • 4. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                lylewang

                Hi Rajiv:

                 

                Sorry for late reply.

                 

                In terms of common code / component shared by multiple deployments, we usually setup it as custom module in JBoss 7 / EAP 6.x

                You need to package these classes / project in a jar and put it under /module folder, then you can declare it as "global module" or use  "jboss-deployment-structure.xml" file to declare dependency.

                An example:

                How to install a module on JBoss AS 7

                 

                Thanks.

                • 5. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                  rajivmani

                  Thank you so much for Your Replay.



                  If you provide me the example. it may very helpful for me to understand more.

                  Now i have helper jar(I have Created java project and exported into jar)


                  How to add this generated helper jar under /module folder  and how can i declare that it as "global module. do i need to create any xml file ..if i need to create, how do i need to configure there my helper module. please help


                  Thanks Advance


                  • 6. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                    unnijboss

                    1. Create a folder JBOSS_HOME/modules/cias/helper/main

                    2. Create a file called module.xml under the main with the following content

                        

                         <module xmlns="urn:jboss:module:1.1" name="cias.helper">

                          <resources>

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

                           </resources>

                          <dependencies>

                                <module name="org.apache.commons.logging" />

                           </dependencies>

                         </module>

                        Add more module dependencies if want.

                     

                    3. Place your helper.jar under main folder.

                    4. And at last add a file called "jboss-deployment-structure.xml" inside your ear META-INF with the following content.

                    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

                      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                      <deployment>

                          <dependencies>

                              <module name="cias.helper" slot="main" export="true"/>

                            </dependencies>

                      </deployment>

                    </jboss-deployment-structure>

                     

                    5. In case if you want cias.helper as a global module, modify standalone.xml as

                    <subsystem xmlns="urn:jboss:domain:ee:1.2">

                                <global-modules>

                                    <module name="cias.helper" slot="main"/>

                                </global-modules>

                                <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>

                                <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>

                                <annotation-property-replacement>true</annotation-property-replacement>

                    </subsystem>

                    • 7. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                      rajivmani

                      Hi Unni,

                      Thank you so much .. Your input help me lot

                       

                      I do have few Clarification in my mind. Can You help on this.

                       

                      Q1

                            I Followed your point still 1-4 as my first option.

                      The Helper Module is issue has been resolved. after adding the Below line at point 2

                      <module xmlns="urn:jboss:module:1.1" name="cias.helper">

                            <resources>

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

                             </resources>

                            <dependencies>

                                  <module name="org.apache.commons.logging" />

                      <module name="javax.api" />

                             </dependencies>

                           </module>

                                 

                      Query : Can you please provide some more input on <dependencies> Tag and <module> Tag. I am not very clear on this, like What are all the packages we need configured in <module> tag. Why do we need to configure, What is the purpose of this.

                       

                           

                      • 8. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                        lylewang

                        That is for the dependencies your module has.

                        For example, in your module "cias.helper" you use slf4j, but your slf4j classes are not packaged in same helper.jar.

                        You installed slf4j as another module, now you setup this dependency entry to tell JBoss, my cias.helper module needs slf4j module to work.

                        So this setup really depends on what your module needs.

                         

                        Read through the chapter 3 in official document dev. guide, details are included there.

                        Chapter 3. Class Loading and Modules

                        • 9. Re: JBoss6.3 with JDK 1.6 Deployement Issue
                          rajivmani

                          Hi Lyle/Unni,

                          I am Really thankful you guys  

                          Thank you so much for your help and valid input you guys provided

                          Working fine now