jboss-6.0.0.Final 中的外部目录映射?

发布于 2024-11-09 12:22:31 字数 2270 浏览 0 评论 0原文

我的应用程序在 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.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]

这意味着无法在此处添加上下文元素虽然

我也尝试在 C:\jboss-6.0.0.Final\server\default\deploy\jbossweb.sar\context.xml 实现这一点,但一切都是徒劳的。

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" reloadable="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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗忘曾经 2024-11-16 12:22:31

我通过执行以下操作解决了这个问题:

  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

i get it resolved by doing the following stuff :

  1. Configure JBoss to follow symbolic links

    Go to /server/default/deploy/jbossweb.sar/content.xml
    Add allowLinking="true" as:

  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

不醒的梦 2024-11-16 12:22:31

此线程帮助我在外部目录中获取静态内容在 jboss eap 5.1 上提供,无需使用链接。

请注意,您仍然需要创建一个目录结构来诱骗 jboss 提供您的内容。这并不像添加那么容易。的子元素在 server.xml 文件中。这看起来像是一个黑客,但至少它有效。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文