gpt4 book ai didi

java - 部署 Java 企业应用程序失败

转载 作者:行者123 更新时间:2023-12-01 12:59:46 25 4
gpt4 key购买 nike

使用 Netbeans,我创建了带有 ejb 模块和 war 模块的 Java 企业应用程序。我对 war 模块做了一些更改,一切正常。但现在我试图调用 ejb 模块中定义的远程 ejb。我已经遵循了本教程 https://netbeans.org/kb/docs/javaee/entappclient.html 。现在,当我尝试在我的应用程序服务器(JBoss AS7)中部署ear文件时,我收到以下错误:

{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"events.ear\".\"events-ejb.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"events.ear\".\"events-ejb.jar\".POST_MODULE: Failed to process phase POST_MODULE of subdeployment \"events-ejb.jar\" of deployment \"events.ear\""}}}} /Users/Luis/NetBeansProjects/events/nbproject/build-impl.xml:307: The module has not been deployed.

为什么会发生这种情况?

编辑

teste-ejb 模块NewSessionBean

package a;

import javax.ejb.Stateless;

@Stateless
public class NewSessionBean implements NewSessionBeanRemote {

// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
}

teste-war模块(未修改)

AuthenticationInterface(java 应用程序)SessionbeanRemote

package a;

import javax.ejb.Remote;

@Remote
public interface NewSessionBeanRemote {

}

2°编辑

17:59:24,759 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class a.NewSessionBean in Module "deployment.teste-ejb.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link a/NewSessionBean (Module "deployment.teste-ejb.jar:main" from Service Module Loader) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) at org.jboss.modules.Module.loadModuleClass(Module.java:517) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_51] at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_51] at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:63) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51] Caused by: java.lang.NoClassDefFoundError: a/NewSessionBeanRemote at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_51] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_51] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_51] at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) ... 19 more Caused by: java.lang.ClassNotFoundException: a.NewSessionBeanRemote from [Module "deployment.teste-ejb.jar:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) ... 24 more

17:59:24,860 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class a.NewSessionBean in Module "deployment.teste-ejb.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link a/NewSessionBean (Module "deployment.teste-ejb.jar:main" from Service Module Loader) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA] at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:225) at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:97) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51] Caused by: java.lang.NoClassDefFoundError: a/NewSessionBeanRemote at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_51] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_51] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [rt.jar:1.7.0_51] at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA] ... 16 more Caused by: java.lang.ClassNotFoundException: a.NewSessionBeanRemote from [Module "deployment.teste-ejb.jar:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

17:59:24,970 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."teste-ejb.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."teste-ejb.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "teste-ejb.jar" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Could not load EJB class a.NewSessionBean at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:227) at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:97) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more Caused by: java.lang.ClassNotFoundException: a.NewSessionBean from [Module "deployment.teste-ejb.jar:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:225) ... 7 more

17:59:25,033 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "teste-ejb.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"teste-ejb.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"teste-ejb.jar\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"teste-ejb.jar\""}} 17:59:25,037 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment teste-ejb.jar in 3ms 17:59:25,059 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report JBAS014777: Services which failed to start:
service jboss.deployment.unit."teste-ejb.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."teste-ejb.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "teste-ejb.jar"

17:59:25,071 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"teste-ejb.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"teste-ejb.jar\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"teste-ejb.jar\""}}}}

谢谢

最佳答案

我对netbeans了解不多。我建议使用 GlassFish,就像上面链接的教程一样。如果您确实想使用 JBoss AS 7,那么您需要开始阅读文档。默认情况下,由于适当的隔离类加载器,JBoss 中的模块无法看到彼此。我的猜测是你只需要关闭它或正确打包你的代码。文档在这里:

https://docs.jboss.org/author/display/AS7/Developer+Guide

关于java - 部署 Java 企业应用程序失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23596100/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com