-
1. JBoss 6 Virtual Directory-Virtual Path
jaikiran Jan 27, 2011 8:56 AM (in response to javigs82)If I understand the question correctly, you want to deploy web.war in the JBOSS_HOME/server/<servername>/deploy/ folder and at the same time server some static content for this application from C:/images folder?
-
2. JBoss 6 Virtual Directory-Virtual Path
javigs82 Jan 27, 2011 9:37 AM (in response to jaikiran)Yes, you understand the question correctly.
Thanks
-
-
4. JBoss 6 Virtual Directory-Virtual Path
jaikiran Feb 2, 2011 2:54 AM (in response to javigs82)Actually, I understood your question. I'm just trying to recollect how this can be done in AS5 or AS6. i.e. the static data of a .war being deployed out of it and being accessible with the same web app context.
-
5. JBoss 6 Virtual Directory-Virtual Path
javigs82 Feb 24, 2011 1:33 PM (in response to jaikiran)Hi,
In other projects with others servers i could add a file system dir into the web application contexts settings a different XML file like server.xml
Jaikiran, Is it impossible?
I have not been able to get.
Please help me
-
6. Re: JBoss 6 Virtual Directory-Virtual Path
imranpariyani Mar 15, 2011 5:35 AM (in response to javigs82)hi javier,
by any change did you figure out the solution for adding a context element to the server.xml for jbosweb 6 ?
-
7. JBoss 6 Virtual Directory-Virtual Path
javigs82 Mar 4, 2011 2:20 AM (in response to imranpariyani)hi Imran,
I have not been able to get it. I'm waiting for the solution.
I hope Jaikiran give us the solution.
Thanks you all
-
8. JBoss 6 Virtual Directory-Virtual Path
gusfigueiredo Mar 14, 2011 2:48 PM (in response to javigs82)Hi guys,
Did anybody configured the virtual directory mapping on jboss 6?
-
9. JBoss 6 Virtual Directory-Virtual Path
imranpariyani Mar 15, 2011 5:33 AM (in response to gusfigueiredo)We did solve this problem ..
here are the two links which helped us
http://docs.jboss.org/jbossweb/3.0.x/config/resources.html
https://issues.jboss.org/browse/JBAS-2290
In brief
In our main web app we added a context file in WEB-INF with the following
<Resources allowLinking="true" className="PATH.TO.SourceResolverContext"/>
And build and include a jar file with that class which extends FileDirContext
and then within your web app u can get the file with
request.getServletContext().getResourceAsStream(uri)
Hope that helps ..
Regards
Imran
-
10. JBoss 6 Virtual Directory-Virtual Path
javigs82 Mar 15, 2011 11:30 AM (in response to imranpariyani)I think you are working with Jboss Web Server, but I am woriking with Jboss AS 6.
Also, I need declare:
<img src="/images/image1.jpg" />
where /images must be mapping from a filesystem like (c:/images), out of the Web Context
-
11. JBoss 6 Virtual Directory-Virtual Path
imranpariyani Mar 15, 2011 12:33 PM (in response to javigs82)Jboss Web Server is a part of Jboss application server .. before jboss AS 6 they were using tomcat .. and from jboss 6 onwards they have switched to jboss web server which is again based on tomcat ...
For our application we using the application server as we are using EJB's ..
Go through those links .. all you have to do is override the default FileDirContext .. and in the web-inf add a resource which points to that class ..
One thing i forgot to mention .. the jar file which u create with that resourceresolvercontext has to be placed inside the jbossweb.sar in order to access it within your webapplication..
And for your case u could just have a servlet in front which filters all the requests .. tries to fetch them form the resource if not availble dispatches it further ..
-
12. JBoss 6 Virtual Directory-Virtual Path
charly.hurtado Mar 23, 2011 8:26 PM (in response to javigs82)somebody know why they changed about Virtual Directory.
For example on jboss-4.0.5 this is posible with a simple lines on serverl.xml
but know on jboss 6 this is not posible.. mean i cant do it. yet
-
13. Re: JBoss 6 Virtual Directory-Virtual Path
khichar.anil May 25, 2011 10:15 AM (in response to jaikiran)I am deadly waiting for your answer.
- When i am trying to add the context into C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\server.xml, it's blurting with the error :-->
DEPLOYMENTS IN ERROR:
Deployment "WebServer" is in error due to the following reason(s): **ERROR**, org.jboss.xb.binding.JBossXBRuntimeException: Context not found as a child of Host in unordered_sequence: Listener* Valve* Alias* Realm? attributes?
Deployment "jboss.web:service=WebServer" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.web:service=WebServer' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
- It means the context element is invalid at this position for the server.xml.
- I also tried one more trial with C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\context.xml as:-->
<!-- The contents of this file will be loaded for each web application -->
<Context cookies="true" crossContext="true" path="/contents" appBase="" docBase="C:/content" debug="99" reloadable="true">
<!-- Session persistence is disable by default. To enable for all web
apps set the pathname to a non-empty value:
<Manager pathname="SESSIONS.ser" />
To enable session persistence for a single web app, add a
WEB-INF/context.xml
-->
<Manager pathname="" />
<!-- Install an InstanceListener to handle the establishment of the run-as
role for servlet init/destroy events.
-->
<InstanceListener>org.jboss.web.tomcat.security.RunAsListener</InstanceListener>
<!-- Install an InstanceListener to handle the establishment of the naming
context.
-->
<InstanceListener>org.jboss.web.tomcat.service.NamingListener</InstanceListener>
</Context>
- But all in vain.
- I don't know why this is changed in jboss6. Even there is no any information regarding this functionality throughout the jboss6 documentations.
- I am totally stucked with this one. Though i don't wana chage any changement in code. I needs it into some configuration file within jboss only.
-
14. Re: JBoss 6 Virtual Directory-Virtual Path
khichar.anil Jan 9, 2012 3:26 AM (in response to khichar.anil)Hi all , i get it rsolved by doing the following stuff :
- Configure JBoss to follow symbolic links
- Go to <JBOSS_HOME>/server/default/deploy/jbossweb.sar/content.xml
- Add allowLinking="true" as:
- <Context cookies="true" crossContext="true" allowLinking="true">
2. Create symbolic link as (i assume you are working on windows, symlink will work same as on Linux also.)
- go to command prompt -> Run as administrator ->
- C:\Windows\system32>mklink /D C:\jboss-6.0.0.Final\server\default\deploy\ROOT.war\contents C:\content
Please leave the respose if it helps anybody else also.