0
我已經爲我的sample.jar創建了一個新模塊。它有像樣品/例子那樣的包裝。在示例下,我還有2個軟件包sample1,sample2。JBoss不從模塊加載內部類
我創建模塊等模塊/樣品/例如,我的module.xml是
<module xmlns="urn:jboss:module:1.1" name="sample.example">
<resources>
<resource-root path="sample.jar"/>
<!-- Insert resources here -->
</resources>
以我的部署結構XML,
<dependencies>
<module name="sample.example" />
</dependencies>
sample.example.sample1.Test類導入sample.example.sample2.Test2文件 當我爲sample.example.sample1.Test創建對象時,我得到的是異常。
Exception in thread "main" java.lang.LinkageError: Failed to link sample/example/sample1/Test (Module "sample.example:main" from local module loader @117843d (finder: local module finder @eacb9c (roots: C:\Daten\Softwares\jboss-eap-6.2.0\jboss-eap-6.2\modules,C:\Daten\Softwares\jboss-eap-6.2.0\jboss-eap-6.2\modules\system\layers\base)))
Caused by: java.lang.NoClassDefFoundError: sample/example/sample2/Test2
at java.lang.ClassLoader.defineClass1(Native Method)
Caused by: java.lang.ClassNotFoundException: sample.example.sample2.Test2 from [Module "sample.example:main" from local module loader @117843d (finder: local module finder @eacb9c (roots: C:\Daten\Softwares\jboss-eap-6.2.0\jboss-eap-6.2\modules,C:\Daten\Softwares\jboss-eap-6.2.0\jboss-eap-6.2\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118)
... 61 more