如何解决jboss-6.0.0.Final中的外部目录映射?
| 我的应用程序完美地在jboss-4.x上运行,但是现在我需要在jboss-6.0.0.Final上对其进行升级。 但是,如果我希望从Web应用程序外部的目录中提供静态内容,那该怎么办。 就像直到jboss-5.x一样,我将\“ Context \”元素添加到服务器\\ server.xml中的Host元素。就像=><Host name=\"localhost\" ...>
> <!-- ADD static benchmark DIRECTORY
> --> Context path=\"/benchmark\" appBase=\"\"
> docBase=\"/home/anil/benchmark\"
> debug=\"99\" reloadable=\"true\">
> /Context>
但是在C:\\jboss-6.0.0.Final\\server\\default\\deploy\\jbossweb.sar\\server.xml
jboss-6.0.0.Final中添加相同的上下文元素时,出现以下错误:->
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]
这意味着不能在此处添加context元素。
尽管我也尝试过在C:\\jboss-6.0.0.Final\\server\\default\\deploy\\jbossweb.sar\\context.xml
实现这一功能,但一切都是徒劳的。
解决方法
我通过执行以下操作来解决它:
配置JBoss以遵循符号链接
转到/server/default/deploy/jbossweb.sar/content.xml
将allowLinking = \“ true \”添加为:
创建符号链接为(我假设您在Windows上工作,symlink也将在Linux上工作。)
转到命令提示符->以管理员身份运行->
C:\\ Windows \\ system32> mklink / D C:\\ jboss-6.0.0.Final \\ server \\ default \\ deploy \\ ROOT.war \\ contents C:\\ content
,该线程帮助我在jboss eap 5.1上提供的外部目录中获取静态内容,而无需使用链接。
请注意,您仍然必须创建一个目录结构,使jboss欺骗您的内容。它不像将子元素添加到server.xml文件中的中一样容易。似乎很hack,但至少能奏效。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。