1 Reply Latest reply on Mar 5, 2003 8:55 PM by rakhbari

    jboss-3.0.0 + tomcat-4.0.3, can't deploy exploded ear

    tero.katajainen

      I'm experiencing difficulties with the release I just downloaded. We have a application consisting of two WAR's and an ejb-jar. Previously I was able to deploy this to JBoss 2.4 as exploded directory structure and have been able to deploy it for websphere4, wl6 and orion as well.

      The directory structure is as follows:

      application (This is the EAR directory)
      |-META-INF
      |-admin (This is a WAR directory)
      | |-WEB-INF
      |
      |-public (Another WAR)
      | |-WEB-INF
      |
      |-ejb.jar
      |-META-INF

      I have tried the following with URLDirectoryScanner:

      1. Set the dir to application directory. Does not deploy the EAR or WAR's.

      2. Set url to the directory. Nothing gets deployed.

      3. Rename the application directory to application.ear. Does not find META-INF/application.xml (Probably thinks it's a jarred file, same as WL6)

      4. Rename the WAR's to public.war and admin.war. They will be deployed separately if the dir has been set to application. Unacceptable because WL6 treats everything with .war as an archive.

      ejb-jar gets deployed except in case 2 and 3. As far as I can see, the only way to get it running would be to actually create an archived .ear but as we do a lot of JSP development, this would be devastating for the development times.

      Can anyone help me with this one ? Any workarounds ? Any help would be greatly appreciated.

      I believe the problem lies in the way JBoss recognizes the ear (The .ear suffix?) is there a way to force the EARDeployer to read in a directory ?

        • 1. Re: jboss-3.0.0 + tomcat-4.0.3, can't deploy exploded ear
          rakhbari

          I also ran into the same thing. A long time 2.4.7 user trying to upgrade to the latest release of 3.x, 3.2.0RC2 to be exact.

          In development mode you MUST be able to run your entire WEB and EJB modules in exploded format, otherwise you'll spend all your time, not to mention thrashing your disk, JARing and EARing.

          What I've figured out is that the exploded subdirs under your "deploy" subdir MUST end with ".ear", ".war", and ".jar" respectively. This was NOT a limitation with 2.4.7. In 2.4.7 as long as the directory you mentioned in your application.xml existed and had the proper structure of a WAR or JAR file, it didn't care what the directory itself was called.

          But not the case with 3.2.0RC2. So, if for example, you have a dir structure like this:

          D:\JavaDev\projects\MyApp <--- HOME (of your project)

          %HOME%\deploy
          %HOME%\deploy\myapp.ear\META-INF\application.xml

          %HOME%\myapp1.war
          %HOME%\myapp1.war\WEB-INF\web.xml

          %HOME%\myapp2.war
          %HOME%\myapp2.war\WEB-INF\web.xml

          ...and your application.xml looks like this:


            <display-name>MyApp</display-name>
            My Application
            
              
                <web-uri>../../myapp1.war</web-uri>
                <context-root>/app1</context-root>
              
            
            
              
                <web-uri>../../myapp2.war</web-uri>
                  <context-root>/app2</context-root>
                
            


          ...and you've set your URLDeploymentScanner in jboss-service.xml like this:


          ...

          deploy/, file:/D:/JavaDev/projects/MyApp/deploy/

          ...


          Everything should work. I've tried it and it's worked for me so far. Now I just have to make sure the exploded EJB module (myapp.jar) works just as well.

          Hoped this helped somebody! I struggled with this for well over 2 days before I finally stumbled across the "you-have-to-name-the-subdirs-correctly" thing. I love JBoss, I just wish it was a little more documented, as well as things didn't change so drastically between every minor release. But just the same, keep up the great work guys.