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?
Yes, you understand the question correctly.
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.
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
by any change did you figure out the solution for adding a context element to the server.xml for jbosweb 6 ?
I have not been able to get it. I'm waiting for the solution.
I hope Jaikiran give us the solution.
Thanks you all
Did anybody configured the virtual directory mapping on jboss 6?
We did solve this problem ..
here are the two links which helped us
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
Hope that helps ..
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
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 ..
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
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
<Manager pathname="" />
<!-- Install an InstanceListener to handle the establishment of the run-as
role for servlet init/destroy events.
<!-- Install an InstanceListener to handle the establishment of the naming
- 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.
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.