Migration JBossAS7中的类加载问题

Migration JBossAS7中的类加载问题,migration,classloader,jboss7.x,Migration,Classloader,Jboss7.x,提到以下从较高优先级到较低优先级的类加载首选项: 1. System Dependencies - These are dependencies that are added to the module automatically by the container, including the Java EE api's. 2. User Dependencies - These are dependencies that are added through jboss-deployment-s

提到以下从较高优先级到较低优先级的类加载首选项:

1. System Dependencies - These are dependencies that are added to the module automatically by the container, including the Java EE api's.
2. User Dependencies - These are dependencies that are added through jboss-deployment-structure.xml or through the Dependencies: manifest entry.
3. Local Resource - Class files packaged up inside the deployment itself, e.g. class files from WEB-INF/classes or WEB-INF/lib of a war.
4. Inter deployment dependencies - These are dependencies on other deployments in an ear deployment. This can include classes in an ear's lib directory, or classes defined in other ejb jars. 
但是,我不理解2和3之间的区别。什么样的依赖关系可以归入上述第2类与第3类。对我来说,它们看起来是一样的

作为将我的Spring应用程序从JBoss 4迁移到JBoss 7的一个例子,我遇到了我们的应用程序一直在使用的用于quartz 1.6 jar的NoClassDefError。quartz 1.6 jar就在我的应用程序的WEB-INF/lib文件夹中。这意味着它正确地属于上述第3类。但web上的大多数文章都指出,我必须将其作为JBoss 7模块或在JBoss-deployment-structure.xml中定义。为什么

我还阅读了指南,并按照这些指南中的说明进行了闲聊练习。但我不太明白我该怎么处理这份报告?我看到了这个问题的答案——看起来迁移需要付出相当多的努力。考虑到应用程序可以很容易地拥有众多依赖项,这似乎不是一个简单的任务。有人能确认一下吗

我想我需要一个关于

  • 我应该为哪些JAR创建module.xml?(可能的候选人)- Spring、Quartz、Apache、C3P0连接池等

  • 对于哪些JAR,我有jboss-deployment-structure.xml?(什么 可能是这里的好候选人吗?)

  • 对于哪些JAR,我应该将它们保留在web inf/lib文件夹中?(申请 使用某些专门的数学库,如colt.jar、excel 像-jxls.jar、poi.jar这样的图形库看起来不错 (此处为候选人)


  • JBossAS版本用于以不同的方式管理其库集。早些时候,4.x版用于定义核心服务器 将库导入JBOSS_主/服务器库。此后,每个服务器定义都将其特定的库保存到server//lib文件夹中

    JBossAS7采用了一种真正的模块化方法,反对所有早期的方法。服务器引导库现在位于应用服务器的根目录下。您可以在那里找到jboss-modules.jar归档文件,这是基于jboss模块引导新的应用程序服务器内核所需的全部内容

    我应该为哪些JAR创建module.xml?(可能的候选人)- Spring、Quartz、Apache、C3P0连接池等

    如果存在任何依赖JAR,则可以将其创建为模块并在module.xml中定义。您还需要定义定义库的依赖项

    
    
    连接池可以配置为一个模块以及安装新模块的过程 需要在适当的模块路径中复制.jar库并添加 module.xml文件,该文件声明模块及其依赖项

    对于哪些JAR,我有jboss-deployment-structure.xml?(你能做什么 这里有好的候选人吗?)

    所有依赖项jar都应该在这里定义。也可以在MANIFEST.MF或standalone.xml中定义

    对于哪些JAR,我应该将它们保留在web inf/lib文件夹中?(申请 使用某些专门的数学库,如colt.jar、excel 像-jxls.jar、poi.jar这样的图形库看起来不错 (此处为候选人)

    如果有任何JAR只在ear或war中使用,那么这些JAR可以在WEB-INF/lib中定义。 但是,建议将其用作模块

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="rezg.rezg-dto">
        <dependencies>
            <module name="org.apache.log4j" />
        </dependencies>
       <resources>
           <resource-root path="rezg-dto-1.0.0.jar"/>
       </resources>
    </module>