My application is running on jboss-4.x perfectly, but now i need to upgrade it on jboss-6.0.0.Final.
But mean while what to do If i wish to serve static content from a directory external to webapps.
Just like till jboss-5.x i was adding "Context" element to the Host element in the server's "server.xml. Just as =>
<Host name="localhost" ...>
> <!-- ADD static benchmark DIRECTORY
> --> Context path="/benchmark" appBase=""
> docBase="/home/anil/benchmark"
> debug="99" re开发者_如何学Cloadable="true">
> /Context>
But while adding the same context element in C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\server.xml
jboss-6.0.0.Final, i am getting the following 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 can't be added here.
Though i also tried to implement this one at C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\context.xml
, but all in vain.
i get it resolved by doing the following stuff :
Configure JBoss to follow symbolic links
Go to /server/default/deploy/jbossweb.sar/content.xml Add allowLinking="true" as:
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
this thread helped me get static content in an external directory served up on jboss eap 5.1 without the use of links.
note that you still have to create a directory structure that tricks jboss into serving up your content. it's not as easy as adding a <Context> child element to the <Host name="localhost"> in the server.xml file. it seems like a hack but at least it works.
精彩评论