从JBoss 4.2.3迁移到5.1 - application.xml中列出的模块不是公认的部署

时间:2011-03-03 17:25:17

标签: deployment jboss war ear

我有一个耳朵,目前在JBoss 4.2.3中部署时工作正常。我正在尝试迁移到JBoss 5.0.1但是得到错误'application.xml中列出的类路径模块不是公认的部署'。

以下是我耳朵的结构:

              MyApp
                |       
                +- classpath
                |       
                +- lib
                |   |
                |   +- A.jar
                |   +- B.jar
                |   +- C.jar
                |
                +- META-INF 
                |   |
                |   +- application.xml
                |   +- jboss-app.xml
                |
                +- D.jar
                |
                *- E.jar
                |
                +- F.jar
                |
                +- myApp.war
                    |
                    +- WEB-INF
                    |
                    +- ....

以下是我在application.xml中的内容:

<application>
  <display-name>MyApp</display-name>
  <module>
    <java>classpath</java>
  </module>
  <module>
    <java>lib/A.jar</java>
  </module>
  <module>
    <java>lib/B.jar</java>
  </module>
  <module>
    <java>D.jar</java>
  </module>

  ...      

  <module>
    <web>
      <web-uri>myApp.war</web-uri>
      <context-root>/WEB-INF</context-root>
    </web>
  </module>
</application>

如上所述,我的耳朵的当前结构和上面列出的application.xml,在JBoss 4.2.3中都可以正常工作。但是,当我部署这是JBoss 5.1.0时,似乎不喜欢application.xml中定义的'classpath'模块。

下面是完整的堆栈跟踪:

17:02:09,767 WARN  [HDScanner] Scan failed
    org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(MyApp.ear)
        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
        at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:85)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:1004)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeploymentContext(MainDeployerImpl.java:440)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:390)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:300)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.addDeployment(MainDeployerAdapter.java:86)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:344)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.RuntimeException: Error determining structure: MyApp.ear
        at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:293)
        at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:73)
        at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:196)
        at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:221)
        at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
        ... 16 more
    Caused by: java.lang.RuntimeException: classpath module listed in application.xml is not a recognized deployment, .ear: MyApp.ear
        at org.jboss.deployment.EARStructure.determineStructure(EARStructure.java:277)
        ... 20 more

我正用这个撕掉我的头发!任何帮助将不胜感激。

由于

2 个答案:

答案 0 :(得分:1)

好消息是JBoss 5.x会自动将lib中的任何JAR添加到EAR的类路径中,因此您实际上不需要在application.xml中指定它们。

对于您的classpath目录,您必须将其重命名为classpath.jar,然后5.x应接受该目录。

答案 1 :(得分:0)

什么是

 <module>
    <java>classpath</java>
  </module>

你在application.xml中指的是什么?这看起来不像是有效的jar存档名称。尝试删除此条目并重新部署。