-
1. Re: Accessing Directories Outside A Web Application's Contex
alesj Oct 3, 2009 7:21 AM (in response to dobreden2)With JBoss5 this is not impossible, but you would have to write some code to achieve this.
Some pseudo code:MainDeployer main = ...; // get "MainDeployer" injected from MC // use VFS's assembled notion AssembledDirectory ear = AssembledDirectoryFactory.create("my-virtual-ear.ear"); AssembledDirectory external = ear.mkdir("huge-ext.war"); VirtualFile extPath = VFS.getRoot(urlToExternalPileOfFiles); external.addPath(extPath); // add the rest of the resources Deployment deployment = new AbstractVFSDeployment(ear); main.deploy(deployment);
You can try this and see if it works.
(there might be some VFS's URL issues ...) -
2. Re: Accessing Directories Outside A Web Application's Contex
dobreden2 Oct 4, 2009 4:57 AM (in response to dobreden2)Thanks Alesj for your reply,
I was hoping there was a simpler solution like making a directory outside the Wep app's context available via security e.g. Making the data directory accessible with an entry in the web.xml file.
Michael -
3. Re: Accessing Directories Outside A Web Application's Contex
jaikiran Oct 4, 2009 8:45 AM (in response to dobreden2)I think you want this http://www.jboss.org/community/wiki/ExternalDirectories
-
4. Re: Accessing Directories Outside A Web Application's Contex
peterj Oct 5, 2009 8:19 AM (in response to dobreden2)Another possibility it to add another deploy directory to the profile service and then place an exploded WAR directory there and put your file into that WAR.
I could be more specific, but you never said which version of JBoss AS you are using. -
5. Re: Accessing Directories Outside A Web Application's Contex
dobreden2 Oct 5, 2009 9:06 AM (in response to dobreden2)Hello Peter,
Thanks for the reply - Great book by the way (JBIA) - really enjoying reading it. I'm using JBoss AS 5.1.0 GA. I really want the resources to be separate from the EAR deployment and in 'exploded' format as the content will change frequently. I think the link provided by Jaikiran has the approach I am looking for.
Regards,
Michael -
6. Re: Accessing Directories Outside A Web Application's Contex
dobreden2 Oct 8, 2009 9:53 AM (in response to dobreden2)Hi,
I followed the instructions in the link posted by Jaikiran but the XML element "Context" is invalid within <Host name=.....>. The file I modified was /deploy/jbossweb.sar/server/xml.
I followed a link from the link provided by Jaikiran entitled "How to deploy my application in an external directory in JBoss-5" and made the following modification in the conf/bootstrap/profile.xml file:<bean name="BootstrapProfileFactory" class="org.jboss.system.server.profileservice.repository.StaticProfileFactory"> <property name="bindingsURI">${jboss.server.home.url}conf/bindingservice.beans</property> ... ... <list elementClass="java.net.URI"> <value>${jboss.server.home.url}deploy</value> <value>${jboss.server.home.url}data/ebooks</value> </list>
When I try to access data within the "data/ebooks" directory I get a "Requested resource not available" error message.
I am using jboss-5.1.0.GA installation. Any help much appreciated.
Regards,
Michael -
7. Re: Accessing Directories Outside A Web Application's Contex
jaikiran Oct 8, 2009 10:28 AM (in response to dobreden2)"dobreden2" wrote:
I followed a link from the link provided by Jaikiran entitled "How to deploy my application in an external directory in JBoss-5" and made the following modification in the conf/bootstrap/profile.xml file:<bean name="BootstrapProfileFactory" class="org.jboss.system.server.profileservice.repository.StaticProfileFactory"> <property name="bindingsURI">${jboss.server.home.url}conf/bindingservice.beans</property> ... ... <list elementClass="java.net.URI"> <value>${jboss.server.home.url}deploy</value> <value>${jboss.server.home.url}data/ebooks</value> </list>
When I try to access data within the "data/ebooks" directory I get a "Requested resource not available" error message.
I am using jboss-5.1.0.GA installation. Any help much appreciated.
Regards,
Michael
Try:<bean name="BootstrapProfileFactory" class="org.jboss.system.server.profileservice.repository.StaticProfileFactory"> <property name="bindingsURI">${jboss.server.home.url}conf/bindingservice.beans</property> ... ... <list elementClass="java.net.URI"> <value>${jboss.server.home.url}deploy</value> <value>${jboss.server.home.url}data</value> </list>
and then in ${jboss.server.home.url}data folder create a (exploded) application ebooks.war and then place the documents under that. The docs will then be available at http://localhost:8080/ebooks
By the way, are you sure you want to place it in ${jboss.server.home.url}data folder, which can sometimes end up being cleaned out. Instead why not keep the files outside JBoss directory structure.