1

我的应用程序在 jboss-4.x 上完美运行,但现在我需要在 jboss-6.0.0.Final 上升级它。

但是,如果我希望从 webapps 外部的目录中提供静态内容,该怎么办。

就像直到 jboss-5.xi 将“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.xmljboss-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]

这意味着不能在此处添加上下文元素。

虽然我也试图在 上实现这个C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\context.xml,但都是徒劳的。

4

2 回答 2

3

我通过执行以下操作来解决它:

  1. 配置 JBoss 以遵循符号链接

    转到 /server/default/deploy/jbossweb.sar/content.xml 添加 allowLinking="true" 为:

  2. 创建符号链接(我假设您在 Windows 上工作,符号链接也将与在 Linux 上一样工作。)

    转到命令提示符 -> 以管理员身份运行 -> C:\Windows\system32>mklink /DC:\jboss-6.0.0.Final\server\default\deploy\ROOT.war\contents C:\content

于 2012-08-14T14:36:56.107 回答
1

该线程帮助我在不使用链接的情况下在 jboss eap 5.1 上提供的外部目录中获取静态内容。

请注意,您仍然需要创建一个目录结构来诱使 jboss 提供您的内容。这不像在 server.xml 文件中的 <Host name="localhost"> 中添加 <Context> 子元素那么容易。这似乎是一个 hack,但至少它有效。

于 2013-08-08T20:11:26.857 回答