4 Replies Latest reply on Jun 4, 2010 1:52 PM by ranjix

    problems with an EAR file with MDBs

    ranjix Newbie

      Hey guys, maybe you know what's going on...

       

      I'm trying to port some J2EE apps (EARs) from weblogic to jboss. These apps are depending on each other, in the sense that all need a specific one to start first. In short, EAC.ear needs to start first, then the rest - JMS, EDESK and PUBLISH. For this I use the "deploy.last" as a parent for the EARs which depend on EAC. From the above EAR apps, only PUBLISH contains ejbs (an MDB), the rest contain just wars.

       

      Also, I want all these to start from folders in a certain directory, instead of the "deployed" folder from JBoss home folder. For this I modified the profile.xml from JBoss, to include the respective folders.

       

      With these settings, I ran into a strange (for me) issue. In short, if I leave in profile.xml only the EAC, JMS and EDESK apps, they start fine. If I add PUBLISH, no error happens, but none of the JMS, EDESK and PUBLISH start.

       

      so.

       

      Case 1 - If I have in  profile.xml just eac, jms and edesk

       

                   <value>${jboss.server.home.url}deploy</value>

      <value>file:///C:/10.DEV.NEW.3/modules/eac/appserver/jboss</value>

      <value>file:///C:/10.DEV.NEW.3/modules/jms/appserver/jboss</value>

      <value>file:///C:/10.DEV.NEW.3/modules/edesk/appserver/jboss</value>

      <!--value>file:///C:/10.DEV.NEW.3/modules/publish/appserver/jboss</value-->

       

      Then the output  of JBoss is fine

       

      17:36:09,476 INFO   [TomcatDeployment] deploy, ctxPath=/eac

      17:36:11,136 INFO  [STDOUT]  Initializing application.  (C:\10.DEV.NEW.3\modules\eac\config\eac.appconfig.dna)

      17:36:14,757 INFO  [STDOUT] Checking  initialization state for database 'eac'  (jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_EAC)...

      17:36:15,669 INFO  [STDOUT] URL  optimisation mode set to: none

      17:36:15,678 INFO   [STDOUT]

           **************************************************************************

          Escalate Environment and Access  Control successfully started

           **************************************************************************

      17:36:15,756 INFO   [TomcatDeployment] deploy, ctxPath=/jms

      17:36:16,344 INFO  [STDOUT]  Initializing application.  (C:\10.DEV.NEW.3\modules\jms\config\jms.appconfig.dna)

      17:36:19,541 INFO   [STDOUT]

           **************************************************************************

          Escalate JMS Server successfully  started

           **************************************************************************

      17:36:19,628 INFO   [TomcatDeployment] deploy, ctxPath=/edesk

      17:36:20,497 INFO  [STDOUT]  Initializing application.  (C:\10.DEV.NEW.3\modules\core\config\pdc.server.appconfig.dna)

      17:36:20,695 ERROR [STDERR]  Environment variable 'BMS_JMS_SERVER_NAME' missing for DNAList name  'server'

      17:36:26,335 INFO  [STDOUT] Could  not find the 'startup' callback class 'com.bluemartini.dev.net.DevServer'.   Ignoring.

      17:36:26,427 INFO  [STDOUT] Checking  initialization state for database 'main'  (jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_MAIN)...

      17:36:26,929 INFO  [STDOUT] Checking  initialization state for database 'store'  (jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_STORE)...

      17:36:27,865 INFO  [STDOUT] URL  optimisation mode set to: none

      17:36:27,893 INFO  [STDOUT]  Initializing rules engine...

      17:36:27,935 INFO  [STDOUT] Rules  engine successfully initialized...

      17:36:28,055 INFO  [STDOUT]  SearchIndexLoader.init()

      17:36:28,113 INFO  [STDOUT] BM JMS:   Creating Topic Connection to JMS Server  jnp://DB-SPOP:1099

      17:36:28,769 INFO  [STDOUT] BM JMS:   Creating Queue Connection to JMS Server  jnp://DB-SPOP:1099

      17:36:28,858 INFO  [STDOUT] BM JMS:   Successfully connected to JMS Server  jnp://DB-SPOP:1099

      17:36:29,372 INFO   [STDOUT]

           **************************************************************************

          Escalate Enterprise Desktop  Server successfully started

           **************************************************************************

      17:36:29,597 INFO  [Http11Protocol]  Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

      17:36:29,633 INFO  [AjpProtocol]  Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009

      17:36:29,651 INFO  [Http11Protocol]  Starting Coyote HTTP/1.1 on http-127.0.0.1-8443

       

       

       

      Case 2 - if I add in  profile.xml publish (which has an  MDB)

       

                   <value>${jboss.server.home.url}deploy</value>

      <value>file:///C:/10.DEV.NEW.3/modules/eac/appserver/jboss</value>

      <value>file:///C:/10.DEV.NEW.3/modules/jms/appserver/jboss</value>

      <value>file:///C:/10.DEV.NEW.3/modules/edesk/appserver/jboss</value>

      <value>file:///C:/10.DEV.NEW.3/modules/publish/appserver/jboss</value>


       

      Then the things  get screwey

       

      17:28:04,483 INFO   [TomcatDeployment] deploy, ctxPath=/eac

      17:28:06,006 INFO  [STDOUT]  Initializing application.  (C:\10.DEV.NEW.3\modules\eac\config\eac.appconfig.dna)

      17:28:09,574 INFO  [STDOUT] Checking  initialization state for database 'eac'  (jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_EAC)...

      17:28:10,441 INFO  [STDOUT] URL  optimisation mode set to: none

      17:28:10,472 INFO   [STDOUT]

           **************************************************************************

          Escalate Environment and Access  Control successfully started

           **************************************************************************

      17:28:10,540 INFO   [TomcatDeployment] deploy, ctxPath=/jms

      17:28:10,751 INFO  [EjbDeployer]  installing bean:  ejb/publish_ejb_default.jar#PubServerDBUtilTopicMDB,uid680989819

      17:28:10,753 INFO  [EjbDeployer]    with dependencies:

      17:28:10,754 INFO  [EjbDeployer]    and supplies:

      17:28:10,755 INFO   [EjbDeployer]        jndi:null

      17:28:10,838 INFO   [TomcatDeployment] deploy, ctxPath=/publish

      17:28:11,016 INFO  [EjbModule]  Deploying PubServerDBUtilTopicMDB

      17:28:11,069 WARN  [EjbModule] EJB  configured to bypass security. Please verifyif this is intended.  Bean=PubServerDBUtilTopicMDB  Deployment=vfsfile:/C:/10.DEV.NEW.3/modules/publish/appserver/jboss/deploy.last/publish.ear/publish_ejb_default.jar/

      17:28:11,324 INFO   [TomcatDeployment] deploy, ctxPath=/edesk

      17:28:12,080 INFO  [Http11Protocol]  Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

      17:28:12,119 INFO  [AjpProtocol]  Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009

      17:28:12,140 INFO  [Http11Protocol]  Starting Coyote HTTP/1.1 on http-127.0.0.1-8443

      17:28:12,159 INFO  [ServerImpl]  JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA  date=200905221053)] Started in 1m:41s:117ms

       

       

      I have no idea what's going on, JBoss pretends nothing is wrong, but why I don't see any of the other apps starting fine (jms, edesk and publish), no errors in any log file...

       

       

      thanks for any idea,

       

      ranjix

        • 1. Re: problems with an EAR file with MDBs
          jaikiran pai Master

          null null wrote:

           


           

          I have no idea what's going on, JBoss pretends nothing is wrong, but why I don't see any of the other apps starting fine (jms, edesk and publish), no errors in any log file...

           

          It's actually deploying the other apps too. Like for this one:

           

          17:28:11,324 INFO   [TomcatDeployment] deploy, ctxPath=/edesk

           

          so edesk war is being deployed. As to why your application code is not being called, you will have to tell us what kind of code does the war have? Is it a startup servlet which prints those log messages?

          • 2. Re: problems with an EAR file with MDBs
            ranjix Newbie

            Thanks for the answer, Jaikiran.

             

            The 4 apps are very similar in the way they start (same code, different parameters), in the sense that they do contain a servlet (same servlet in each app) which should execute on startup. Indeed, the log messages are printed when the servlet finishes executing.

            What's bothering is that I don't see any exceptions anywhere (jboss logs, our own apps logs), so it looks like besides having JBoss recognize that there is a WAR which should be deployed (line with the ctxPath), nothing else happens. Also, the introduction of the MDB seems to be the trigger for the issue. For a test, I commented out in the publish.ear/META-INF/application.xml the ejb module. After restarting the server, all of the apps start correctly - see log underneath. Putting back the ejb module in the application.xml takes me back to the strange behavior, in which only EAC seems to start.

             

             

            With the ejb module commented out in application.xml, everything starts ok.


            10:24:58,008 INFO  [TomcatDeployment] deploy, ctxPath=/eac

            10:24:59,469 INFO  [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\e
            ac\config\eac.appconfig.dna)
            10:25:03,356 INFO  [STDOUT] Checking initialization state for database 'eac' (jd
            bc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_EAC)...
            10:25:04,264 INFO  [STDOUT] URL optimisation mode set to: none
            10:25:04,273 INFO  [STDOUT]
                **************************************************************************
                Escalate Environment and Access Control successfully started
                **************************************************************************
            10:25:04,351 INFO  [TomcatDeployment] deploy, ctxPath=/edesk
            10:25:05,116 INFO  [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\c
            ore\config\pdc.server.appconfig.dna)
            10:25:05,281 ERROR [STDERR] Environment variable 'BMS_JMS_SERVER_NAME' missing f
            or DNAList name 'server'
            10:25:10,662 INFO  [STDOUT] Could not find the 'startup' callback class 'com.blu
            emartini.dev.net.DevServer'.  Ignoring.
            10:25:10,744 INFO  [STDOUT] Checking initialization state for database 'main' (j
            dbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_MAIN)...
            10:25:11,196 INFO  [STDOUT] Checking initialization state for database 'store' (
            jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_STORE)...
            10:25:12,185 INFO  [STDOUT] URL optimisation mode set to: none
            10:25:12,212 INFO  [STDOUT] Initializing rules engine...
            10:25:12,251 INFO  [STDOUT] Rules engine successfully initialized...
            10:25:12,319 INFO  [STDOUT] SearchIndexLoader.init()
            10:25:12,373 INFO  [STDOUT] BM JMS:  Creating Topic Connection to JMS Server jnp
            ://DB-SPOP:1099
            10:25:13,136 INFO  [STDOUT] BM JMS:  Creating Queue Connection to JMS Server jnp
            ://DB-SPOP:1099
            10:25:13,221 INFO  [STDOUT] BM JMS:  Successfully connected to JMS Server jnp://
            DB-SPOP:1099
            10:25:13,680 INFO  [STDOUT]
                **************************************************************************
                Escalate Enterprise Desktop Server successfully started
                **************************************************************************
            10:25:13,753 INFO  [TomcatDeployment] deploy, ctxPath=/jms
            10:25:14,437 INFO  [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\j
            ms\config\jms.appconfig.dna)
            10:25:19,577 INFO  [STDOUT]
                **************************************************************************
                Escalate JMS Server successfully started
                **************************************************************************
            10:25:19,678 INFO  [TomcatDeployment] deploy, ctxPath=/publish
            10:25:20,270 INFO  [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\p
            ublish\config\publish.appconfig.dna)
            10:25:20,430 ERROR [STDERR] Environment variable 'BMS_JMS_SERVER_NAME' missing f
            or DNAList name 'server'
            10:25:24,235 INFO  [STDOUT] Could not find the 'startup' callback class 'com.blu
            emartini.dev.net.DevServer'.  Ignoring.
            10:25:24,340 INFO  [STDOUT] Checking initialization state for database 'main' (j
            dbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_MAIN)...
            10:25:24,875 INFO  [STDOUT] SearchIndexLoader.init()
            10:25:25,227 INFO  [STDOUT] BM JMS:  Creating Topic Connection to JMS Server jnp
            ://DB-SPOP:1099
            10:25:25,265 INFO  [STDOUT] BM JMS:  Creating Queue Connection to JMS Server jnp
            ://DB-SPOP:1099
            10:25:25,291 INFO  [STDOUT] BM JMS:  Successfully connected to JMS Server jnp://
            DB-SPOP:1099
            10:25:25,389 INFO  [STDOUT]
                **************************************************************************
                Escalate Publishing Server successfully started
                **************************************************************************
            10:25:25,641 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
            080
            10:25:25,677 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
            10:25:25,695 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
            443
            10:25:25,712 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=
            JBoss_5_1_0_GA date=200905221053)] Started in 1m:59s:111ms

             

             

            I also wonder how does the MDB/EJB from the publish app interfere with the earlier start of another app (let's say JMS). I could see this happening if the JBoss server starts these apps somehow in parallel, with publish starting actually before jms finishing. If this is the case, is there any way to specify that I want these apps to start sequentially?

             

             

            thanks for any suggestion/

            ranjix

            • 3. Re: problems with an EAR file with MDBs
              jaikiran pai Master

              Can you post some relevant code from the servlet? Maybe that will give a hint. And I believe, the servlet is packaged in each of these wars separately and is mapped separately (as load-on-startup) in each .war's web.xml. Is that right?

               

              P.S: Please use the formatting options available in the forum editor while posting code, logs or xml.

              • 4. Re: problems with an EAR file with MDBs
                ranjix Newbie

                thanks Jaikiran.

                I did one better, I started debugging the servlet with Eclipse. The good part is that is obvious that it does indeed execute the servlet. The bad part is that is obvious that JBoss uses same classloader for all the EARs, at least in this case (because when I don't have the MDB it doesn't), which makes the servlet (which uses some statics) to believe that the new starting "app" is already initialized.

                 

                In any case, I set the isolation of the EARs as true (ear-deployer-jboss-beans.xml, "isolated" property as true), and now it looks better, but I'm debugging a conflict between some Xerces libs in our app vs. the ones in JBoss. I'll need to play more with the isolation, the final goal is to have one classloader per EAR, which will be used by all the WAR and EJB-JARs inside.

                 

                Hmm... It looks like the following jboss-app.xml put in the publish.ear/META-INF worked -

                <jboss-app>

                      <loader-repository>
                        publish:archive=publish.ear
                        <loader-repository-config>
                          java2ParentDelegation=true
                        </loader-repository-config>
                      </loader-repository>
                </jboss-app>

                 

                Anyway, thanks. Hope my issue is fixed at this point,

                ranjix