JBoss eap 6/as 7 class 加载程序:如何修复 LinkageError
JBoss eap 6/as 7 class loader: how to fix LinkageError
我正在尝试在 jboss eap 6 上部署我的 seam 2.2.2 应用程序。
1) 我的应用程序需要lucene-core.jar 所以我必须把它打包在我的耳朵里
2) Hibernate-search模块依赖lucene-core模块加载。
然后失败:
16:18:29,788 DEBUG [org.jboss.seam.persistence.HibernatePersistenceProvider] (ServerService Thread Pool -- 56) Hibernate Search is available :-)
16:18:29,843 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyApp]] (ServerService Thread Pool -- 56) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: securityManagerContextHolder
at org.jboss.seam.Component.newInstance(Component.java:2170) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.init.Initialization.init(Initialization.java:744) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam.jar:2.2.2.Final]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.9.Final-redhat-1.jar:7.4.9.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.9.Final-redhat-1.jar:7.4.9.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService.access[=12=]0(WebDeploymentService.java:59) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService.run(WebDeploymentService.java:94) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.RuntimeException: exception invoking: getEntityManager
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.unwrap(Component.java:2301) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:2044) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1986) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1980) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1975) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.EntityController.getEntityManager(EntityController.java:21) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.EntityController.createQuery(EntityController.java:42) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.UserGroupController.listUserGroups(UserGroupController.java:46) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.UserGroupController_$$_javassist_seam_4.listUserGroups(UserGroupController_$$_javassist_seam_4.java) [MyApp-ejb.jar:]
at com.myapp.youknow.security.SecurityManagerContextHolder.loadSecurityManagerContext(SecurityManagerContextHolder.java:55) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.SecurityManagerContextHolder_$$_javassist_seam_3.loadSecurityManagerContext(SecurityManagerContextHolder_$$_javassist_seam_3.java) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callCreateMethod(Component.java:2198) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.newInstance(Component.java:2158) [jboss-seam.jar:2.2.2.Final]
... 16 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.2.2.Final]
... 69 more
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/apache/lucene/search/Query"
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_71]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_71]
at com.sun.proxy.$Proxy143.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Proxy.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyEntityManager(HibernatePersistenceProvider.java:331) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:81) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:108) [jboss-seam.jar:2.2.2.Final]
... 75 more
这似乎是不同 class 加载器的问题,但由于我是 jboss 模块机制的新手,我不知道如何解决这个问题。有什么建议吗?
我通过将 lucene-core 模块定义为全局模块来解决这个问题。
我遵循了这个解释:http://www.javacodegeeks.com/2012/09/jboss-as-7-classloading-explained.html
我正在尝试在 jboss eap 6 上部署我的 seam 2.2.2 应用程序。
1) 我的应用程序需要lucene-core.jar 所以我必须把它打包在我的耳朵里
2) Hibernate-search模块依赖lucene-core模块加载。
然后失败:
16:18:29,788 DEBUG [org.jboss.seam.persistence.HibernatePersistenceProvider] (ServerService Thread Pool -- 56) Hibernate Search is available :-)
16:18:29,843 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyApp]] (ServerService Thread Pool -- 56) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: securityManagerContextHolder
at org.jboss.seam.Component.newInstance(Component.java:2170) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.init.Initialization.init(Initialization.java:744) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam.jar:2.2.2.Final]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.9.Final-redhat-1.jar:7.4.9.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.9.Final-redhat-1.jar:7.4.9.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService.access[=12=]0(WebDeploymentService.java:59) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.as.web.deployment.WebDeploymentService.run(WebDeploymentService.java:94) [jboss-as-web-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.RuntimeException: exception invoking: getEntityManager
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.unwrap(Component.java:2301) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:2044) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1986) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1980) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.getInstance(Component.java:1975) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.EntityController.getEntityManager(EntityController.java:21) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.framework.EntityController.createQuery(EntityController.java:42) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.UserGroupController.listUserGroups(UserGroupController.java:46) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.UserGroupController_$$_javassist_seam_4.listUserGroups(UserGroupController_$$_javassist_seam_4.java) [MyApp-ejb.jar:]
at com.myapp.youknow.security.SecurityManagerContextHolder.loadSecurityManagerContext(SecurityManagerContextHolder.java:55) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.2.2.Final]
at com.myapp.youknow.security.SecurityManagerContextHolder_$$_javassist_seam_3.loadSecurityManagerContext(SecurityManagerContextHolder_$$_javassist_seam_3.java) [MyApp-ejb.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.callCreateMethod(Component.java:2198) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.Component.newInstance(Component.java:2158) [jboss-seam.jar:2.2.2.Final]
... 16 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.2.2.Final]
... 69 more
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/apache/lucene/search/Query"
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_71]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_71]
at com.sun.proxy.$Proxy143.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_71]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Proxy.newInstance(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source) [rt.jar:1.7.0_71]
at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyEntityManager(HibernatePersistenceProvider.java:331) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:81) [jboss-seam.jar:2.2.2.Final]
at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:108) [jboss-seam.jar:2.2.2.Final]
... 75 more
这似乎是不同 class 加载器的问题,但由于我是 jboss 模块机制的新手,我不知道如何解决这个问题。有什么建议吗?
我通过将 lucene-core 模块定义为全局模块来解决这个问题。 我遵循了这个解释:http://www.javacodegeeks.com/2012/09/jboss-as-7-classloading-explained.html