Broadleaf Jboss设置ClassNoFound

时间:2018-01-03 05:54:15

标签: jboss broadleaf-commerce

当尝试进行阔叶Jboss设置时,我收到以下错误

我已经检查了源代码com.broadleafcommerce.customersegment.admin.dataimport.persistence.CustomerSegmentRecordPersistencePreProcessor在broadleaf-merchandising-group-1.2.1-GA.jar中可用,但奇怪的是com.broadleafcommerce.dataimport.service类。 RecordPersistencePreProcessor没有找到,请帮助。

2018-01-02 21:51:54,565 WARN  [org.jboss.modules] (MSC service thread 1-7) Failed to define class com.broadleafcommerce.customersegment.admin.dataimport.persistence.CustomerSegmentRecordPersistencePreProcessor in Module "deployment.admin.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/broadleafcommerce/customersegment/admin/dataimport/persistence/CustomerSegmentRecordPersistencePreProcessor (Module "deployment.admin.war" from Service Module Loader): com/broadleafcommerce/dataimport/service/RecordPersistencePreProcessor
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
    at org.jboss.modules.Module.loadModuleClass(Module.java:713)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadClassInfoSet(ServletContainerInitializerDeploymentProcessor.java:259)
    at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:169)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

2018-01-02 21:51:54,565 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."admin.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."admin.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "admin.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Failed to link com/broadleafcommerce/customersegment/admin/dataimport/persistence/CustomerSegmentRecordPersistencePreProcessor (Module "deployment.admin.war" from Service Module Loader): com/broadleafcommerce/dataimport/service/RecordPersistencePreProcessor
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:77)
    at org.jboss.modules.Module.loadModuleClass(Module.java:713)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadClassInfoSet(ServletContainerInitializerDeploymentProcessor.java:259)
    at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:169)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
    ... 5 more

1 个答案:

答案 0 :(得分:0)

您遇到的问题是Servlet 3.0+容器中的ServletContextInitializer扫描。在Tomcat中,您可以使用本指南来控制它:https://wiki.apache.org/tomcat/HowTo/FasterStartUp#JAR_scanning。 Jboss正在利用它的类加载器检查ServletContextInitializer类,在一些Broadleaf jar中,我们在编译时链接了一些在运行时可能无法使用的条件类。

您使用的是基于Broadleaf 5.2.x的Spring Boot项目吗?您可以尝试添加空<absolute-ordering />https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/key-aspects-and-configuration/app-server-configuration/using-a-web.xml

的web.xml

我也会质疑Jboss的使用。在Spring应用程序中使用完整的JEE应用程序服务器几乎没有理由,坦率地说,随着时间的推移,您要求更多问题。您正在尝试将胖.war(使用Maven构建的Spring应用程序)与胖应用程序服务器(jboss)结合使用。您应该将一个胖.war文件与一个轻型servlet容器(如Tomcat)或一个轻型.war文件(一个JEE应用程序)与一个JEE应用程序服务器配对。