5 Replies Latest reply on Aug 2, 2012 7:11 AM by sfcoy

    EJB jar dependency in jboss 7

    vairam_sm

      Hi,

       

      I have an EJB module, which works with the external depenent jar called CompressAPI.jar, this resides on Jboss 4.2.2 /server/default/lib/ directory. When i move the same module to the JBoss 7, i'm getting deployment error.

       

      Manifest file

      Manifest-Version: 1.0

      Dependencies: solverminds.compress.CompressAPI

      Class-Path: CompressAPI.jar

       

      11:04:04,230 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps

      that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"TESTJB7-ejb.jar\".STRUCTURE" => "org.jboss.msc.service.Start

      Exception in service jboss.deployment.unit.\"TESTJB7-ejb.jar\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"TESTJB7-ejb.jar\""}}}}

       

       

      The CompressAPI.jar is a common jar which is referenced by most of the modules in our appliction. So this should be in common place, lib directory in JBoss 4.2.2.

      How this could be accomplished in Jboss 7.

       

      Thanks in advance.

      Vairam

        • 1. Re: EJB jar dependency in jboss 7
          sfcoy

          Hi there,

           

          Have you read Class Loading in AS7 yet?

           

          How is your application structured?

           

          Are you using an EAR file deployment? More than one?

          • 2. Re: EJB jar dependency in jboss 7
            vairam_sm

            Ya, we are using more than one EAR file for our application. Each module has it EAR file.

            • 3. Re: EJB jar dependency in jboss 7
              sfcoy

              So, put your shared jar(s) in a module and reference it as described in the article I linked above.

              • 4. Re: EJB jar dependency in jboss 7
                vairam_sm

                Hi,

                 

                I have solved the refrence problem. But i i'm not able to run the module due datasource problem.

                 

                ejb-jar.xml

                 

                  <resource-ref>

                                <res-ref-name>jdbc/ClientDB</res-ref-name>

                                <res-type>javax.sql.DataSource</res-type>

                                <res-auth>Container</res-auth>

                            </resource-ref>

                 

                jboss.xml

                 

                <jboss>

                    <enterprise-beans>

                        <session>

                            <ejb-name>NotificationAliasMapping</ejb-name>

                            <jndi-name>NotificationAliasMapping</jndi-name>

                            <resource-ref>

                        <res-ref-name>jdbc/ClientDB</res-ref-name>

                                <res-type>javax.sql.DataSource</res-type>

                        <jndi-name>java:jboss/datasources/MSSQLDS</jndi-name>

                     </resource-ref>

                        </session>

                    </enterprise-beans>

                </jboss>

                 

                standalone.xml

                <datasource jndi-name="java:jboss/datasources/MSSQLDS" pool-name="MSSQLDS" enabled="true" use-java-context="true">

                                    <connection-url>jdbc:sqlserver://XX.XX.XX.XX:1433;DatabaseName=LRPTEST;DB_CLOSE_DELAY=-1</connection-url>

                                    <driver>sqljdbc</driver>

                                    <security>

                                        <user-name>developer</user-name>

                                        <password>tiger!@#</password>

                                    </security>

                                </datasource>

                 

                I'm getting the following exception. Kindly help me to solve this.

                 

                12:04:27,396 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named NotificationAliasMapping in deployment unit subdeployment "NotificationAlias-ejb.jar" of deployment "NotificationAliasEar.ear" are as follows:

                 

                        java:global/NotificationAliasEar/NotificationAlias-ejb/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocalHome

                        java:app/NotificationAlias-ejb/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocalHome

                        java:module/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocalHome

                        java:global/NotificationAliasEar/NotificationAlias-ejb/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocal

                        java:app/NotificationAlias-ejb/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocal

                        java:module/NotificationAliasMapping!lrp.settings.control.bean.NotificationAliasMappingLocal

                 

                12:04:27,642 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990

                12:04:27,643 ERROR [org.jboss.as] (MSC service thread 1-2) JBAS015875: JBoss AS7.1.1.Final "Brontes" started (with errors) in 25688ms - Started 202 of 291 serv

                ices (6 services failed or missing dependencies, 80 services are passive or on-demand)12:04:27,843 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015

                870: Deploy of deployment "NotificationAliasEar.ear" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jbo

                ss.naming.context.java.comp.NotificationAliasEar.NotificationAlias-ejb.NotificationAliasMapping.env.jdbc.ClientDBjboss.naming.context.java.jboss.resources.jdbc.

                ClientDBMissing[jboss.naming.context.java.comp.NotificationAliasEar.NotificationAlias-ejb.NotificationAliasMapping.env.jdbc.ClientDBjboss.naming.context.java.jboss.resources.jdbc.ClientDB]"]}

                12:04:27,873 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment NotificationAlias-ejb.jar in 28ms

                12:04:27,882 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment NotificationAlias-war.war in 37ms

                12:04:27,888 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment NotificationAliasEar.ear in 43ms

                12:04:27,891 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

                JBAS014775:    New missing/unsatisfied dependencies:      service jboss.naming.context.java.jboss.resources.jdbc.ClientDB (missing)

                dependents: [service jboss.naming.context.java.comp.NotificationAliasEar.NotificationAlias-ejb.NotificationAliasMapping.env.jdbc.ClientDB]

                 

                12:04:27,900 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps

                that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.NotificationAliasEar.NotificationAlias-ejb.NotificationAliasMapping.env.jdbc.ClientDBjboss.naming.context.java.jboss.resources.jdbc.ClientDBMissing[jboss.naming.context.java.comp.NotificationAliasEar.NotificationAlias-ejb.NotificationAliasMapping.env.jdbc.ClientDBjboss.naming.context.java.jboss.resources.jdbc.ClientDB]"]}}}

                • 5. Re: EJB jar dependency in jboss 7
                  sfcoy

                  I think you may have to migrate your jboss.xml file to jboss-ejb3.xml as described on https://docs.jboss.org/author/display/AS71/jboss-ejb3.xml+Reference.