2 Replies Latest reply on Aug 26, 2014 11:35 AM by dkelkhoff

    jboss-as-7.1.1.Final using initialize-in-order causes missing/unsatisfied dependencies

    dkelkhoff

      I have an ear with 17 ejb-jars and 15 wars, and due to some runtime JDNI resource loading, I want to control the order in which the ejb-jars and wars are deployed.  I tried to do this by adding initialize-in-order to the application.xml in my ear, but when I did that I received scores of missing/unsatisfied dependencies errors.  That made me think I must have listed my <modules> out of order, so I cut things down to about the simplest case I could (2 ejb-jars and 1 war), and I'm still getting the "missing/unsatisfied dependencies" errors when trying to deploy to jboss-as-7.1.1.Final.


      Here's my cut-down application.xml:

       

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

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

        <application-name>infoplus-bundle-ear</application-name>

        <display-name>infoplus-bundle-ear</display-name>

        <initialize-in-order>true</initialize-in-order>

        <module>

          <ejb>core-api-ejb.jar</ejb>

        </module>

        <module>

          <ejb>scheduler-ejb.jar</ejb>

        </module>

        <module>

          <web>

            <web-uri>scheduler-web.war</web-uri>

            <context-root>/scheduler</context-root>

          </web>

        </module>

        <library-directory>lib</library-directory>

      </application>

       

      My cut-down ear structure is (per "jar -tf infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear"):

       

      META-INF/

      META-INF/MANIFEST.MF

      core-api-ejb.jar

      lib/

      lib/jfreechart.jar

      lib/jboss-marshalling.jar

      lib/xml-apis.jar

      lib/jasperreports-font-nimbus-sans-condensed-bold.jar

      lib/jboss-apt.jar

      lib/commons-digester.jar

      lib/axis2-kernel.jar

      lib/XmlSchema.jar

      lib/clover.jar

      lib/commons-logging.jar

      lib/axiom-impl.jar

      lib/jgroups.jar

      lib/axis2-transport-local.jar

      lib/c3p0.jar

      lib/jboss-marshalling-river.jar

      lib/velocity.jar

      lib/axiom-dom.jar

      lib/commons-beanutils.jar

      lib/axis2-adb.jar

      lib/jackson-databind.jar

      lib/wsdl4j.jar

      lib/httpcore.jar

      lib/opencsv.jar

      lib/poi-ooxml-schemas.jar

      lib/quartzdesk-api.jar

      lib/quartzdesk-agent.jar

      lib/geronimo-stax-api_1.0_spec.jar

      lib/jboss-logging.jar

      lib/commons-io.jar

      lib/jasperreports-font-source-code-pro.jar

      lib/geronimo-activation_1.1_spec.jar

      lib/geronimo-ws-metadata_2.0_spec.jar

      lib/jackson-annotations.jar

      lib/poi.jar

      lib/jaxen.jar

      lib/joda-time.jar

      lib/bcmail-jdk14.jar

      lib/infinispan-core.jar

      lib/xercesImpl.jar

      lib/bcprov-jdk14.jar

      lib/axiom-api.jar

      lib/jackson-core.jar

      lib/ant-launcher.jar

      lib/geronimo-javamail_1.4_spec.jar

      lib/dom4j.jar

      lib/httpclient.jar

      lib/commons-lang.jar

      lib/axis2-transport-http.jar

      lib/jasperreports.jar

      lib/commons-codec.jar

      lib/quartz.jar

      lib/aws-java-sdk.jar

      lib/slf4j-api.jar

      lib/woden-impl-dom.jar

      lib/castor.jar

      lib/junit.jar

      lib/ant.jar

      lib/neethi.jar

      lib/servlet-api.jar

      lib/bctsp-jdk14.jar

      lib/jcommon.jar

      lib/jboss-transaction-api_1.1_spec.jar

      lib/hamcrest-core.jar

      lib/commons-httpclient.jar

      lib/wstx-asl.jar

      lib/xmlbeans.jar

      lib/jdtcore.jar

      lib/itext.jar

      lib/javax.annotation-api.jar

      lib/DynamicJasper.jar

      lib/poi-ooxml.jar

      lib/jasperreports-font-franklin-gothic.jar

      lib/javax.servlet-api.jar

      lib/staxmapper.jar

      lib/commons-collections.jar

      lib/geronimo-jta_1.1_spec.jar

      lib/woden-api.jar

      lib/jasperreports-font-infoplus-glyphs.jar

      lib/stax-api.jar

      lib/jasperreports-font-nimbus-sans.jar

      lib/jasperreports-font-arial.jar

      lib/barbecue.jar

      lib/commons-fileupload.jar

      META-INF/maven/

      META-INF/maven/com.materialogic/

      META-INF/maven/com.materialogic/infoplus-bundle-ear/

      META-INF/maven/com.materialogic/infoplus-bundle-ear/pom.xml

      META-INF/maven/com.materialogic/infoplus-bundle-ear/pom.properties

      META-INF/application.xml

      scheduler-ejb.jar

      scheduler-web.war

       

      Here's an excerpt from my log (which shows "Starting deployment" lines in a different order than the <modules> are listed in the application.xml - not sure if that's relevant), and which shows the "missing/unavailable dependencies" message (which honestly, I'm having a really hard time reading/understanding):

       

      22:44:12,820 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "scheduler-ejb.jar"

      22:44:12,821 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "scheduler-web.war"

      22:44:12,820 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "core-api-ejb.jar"

      22:44:12,835 WARN  [org.jboss.as.ejb3.deployment.processors.SessionBeanComponentDescriptionFactory] (MSC service thread 1-1) [EJB3.1 spec, section 4.9.2] Session bean implementation class MUST be public, not abstract and not final - com.materialogic.core.sqs.GetSQSQueueEJB won't be considered as a session bean, since it doesn't meet that requirement

      22:44:12,842 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for scheduler

      22:44:13,313 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.Validatorjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListenerMissing[jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.Validatorjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener]","jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.ValidatorFactoryjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListenerMissing[jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.ValidatorFactoryjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener]","jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.ValidatorFactoryjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManagerMissing[jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.ValidatorFactoryjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager]","jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.Validatorjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManagerMissing[jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.Validatorjboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager]","jboss.deployment.unit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".WeldServicejboss.persistenceunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear/scheduler-ejb.jar#scheduler\"Missing[jboss.deployment.unit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".WeldServicejboss.persistenceunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear/scheduler-ejb.jar#scheduler\"]","jboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-web.war\".INSTALLjboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-ejb.jar\".component.InfoplusScheduledJobListener.START, jboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-ejb.jar\".component.InfoplusScheduleManager.STARTMissing[jboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-web.war\".INSTALLjboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-ejb.jar\".component.InfoplusScheduledJobListener.START, jboss.deployment.subunit.\"infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear\".\"scheduler-ejb.jar\".component.InfoplusScheduleManager.START]"]}

      22:44:13,339 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment scheduler-ejb.jar in 26ms

      22:44:13,339 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment core-api-ejb.jar in 25ms

      22:44:13,338 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment scheduler-web.war in 25ms

      22:44:13,443 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment infoplus-bundle-ear.cca-migration-20140821-1237-mini.ear in 130ms

       

      If I remove the initialize-in-order, then the ear deploys successfully (both for my full ear (with 32 modules, and for my trimmed down one with just 3 modules). 

       

      And a quick explanation of my application structure here: core-api-ejb.jar contains my base library classes/interfaces, some of which are used and implemented by scheduler-ejb.jar (hence scheduler-ejb.jar depends on core-api-ejb.jar, so I want core-api-ejb.jar deployed first), then the scheduler-web.war references ejbs from scheduler-ejb.jar (hence scheduler-web.war depends on scheduler-ejb.jar, so I want scheduler-ejb.jar deployed second, and scheduler-web.war deployed last).  So, I'm fairly confident that I have the <modules> listed in the right order, but, at this point, I don't know what I'm doing wrong, so, any help would be greatly appreciated!

       

      Thanks.

        • 1. Re: jboss-as-7.1.1.Final using initialize-in-order causes missing/unsatisfied dependencies
          wdfink

          First I would check what the problem with the com.materialogic.core.sqs.GetSQSQueueEJB is about.

          Then you might move the core-api-ejb.jar to the lib folder as it seems that this contains only the interfaces.

          Also you should not pack libraries which are provided by the Server in you application, i.e. jboss_transaction* jboss-logging.jar, also why you pack infinispan?

          • 2. Re: Re: jboss-as-7.1.1.Final using initialize-in-order causes missing/unsatisfied dependencies
            dkelkhoff

            Thanks for the feedback.

             

            The problem with GetSQSQueueEJB was that it was package-private -- not public.  I've changed it to public, and the "Session bean implementation class MUST be public, not abstract and not final" error is gone, bur otherwise, everything else remains the same.

             

            I didn't mention it, but core-api-ejb.jar does contain some EJB's, so it's my understanding that it must be included in the ear as an ejb jar, listed as a <module>, and not simply be placed as a jar in the lib folder.

             

            I've also removed jboss-* and infinispan-core.jar from my ear, and I still receive the same error.  I do have a more readable block of error output this time though, although I'm still struggling to read and understand it:

            JBAS014775:    New missing/unsatisfied dependencies:

                  service jboss.deployment.subunit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear"."scheduler-ejb.jar".component.InfoplusScheduleManager.START (missing) dependents: [service jboss.deployment.subunit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear"."scheduler-web.war".INSTALL]

                  service jboss.deployment.subunit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear"."scheduler-ejb.jar".component.InfoplusScheduledJobListener.START (missing) dependents: [service jboss.deployment.subunit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear"."scheduler-web.war".INSTALL]

                  service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager (missing) dependents: [service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.ValidatorFactory, service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduleManager.Validator]

                  service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener (missing) dependents: [service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.ValidatorFactory, service jboss.naming.context.java.comp.infoplus-bundle-ear.scheduler-ejb.InfoplusScheduledJobListener.Validator]

                  service jboss.persistenceunit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear/scheduler-ejb.jar#scheduler" (missing) dependents: [service jboss.deployment.unit."infoplus-bundle-ear.cca-migration-20140821-1237-mini-smaller.ear".WeldService]

             

            Thanks again for anything else you can provide.