2 Replies Latest reply on Apr 27, 2010 11:48 AM by Robert Heim

    JBoss AS 5.1 and Virtual Directories

    Robert Heim Newbie

      I am attempting to migration our application from JBoss 4.0.4 to 5.1.0.

       

      Right now the main problem I have is getting virtual directories working.

       

      In JBoss 4.0.4 we accomplished this by adding the following elements to the server.xml file in the Tomcat55.sar directory.

       

       

                  <!-- Default context parameters -->
                  <DefaultContext cookies="true" crossContext="true" override="true"/>
       
                  <Context override="true" crossContext="true" docBase="./virtualDirectory/reporting/output/" path="/reporting/output"/>
                  <Context override="true" crossContext="true" docBase="./virtualDirectory/app/output/" path="/app/output"/>
      
      
      

       

       

      This worked well for our application.

       

      When attempting to apply this to the server.xml file for JBoss 5.1.0/Tomcat 6.0 I get the following error in the server.log file.

       

       

      2010-04-26 10:20:55,796 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=WebServer state=Create
      org.jboss.xb.binding.JBossXBException: Failed to parse source: DefaultContext cannot appear in this position. Expected content of Host is unordered_sequence: Listener* Valve* Alias* Realm? attributes?
      
       
      

       

      I can't find any good documentation on what changes are needed moving from 4.0.4 to 5.1.0.  All the documentation I've found so far has been for JBoss 4.2 or lower or Tomcat 5.5 or lower.

       

      Any ideas on what I'm missing here?

       

      P.S.  I have also tried changing the docBase to use relative paths instead of the ones noted above but with the same results.

       

       

      <Context override="true" crossContext="true" docBase="${jboss.server.home.url}virtualDirectory/reporting/output/" path="/reporting/output"/>
      
        • 1. Re: JBoss AS 5.1 and Virtual Directories
          Robert Heim Newbie

          Ok, doing some more digging I found this article discussing External Directories which seems to be the alternative for JBoss 5.1.0.

           

          http://community.jboss.org/wiki/ExternalDirectories

           

          Problem is, when I add this to the profile.xml file, I still cannot access the generated file using a URL.

           

          <property name="bootstrapURI">${jboss.server.home.url}conf/jboss-service.xml</property>
          <property name="deployersURI">${jboss.server.home.url}deployers</property>
          <property name="applicationURIs">
               <list elementClass="java.net.URI">
               <value>${jboss.server.home.url}deploy</value>
               <!-- External Directories -->
               <value>${jboss.server.home.url}virtualDirectory/reporting/output</value>
               <value>${jboss.server.home.url}virtualDirectory/app/output</value>
          

           

          I still get a HTTP 404.  I can see the file is being created in the directory specified but I can't seem to access it via URL.

          • 2. Re: JBoss AS 5.1 and Virtual Directories
            Robert Heim Newbie

            At this point I'm wondering if the problem is the URL.

             

            Using the jmx-console, scanning through the list of JMX MBeans I can see the generated file is deployed in the directory specified so the system is picking it up.

             

            Domainjboss.deployment
            typeDeployment
            id"vfsfile:/C:/root/app/server/default/virtualDirectory/reporting/output/resunitpatsched-0001.pdf"
            Java Classorg.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext
            DescriptionManagement Bean.

             

             

            Problem is I can't seem to access it from the browser.

             

            Using the previous example, I tried using

            http://localhost:port/reporting/output/report.pdf

             

            as well as

             

            http://localhost:port/virtualDirectory/reporting/output/report.pdf.

             

            Neither of these appears to be working.

             

            Anyone have any ideas on what I'm missing here?