4 Replies Latest reply on Dec 14, 2012 1:33 AM by nickarls

    How to serve JSP files defined outside a deployed WAR/EAR in JBoss AS7 ?

    ngermain

      Hi

       

      I'm currently porting our EAR application from JBoss 5.1 to JBoss 7.1.1.

      I'm wondering if there is a capacity to defined in JBoss AS7 some extended document root in a deployed webapp that may allow this webapp to get their JSP pages from an external directory, this pages would thant be generated by a a tierce application outside the container. We want to deploy our webapp with a minimal number of JSP files and other JSP' pages are dynamic forms that will be generated after deployement in an outside directory.

       

      In other words, we would like to emulate in JBoss 7.1.1 a Websphere WAS7 specific behaviour as described below :

       

      extendedDocumentRoot: Enables you to configure an application with one or more directory paths from which you can serve static files and Java ServerPages (JSP) files. You can use this attribute when an application requires access to files that exist outside of the application Web archive (WAR) directory. For example, if several applications require access to a set of common files, you can place the common files in a directory to which you can link each application as an extended document root directory.Use this attribute in addition to the contextRoot attribute.

       

      Source : http://wpcertification.blogspot.fr/2009/09/file-serving-enabled.html

       

      Any ideas ?

       

      Thanks

        • 1. Re: How to serve JSP files defined outside a deployed WAR/EAR in JBoss AS7 ?
          nickarls

          Not that I know of, I think I've used exploded WARs are the closest you get.

          • 2. Re: How to serve JSP files defined outside a deployed WAR/EAR in JBoss AS7 ?
            ngermain

            Thanks Nicklas

             

            I have tried to explode the WAR into a full directory hierarchy embedded in the EAR.

            But when deploying the wrapping EAR to JBoss AS7 using the JBoss Console from my browser

            an exception is triggered :

             

            • 17:06:33,272 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/welcome]] (MSC service thread 1-2) Servlet /welcome has generated an exception "load()": java.net.MalformedURLException

                  at java.net.URL.<init>(URL.java:601) [rt.jar:1.6.0_23]

                    at java.net.URL.<init>(URL.java:464) [rt.jar:1.6.0_23]

                    at java.net.URL.<init>(URL.java:413) [rt.jar:1.6.0_23]

                    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:959)

                    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:143)

                    at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:802)

                    at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:768)

                    at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)

                    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1196)

                    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:555)

                    at org.apache.commons.digester.Digester.parse(Digester.java:1591) [commons-digester-1.6.jar:"1.6"]

                    at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1433) [struts-1.1.jar:1.1]

                    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466) [struts-1.1.jar:1.1]

                    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]

                    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_23]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_23]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23]

             

            Is there a way to embed the exploded WAR in the EAR ?

            • 3. Re: How to serve JSP files defined outside a deployed WAR/EAR in JBoss AS7 ?
              ngermain

              Ok i've successfully deployed my exploded WAR within an exploded EAR.

               

              I've unzipped my compressed EAR in subdirectory (the .ear suffix was required)

               

                    <jboss711>\standalone\deployment\my-ear.ear

               

              and then I've defined an empty file named :

               

                    <jboss711>\standalone\deployment\my-ear.ear.dodeploy

               

              My WAR was also exploded in this subdirectory.

               

              And note, that I've to increase the deployement timeout in the standalone.xml configuration :

               

                      <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">

                          <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="1200"/>

                      </subsystem>

              1 of 1 people found this helpful
              • 4. Re: How to serve JSP files defined outside a deployed WAR/EAR in JBoss AS7 ?
                nickarls

                Ah, yes, forgot to mention that mixing exploded/unexploded deployment archives are... nontrivial to get working