7 Replies Latest reply on Sep 21, 2005 3:49 PM by chwang

    2 wars can put into a ear file and deploy.

      Hi folks,

      Right now I put 2 war files into a ear. these 2 wars files have their own jboss-web.xml file, but the content is the same, and under their own WEB-INF folder.

      But after I started Jboss, I got this error
      ----------------------------------------------------------
      17:50:00,976 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load test.myapplcaion.runfilter. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

      -------------------

      Which means, only can start on web applcaion.

      Could you tell me waht is wrong?
      Thank you!

      Chwang



        • 1. Re: 2 wars can put into a ear file and deploy.

          I wonder if 2 web applicaions confilct on one port 8080.

          • 2. Re: 2 wars can put into a ear file and deploy.
            ant

            You can package as many war files into an ear file as you want. Put for each war file a separate section

            <module>
             <web>
             <web-uri>frontend_1.war</web-uri>
             <context-root>/root_1</context-root>
             </web>
            </module>
            

            into your META-INF/application.xml file.
            I tested this succussfully.


            • 3. Re: 2 wars can put into a ear file and deploy.

              Ant,
              Thank you for your reply.
              I did,

              But I still got the error after I started Jboss
              ----------------------------------------------------------
              17:50:00,976 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load test.myapplcaion.runfilter. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

              -------------------

              the interesting is after I changed UseJBossWebLoader attribuate from false (default) to true in Jboss-service.xml in server\default\deploy\jbossweb-tomcat55.sar\META-INF, then started Jboss again. this error is gone, looks perfect. But only one war is loaded. What is worng?

              <!-- A flag indicating if the JBoss Loader should be used. This loader
              uses a unified class loader as the class loader rather than the tomcat
              specific class loader.
              The default is false to ensure that wars have isolated class loading
              for duplicate jars and jsp files.
              -->
              true


              Thank you!

              Chwang

              • 4. Re: 2 wars can put into a ear file and deploy.
                lafr

                What do you mean by saying "but the content is the same" ?
                Are is this identical war files ? Why do you put them together in one ear ?
                To support two nearly identical wep-apps at the same time in one jboss instance you'll have to use a separate classloader for each.
                This can be done by using this as you jboss-web.xml:

                <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
                <jboss-web>
                 <class-loading java2ClassLoadingCompliance='false'>
                 <loader-repository>
                 domain.biz:loader=@WEB_APP_NAME@.war
                 <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                 </loader-repository>
                 </class-loading>
                </jboss-web>
                



                • 5. Re: 2 wars can put into a ear file and deploy.

                  lafr,

                  Thank you. they are 2 different web applicaions. I changed the jboss-web.xml according to your suggestion. one of them is like the following. But I got 2 warns: ignore the set up. And the error is still there.

                  chwang

                  ---
                  <jboss-web>
                  <class-loading java2ClassLoadingCompliance='false'>
                  <loader-repository>
                  domain.biz:loader=pds.war
                  <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                  </loader-repository>
                  </class-loading>

                  <!-- Deploy this war to premierdata -->
                  <context-root>/</context-root>
                  <virtual-host>pdsstudio</virtual-host>
                  <virtual-directory virtual-path="/arcimsoutputs" real-path="/O:/" />
                  <virtual-directory virtual-path="/outputs" real-path="/D:/outputs" />

                  </jboss-web>


                  --------------------------------------------------------------
                  17:08:53,145 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=pds.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
                  17:08:55,498 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=reportwriter.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)

                  • 6. Re: 2 wars can put into a ear file and deploy.

                    lafr,

                    Thank you. they are 2 different web applicaions. I changed the jboss-web.xml according to your suggestion. one of them is like the following. But I got 2 warns: ignore the set up. And the error is still there.

                    chwang

                    ---
                    <jboss-web>
                    <class-loading java2ClassLoadingCompliance='false'>
                    <loader-repository>
                    domain.biz:loader=pds.war
                    <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                    </loader-repository>
                    </class-loading>

                    <context-root>/</context-root>
                    <virtual-host>pds</virtual-host>
                    <virtual-directory virtual-path="/arcimsoutputs" real-path="/O:/" />
                    <virtual-directory virtual-path="/outputs" real-path="/D:/outputs" />

                    </jboss-web>


                    --------------------------------------------------------------
                    17:08:53,145 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=pds.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
                    17:08:55,498 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=reportwriter.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)

                    • 7. Re: 2 wars can put into a ear file and deploy.

                      Hi,

                      I have figured out.
                      both application can't have the same <context-root>.

                      Thank you!

                      chwang