環境jboss6.0 + CXF2.5.2 + spring3.0.7
1.設置項目的獨立類加載器
新建文件 META-INF/jboss-service.xml
For .war files, in your jboss-web.xml, the following template applies:
<jboss-web>
<class-loading>
<loader-repository>com.example:archive=unique-archive-name</loader-repository>
</class-loading>
</jboss-web>
Note for AS 4.2.x and versions till 5.x: As of at least JBoss 4.2.1, the <class-loading> tag appears to no longer be supported as isolation is ignored. Instead, the following configuration appears to accomplish the same goal:
<jboss-web>
<loader-repository>
com.example:archive=unique-archive-name
</loader-repository>
</jboss-web>
Interestingly enough, 4.0.5 seems to support both configurations.*
Note for 5.x and later versions: The above mentioned configuration might still work with the 4.0.x till 5.x version due to their xsd/dtd, but for versions 5.x and above the old configuration still applies for jboss-web.xml:
<jboss-web>
<class-loading>
<loader-repository>com.example:archive=unique-archive-name</loader-repository>
</class-loading>
</jboss-web>
The com.example:archive=unique-archive-name strings are JMX ObjectName strings. These have no particular significance other than that they must be unique.
It might be useful to use the same name as used for the .ear, .war, or .sar file.For example, for a petstore.ear file, use: com.example:loader=petstore.ear as the repository name.
The loader-repository ObjectName will appear in the JMX-Console (http://localhost:8080/jmx-console/). This MBean is great for debugging any class-loading issues which might arise. The hierarchical loaders created from the repository wll appear together under the loader-repository domain name, com.example in the example.