I need config my Jboss 6 Final Version for getting a virtual directory (or virtual path) from my file-system.
My jsf file need include a series of images wich are not include in war file (web.war). They are in c:\images\
I've read a Jboss Community Manual ( http://community.jboss.org/wiki/ExternalDirectories ) how get it, but, in this document not contemplate Jboss 6 and I have not been able to get.
Can anybody help me?
I've tried in server.xml :
but Jboss doesn't work.
Thanks a lot
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 ..
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 ..
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.