Broadleaf Jboss设置ClassNoFound
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Broadleaf Jboss设置ClassNoFound相关的知识,希望对你有一定的参考价值。
在尝试进行阔叶Jboss设置时,我收到以下错误
我检查了源代码com.broadleafcommerce.customersegment.admin.dataimport.persistence.CustomerSegmentRecordPersistencePreProcessor在broadleaf-merchandising-group-1.2.1-GA.jar中可用,但奇怪的是com.broadleafcommerce.dataimport.service类.cordPersistencePreProcessor类是no找到的地方,请帮忙。
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
您遇到的问题是在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应用程序服务器配对。
以上是关于Broadleaf Jboss设置ClassNoFound的主要内容,如果未能解决你的问题,请参考以下文章
电商系统Broadleaf文档翻译 - 主要实体main entities
通过 BroadLeaf 管理站点添加了类别,但无法在站点中查看
在 Broadleaf 项目中 HTTP 状态 403 - 在请求参数“_csrf”或标头“X-CSRF-TOKEN”上发现无效的 CSRF 令牌“null”