1 2 Previous Next 15 Replies Latest reply: Feb 10, 2012 3:32 PM by Frank Langelage RSS

ear deployment problems, migration from 6.1 to 7.1

Frank Langelage Master

I'm trying to deploy my ear-application running on JBoss AS 6.1 to JBoss AS 7.1.0-SNAPSHOT, build from sources as of today.

 

The .ear file has this content:

META-INF/

META-INF/MANIFEST.MF

META-INF/application.xml

META-INF/jboss-scanning.xml

META-INF/jboss.xml

META-INF/persistence.xml

web.war

ejb-entity.jar

ejb-message-core.jar

ejb-message-sales.jar

ejb-session-common.jar

ejb-session-core.jar

ejb-session-costing.jar

ejb-session-distribution.jar

ejb-session-inventory.jar

ejb-session-param.jar

ejb-session-planning.jar

ejb-session-production.jar

ejb-session-purchase.jar

ejb-session-sales.jar

ws-common.war

ws-core.war

ws-costing.war

ws-distribution.war

ws-inventory.war

ws-planning.war

ws-production.war

ws-purchase.war

ws-sales.war

lib/

lib/bltypes.jar

lib/common.jar

lib/commons-math.jar

lib/controller-ci.jar

lib/drools-compiler.jar

lib/drools-core.jar

lib/drools-decisiontables.jar

lib/filesystem-ci.jar

lib/flattree-0.5.jar

lib/furnplan.jar

lib/htmlparser.jar

lib/imos-net.jar

lib/interfaces.jar

lib/javatuples.jar

lib/jxl.jar

lib/knowledge-api.jar

lib/opencsv.jar

lib/twt-design.jar

lib/twt-insight.jar

lib/wsclient.jar

lib/wstypes.jar

 

The aplication.xml file is attached.

 

The deployment starts and fails then with such messages (see also attached server.log):

01:08:22,165 INFO  [org.jboss.as.controller] JBAS014774: Service status report

JBAS014775:    New missing/unsatisfied dependencies:

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-message-core.jar".component.MessageDistributor.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-message-sales.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-message-sales.jar".component.SalesOrderImportMDB.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ws-common.war".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.Bom.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.ChoiceFacade.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.Configuration.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.CurrencyUpdater.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.FactoryCalendar.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

      service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-core.jar".component.FeatureOptionsBuilder.START (missing) dependents: [service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-costing.jar".INSTALL]

 

I absolutely have no clue what's missing for succesful deployment. The migration information and everything else I found where not helpful to get a solution for this issue.

I dont's understand those (missing) dependencies.

E.g. MessageDistributor does not reference anything from message-sales, like class SalesOrderImportMDB.

  • 1. Re: ear deployment problems, migration from 6.1 to 7.1
    Stephen Coy Master

    I don't think it's normal for the persistence.xml file to be accessible from the META-INF directory of the EAR.

     

    The deployment can't find the referenced persistence unit.

     

    Likewise, I'd be surprised if the jboss.xml file is doing anything useful either. It's been renamed to jboss-ejb3.xml in AS7 and will normally only be found in an ejb-jar.

  • 2. Re: ear deployment problems, migration from 6.1 to 7.1
    Scott Marlow Master

    Looks like the persistence.xml was read (server.log contains "Read persistence.xml for maj2e-lafr-dev"), however, jboss.jdbc-driver.ifxjdbc_all_jar seems to have a problem (look for keyword "missing" in server.log).  Which version of JDBC jboss.jdbc-driver.ifxjdbc_all_jar implement?  Read this link about using JDBC version 4 drivers (includes tips for using older drivers also) on JBoss AS 7.

     

    I agree with Stephen about the jboss.xml.

     

    Scott

  • 3. Re: ear deployment problems, migration from 6.1 to 7.1
    Frank Langelage Master

    The jdbc-dirvers for  Oracle IBM Informix and MS SQLServer are only copied to the deployments dir, no modules defined for them.

     

    They get deployed just fine, but after the processing of the datasource definition in standalone-full.xml.

    This is from a startup of an "empty" JBossAS 7.1 with only the jdbc-drivers in the deployments dir.

     

    As soon as the Oracle jdbc driver is deplyoed, the datasouce is bound.

    The messages are a bit irritating for me (service( ... no longer required)).

     

    Indeed the Informix jdbc was not deployable, not JDBC4 compliant. I already found the page you mentioned and followed this recipe to make it deployable.

    But with the JDBC4 compliant driver from Oracle it's the same, the same messages.

     

    JBAS014775:New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.ojdbc6_jar (missing) dependents: [service jboss.data-source.java:/maj2e-lafr-dev]

     

    12:33:26,135 ERROR [org.jboss.as] JBAS015875: JBoss AS 7.1.0.Final-SNAPSHOT "Flux Capacitor" started (with errors) in 15394ms - Started 167 of 199 services (2 services failed or missing dependencies, 29 services are passive or on-demand)

    12:33:26,176 INFO  [org.jboss.as.server.deployment] JBAS015876: Starting deployment of "sqljdbc4.jar"

    12:33:26,184 INFO  [org.jboss.as.server.deployment] JBAS015876: Starting deployment of "ojdbc6.jar"

    12:33:26,186 INFO  [org.jboss.as.server.deployment] JBAS015876: Starting deployment of "ifxjdbc_all.jar"

    17.184: [GC [PSYoungGen: 532120K->15801K(612864K)] 532120K->15801K(2013696K), 0.1564848 secs] [Times: user=0.26 sys=0.03, real=0.16 secs]

    12:33:28,054 INFO  [org.jboss.as.connector.deployers.jdbc] JBAS010403: Deploying JDBC-compliant driver class com.informix.jdbc.IfxDriver (version 3.70)

    12:33:28,066 INFO  [org.jboss.as.connector.deployers.jdbc] JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

    12:33:28,351 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010400: Bound data source [java:/maj2e-lafr-dev]

    12:33:28,427 INFO  [org.jboss.as.connector.deployers.jdbc] JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)

    12:33:28,601 INFO  [org.jboss.as.server] JBAS018559: Deployed "sqljdbc4.jar"

    12:33:28,603 INFO  [org.jboss.as.server] JBAS018559: Deployed "ojdbc6.jar"

    12:33:28,604 INFO  [org.jboss.as.server] JBAS018559: Deployed "ifxjdbc_all.jar"

    12:33:28,606 INFO  [org.jboss.as.controller] JBAS014774: Service status report

    JBAS014776:Newly corrected services:
      service jboss.jdbc-driver.ojdbc6_jar (no longer required)

     

    The jboss.xml file contains dependencies of MDBs on message queues.

    But also without this file the ear deployments fails the same way as before.

     

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

    <jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_1.xsd" version="5.1">

            <enterprise-beans>

                    <message-driven>

                            <ejb-name>SalesOrderImportMDB</ejb-name>

                            <depends>org.hornetq:module=JMS,name="@MBI_DBNAME@/SalesOrderImportQueue",type=Queue</depends>

                    </message-driven>

                    <message-driven>

                            <ejb-name>MessageDistributor</ejb-name>

                            <depends>org.hornetq:module=JMS,name="@MBI_DBNAME@/MessageDistributorQueue",type=Queue</depends>

                    </message-driven>

            </enterprise-beans>

    </jboss>

  • 4. Re: ear deployment problems, migration from 6.1 to 7.1
    Frank Langelage Master

    I had persistence.xml in META-INF of ejb-entity.jar.

     

    But with this I get an error, saying that the deployment unit "null" could not be found:

    13:20:42,742 ERROR [org.jboss.msc.service.fail] MSC00001: Failed to start service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-common.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."maj2e-lafr-dev.ear"."ejb-session-common.jar".INSTALL: Failed to process phase INSTALL of subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]

        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class biz.mbisoftware.fn.ejb.session.common.MbiSyuebFacade for component MbiSyuebFacade has errors:

    JBAS011440: Can't find a deployment unit named null in subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:169)

        at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:162)

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:155)

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]

        ... 5 more

     

    So a session bean in a seperate unit like ejb-session.common.jar makes problems.

    This session bean like all the others uses this to get  the persistence context injected:

    @PersistenceContext
    private EntityManager entityManager;

     

    I found an article on the net with a migration guide to put the persistence.xml into the EAR's META-INF.

    While searching for this article again now I found another one at https://docs.jboss.org/author/display/AS7/Developer+Guide#DeveloperGuide-Deployment which does not allow the persistence.xml to be in the ear itself.

  • 5. Re: ear deployment problems, migration from 6.1 to 7.1
    Scott Marlow Master

    The (JPA 2.0 specification) standard locations for the persistence.xml are also listed on https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide.  You are right that the EAR root /META-INF is not listed there.

     

    Its probably a good time for you to enable TRACE logging for org.jboss.jpa + org.jboss.as.jpa, which will give more information about what is occuring (see the troubleshooting section in above doc link).  That will give a better idea of what is going wrong during the search for the persistence unit.  Post the server.log with the TRACE logging output.

  • 6. Re: ear deployment problems, migration from 6.1 to 7.1
    Stephen Coy Master

    By default, classes in one ejb-module do not have access to classes (and other resources) in other ejb-modules in the same EAR (see §EE.8.3.2 of the JEE6 spec). Historically, earlier versions of JBoss have not enforced this.

     

    You can resolve this problem by adding manifest classpath entries to your ejb-jar files, or defining deployment domains using a jboss-classloading.xml file.

  • 7. Re: ear deployment problems, migration from 6.1 to 7.1
    Frank Langelage Master

    According to the documentation at https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7 (EAR Class Loading) this is not true, JBoss by default behaves different:

    "By default this is set to false, which allows the sub-deployments to see classes belonging to other sub-deployments within the .ear.

    If the ear-subdeployments-isolated is set to false, then the classes in web.war can access classes belonging to ejb1.jar and ejb2.jar. Similarly, classes from ejb1.jar can access classes from ejb2.jar (and vice-versa)."

    My war-files are web-services calling only session beans and not other webservices.

     

    I had some classloading issues right at the beginning, because I had simple java modules in EAR root and listed in application.xml.

    I moved those simple jar files to EAR/lib and CNFE went away.

     

    I also found a hint to move the ejb-entity.jar to the lib directory. But this also did not solve the unsuccesful deployment.

    See the attached server.log file with TRACE enabled for the packages requested.

     

    Everything seems to be fine, the deployment unit is found, but all of a sudden the deployment is aborted.

  • 8. Re: ear deployment problems, migration from 6.1 to 7.1
    jaikiran pai Master

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class biz.mbisoftware.fn.ejb.session.common.MbiSyuebFacade for component MbiSyuebFacade has errors:

    JBAS011440: Can't find a deployment unit named null in subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"

        at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:169)

        at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)

        at

    I don't have the code in front of me right now, so can't say for sure. But do you have any <resource-ref> or @Resource entries in your application which might be using foo#bar kind of syntax? Or maybe even ejb-ref or ejb-local-ref or @EJB with such syntax?

  • 9. Re: ear deployment problems, migration from 6.1 to 7.1
    Frank Langelage Master

    The class MbiSyuebFacade does not use such things. See source attached.

    The complete module ejb-session-common.jar does not use such things.

     

    But others use @Resouce

    ejb/session/core/MailService.java:@Resource(mappedName = "java:/JmsXA")
    ejb/session/core/MailService.java:@Resource(mappedName = "java:/Mail")
    ejb/session/core/MailService.java:@Resource(mappedName = "java:comp/env/SalesOrderImportQueue")
    ejb/session/core/MessageSink.java:@Resource(mappedName = "java:/JmsXA")
    ejb/session/core/MessageSink.java:@Resource(mappedName = "java:comp/env/MessageDistributorQueue")
    ejb/session/planning/Reorganization.java:@Resource
    ejb/session/planning/Reorganization.java:private SessionContext sessionContext;
    ejb/session/planning/SourcingProposals.java:@Resource
    ejb/session/planning/SourcingProposals.java:private SessionContext ctx;
    ejb/session/sales/InSightSalesOrdersXmlReaderV4.java:@Resource
    ejb/session/sales/InSightSalesOrdersXmlReaderV4.java:private SessionContext sessionContext;
    ejb/session/sales/InSightSalesOrdersXmlReaderV5.java:@Resource
    ejb/session/sales/InSightSalesOrdersXmlReaderV5.java:private SessionContext sessionContext;
    ejb/session/EraserBase.java:@Resource
    ejb/session/EraserBase.java:protected SessionContext sessionContext;

     

    For the both queues used the module ejb-session-core.jar includes and ejb-jar.xml build from core-session-ejb-jar.xml (attached).

     

    All @EJB annotations are without any further properties.

    Neither ejb-ref not ejb-local-ref are used.

  • 10. Re: ear deployment problems, migration from 6.1 to 7.1
    Stephen Coy Master

    Frank Langelage wrote:

     

    The class MbiSyuebFacade does not use such things. See source attached.

    The complete module ejb-session-common.jar does not use such things.

     

    ...

    ejb/session/core/MailService.java:@Resource(mappedName = "java:comp/env/SalesOrderImportQueue")
    ...
    ejb/session/core/MessageSink.java:@Resource(mappedName = "java:comp/env/MessageDistributorQueue")


     

    These should not be mapped names. They are ENC names and should be denoted as:

     

    @Resource(name = "SalesOrderImportQueue")
    @Resource(name = "MessageDistributorQueue")

     

  • 11. Re: ear deployment problems, migration from 6.1 to 7.1
    Frank Langelage Master

    I'm not sure if this right. Changing this as you supposed gives exceptions of not finding the resource on deployment on JBoss AS 6.1.

    The version I have deploys succesfully and works on runtime on AS 6.1.

     

    Changing this as you supposed anyway does not change anything, the deployment fails the same way as before.

     

    I can't believe that nobody can explain the cause for the error message "Can't find a deployment unit named null in subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"".

  • 12. Re: ear deployment problems, migration from 6.1 to 7.1
    Stephen Coy Master

    The mappedName attribute of the @Resource annotation is explicitly non-portable.

    A product specific name that this resource should be mapped to.

    Whenever you use a JNDI ENC name, you must map that value somewhere to the real resource. On JBoss this is typically done in the jboss.xml (renamed to jboss-ejb3.xml in AS7.x) file, which must be in the META-INF directory of the associated ejb-jar file.

     

    That said, I can't really say if it has anything to do with:

    "Can't find a deployment unit named null in subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"

    but I expect that it can cause the failure of that particular subdeployment and you will have to deal with it at some point.

  • 13. Re: ear deployment problems, migration from 6.1 to 7.1
    jaikiran pai Master

    Do you have a application which you can attach to reproduce this?

  • 14. Re: ear deployment problems, migration from 6.1 to 7.1
    jaikiran pai Master

    This looks related to this https://community.jboss.org/message/715365#715365. The error message which was misleading:

     

    "Can't find a deployment unit named null in subdeployment "ejb-session-common.jar" of deployment "maj2e-lafr-dev.ear"

    has been fixed https://github.com/jbossas/jboss-as/pull/1469. Scott seems to be working on the real issue in that thread.

1 2 Previous Next