7 Replies Latest reply on Dec 14, 2011 8:32 AM by jaikiran pai

    Deployment order for multiple war(Jboss 7)

    Li hui Newbie

      Hello !

       

      I'm going through a migration from JBoss as6 to JBoss as7

       

      My EAR contains multiple wars : one is called init_war.war and need to be deployed first,

      another is called admin.war and need to be called last.

       

      How can I configure this ?

       

      ========================

       

      application.xml

       

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

      <display-name>XXX</display-name>

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

      <module>
        <web>
         <web-uri>init_war.war</web-uri>
         <context-root>init</context-root>
        </web>
      </module>

      <module>
        <web>
         <web-uri>admin.war</web-uri>
         <context-root>admin</context-root>
        </web>
      </module>

      <library-directory>APP-INF/lib</library-directory>
      </application>

       

      jboss-app.xml

       

      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE jboss-app  PUBLIC "-//JBoss//DTD Java EE Application 5.0//EN"
        "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">

      <jboss-app>
      <module-order>strict</module-order>

       

      </jboss-app>

       

      2011/12/24 =============================================

      add Test project

        • 1. Re: Deployment order for multiple war(Jboss 7)
          jaikiran pai Master

          What error(s) are you seeing?

          • 2. Re: Deployment order for multiple war(Jboss 7)
            Li hui Newbie

            What I expect to see is: admin_war starts to be deployed only after successful deployment of init_war.

             

            This can be achieved by jboss6, however, in jboss7,init_war and admin_war start to be deployed at the same time.
            How to control the sequence of multiple war deployment in the same ear in jboss7?

            • 3. Re: Deployment order for multiple war(Jboss 7)
              jaikiran pai Master

              You'll have to tell more about what the problem is if it tries to deploy at the same time. What errors do you run into? What kind of dependencies do those 2 wars have in terms of startup.

              • 4. Re: Deployment order for multiple war(Jboss 7)
                Li hui Newbie

                log:

                 

                17:32:27,487 情報    [org.jboss.modules] JBoss Modules version 1.0.2.GA
                17:32:31,174 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA
                17:32:31,612 INFO  [org.jboss.as] JBoss AS 7.0.2.Final "Arc" starting
                17:32:41,939 WARN  [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.
                17:32:42,002 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990)
                17:32:42,018 WARN  [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.
                17:32:42,033 INFO  [org.jboss.as.logging] Removing bootstrap log handlers
                17:32:42,361 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
                17:32:42,627 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.
                17:32:43,627 INFO  [org.jboss.as.naming] (Controller Boot Thread) JBAS011800: Activating Naming Subsystem
                17:32:43,861 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
                17:32:43,986 INFO  [org.jboss.as.osgi] (Controller Boot Thread) JBAS011910: Activating OSGi Subsystem
                17:32:44,346 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem
                17:32:44,674 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 3.2.0.Beta2
                17:32:45,127 INFO  [org.xnio] (MSC service thread 1-1) XNIO Version 3.0.0.Beta3
                17:32:45,299 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.0.0.Beta3
                17:32:47,095 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-4) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\eclipse\jdk1.7.0_01\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;native;.
                17:32:47,283 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem
                17:32:47,502 INFO  [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-4) Starting remote JMX connector
                17:32:48,002 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999
                17:32:48,533 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Coyote HTTP/1.1を http--127.0.0.1-8080 で起動します
                17:32:50,423 INFO  [org.jboss.as.connector] (MSC service thread 1-3) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)
                17:32:50,986 ERROR [org.jboss.remoting.remote] (XNIO NIO Read 1) JBREM00200: Remote connection failed: java.io.IOException: 確立された接続がホスト コンピュータのソウトウェアによって中止されました。
                17:32:51,080 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/ExampleDS]
                17:32:51,798 WARN  [org.jboss.as.protocol] (pool-2-thread-9) JBAS012100: Got error closing channel JBREM00206: Channel is not open
                17:32:52,689 WARN  [org.jboss.as.protocol] (pool-2-thread-4) JBAS012100: Got error closing channel JBREM00206: Channel is not open
                17:32:53,236 INFO  [org.jboss.as.deployment] (MSC service thread 1-3) Started FileSystemDeploymentService for directory C:\eclipse_new\jboss-as-7.0.2.Final\standalone\deployments
                17:32:53,283 INFO  [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Found tx_ear.ear in deployment directory. To trigger deployment create a file called tx_ear.ear.dodeploy
                17:32:53,392 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.2.Final "Arc" started in 28358ms - Started 94 of 149 services (55 services are passive or on-demand)
                17:32:53,455 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "tx_ear.ear"
                17:32:54,173 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "tx_init.war"
                17:32:54,173 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "tx_admin.war"
                17:32:55,814 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to tx_ear.ear
                17:32:55,814 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) added javax.persistence.api dependency to tx_admin.war
                17:32:55,814 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to tx_init.war
                17:32:57,345 INFO  [stdout] (MSC service thread 1-3) ===========Start===========class com.admin.AdminListener:2011-12-06 17:32:57.00345

                17:32:57,345 INFO  [stdout] (MSC service thread 1-4) =======start===============class com.init.InitListener:2011-12-06 17:32:57.00345

                17:33:03,345 INFO  [stdout] (MSC service thread 1-3) ===========end===========class com.admin.AdminListener:2011-12-06 17:33:03.00345

                17:33:03,891 INFO  [org.jboss.web] (MSC service thread 1-3) registering web context: /tx_admin
                17:33:04,345 INFO  [stdout] (MSC service thread 1-4) =======end===============class com.init.InitListener:2011-12-06 17:33:04.00345

                17:33:04,345 INFO  [org.jboss.web] (MSC service thread 1-4) registering web context: /tx_init
                17:33:04,516 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "tx_ear.ear"

                • 5. Re: Deployment order for multiple war(Jboss 7)
                  daveryan Newbie

                  Those connection errors are interesting. First, though, can you confirm that you are able to successfully deploy each .war manually, in the sequence that you intend? Whether from the Management Console or the Management CLI (which you can batch script), are you able to deploy the init.war and admin.war? This would rule out other issues, and let us focus on the sequencing solution.

                  • 6. Re: Deployment order for multiple war(Jboss 7)
                    Li hui Newbie

                    Microsoft Windows XP [Version 5.1.2600]
                    (C) Copyright 1985-2001 Microsoft Corp.

                    C:\Documents and Settings\lih.neu>cd C:\jboss-as-7.1.0.Beta1b\bin

                    C:\jboss-as-7.1.0.Beta1b\bin>standalone.bat
                    Calling "C:\jboss-as-7.1.0.Beta1b\bin\standalone.conf.bat"
                    ===============================================================================

                      JBoss Bootstrap Environment

                      JBOSS_HOME: C:\jboss-as-7.1.0.Beta1b

                      JAVA: C:\ixBuilderV1.0\jdk1.7.0_01\bin\java

                      JAVA_OPTS: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000
                    -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman
                    -server

                    ===============================================================================

                    17:36:53,002 情報    [org.jboss.modules] JBoss Modules version 1.1.0.CR4
                    17:36:53,595 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA
                    17:36:53,705 INFO  [org.jboss.as] JBoss AS 7.1.0.Beta1b "Tesla" starting
                    17:36:55,330 INFO  [org.xnio] XNIO Version 3.0.0.CR5
                    17:36:55,345 INFO  [org.jboss.as] Creating http management service using  socket-binding (management-http)
                    17:36:55,361 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.0.CR5
                    17:36:55,392 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.0.CR6
                    17:36:55,767 INFO  [org.jboss.as.clustering] JBAS010300: Activating Infinispan subsystem.
                    17:36:55,830 INFO  [org.jboss.as.security] Activating Security Subsystem
                    17:36:55,861 INFO  [org.jboss.as.osgi] JBAS011910: Activating OSGi Subsystem
                    17:36:55,908 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
                    17:36:55,970 INFO  [org.jboss.as.security] (MSC service thread 1-3) Picketbox version=4.0.6.Beta1
                    17:36:56,189 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
                    17:36:56,377 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999
                    17:36:56,377 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:4447
                    17:36:56,392 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mai
                    l/Default]
                    17:36:56,408 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deployi
                    ng JDBC-compliant driver class org.h2.Driver (version 1.3)
                    17:36:56,517 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2) The Apache Tomcat Native lib
                    rary which allows optimal performance in production environments was not found on the java.library.path: C:\ixBuilderV1.
                    0\jdk1.7.0_01\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ixBuilderV1.0\jdk1.7.0_01\bin;D:\lihui\downl
                    oad\java\apache-ant-1.8.2-bin\apache-ant-1.8.2\bin;D:\java\apache-maven-3.0.3\bin;D:\oracle\product\10.2.0\client_1;C:\W
                    INDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Tortoise
                    SVN\bin;C:\Program Files\Microsoft Visual Studio 8\VC\;C:\Program Files\EmEditor;C:\Program Files\IDM Computer Solutions
                    \UltraEdit\;C:\Program Files\OpenVPN\bin;.
                    17:36:56,611 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-1) null null
                    17:36:56,736 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Coyote HTTP/1.1を http--127.0.0.1-
                    8080 で起動します
                    17:36:57,298 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeplo
                    ymentService for directory C:\jboss-as-7.1.0.Beta1b\standalone\deployments
                    17:36:57,455 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data sourc
                    e [java:jboss/datasources/ExampleDS]
                    17:36:57,486 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.1.0.Beta1b "Tesla" started in 4984ms - Started 126
                    of 187 services (60 services are passive or on-demand)
                    17:38:56,781 INFO  [org.jboss.as.server.deployment.repository.impl] (HttpManagementService-threads - 2) JBAS014900: Cont
                    ent added at location C:\jboss-as-7.1.0.Beta1b\standalone\data\content\87\f6ec9766a52790af4ac0e06148dff7790f5fcc\content

                    17:39:02,281 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "tx_ear.ear"
                    17:39:02,422 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "tx_admin.war"
                    17:39:02,422 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "tx_init.war"
                    17:39:03,922 INFO  [stdout] (MSC service thread 1-2) ===========Start===========class com.admin.AdminListener:2011-12-14
                    17:39:03.00922
                    17:39:03,922 INFO  [stdout] (MSC service thread 1-1) =======start===============class com.init.InitListener:2011-12-14 1
                    7:39:03.00922
                    17:39:09,922 INFO  [stdout] (MSC service thread 1-2) ===========end===========class com.admin.AdminListener:2011-12-14 1
                    7:39:09.00922
                    17:39:10,109 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: /tx_admin
                    17:39:10,922 INFO  [stdout] (MSC service thread 1-1) =======end===============class com.init.InitListener:2011-12-14 17:
                    39:10.00922
                    17:39:10,937 INFO  [org.jboss.web] (MSC service thread 1-1) registering web context: /tx_init
                    17:39:10,953 INFO  [org.jboss.as.server.controller] (HttpManagementService-threads - 1) Deployed "tx_ear.ear"

                    • 7. Re: Deployment order for multiple war(Jboss 7)
                      jaikiran pai Master

                      I just got to know that this may not yet be fully implemented. You might see this in 7.1.0.CR1 or later.