我已将2个项目作为类库添加到我的ejb项目中。这些cliass库项目只有SE Java类,用于域和一些其他值对象。我使用GlassFish 3,IDE是Netbeans 7.0.1。任务'清洁&构建所有类库项目,ejb项目和Web项目(JSP和servlet存在于其中)都是成功的,这是干净的&构建由IDE完成。但是ejb项目无法部署,因为它提供了异常(java.lang.RuntimeException: java.lang.NoClassDefFoundError:
),说没有找到类库。
我删除并多次添加这些库。但总是一样的错误。当我不使用这些类库并且不使用它们时,可以部署ejb应用程序。我认为,问题是,如果已导入任何其他项目并将其添加到ejb应用程序,则IDE无法部署ejb应用程序。(我不确切知道,但我猜)。
我是ejb的新手。请告诉我如何将此ejb应用程序与其他项目一起部署。提前谢谢你 这是错误。
SEVERE: DPL8008: method/class loading failure : (EjbDescriptor.getBusinessMethodDescriptors())
method/class name - {1}
SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer load method
java.lang.RuntimeException: EJB Container initialization error
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:242)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:101)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:257)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/app/model/User
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:219)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:229)
... 32 more
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/app/model/User
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2302)
at com.sun.enterprise.deployment.EjbDescriptor.getBusinessMethodDescriptors(EjbDescriptor.java:2312)
at com.sun.enterprise.deployment.EjbDescriptor.getMethodDescriptors(EjbDescriptor.java:2217)
at org.glassfish.ejb.security.application.EJBSecurityManager.convertEJBMethodPermissions(EJBSecurityManager.java:546)
at org.glassfish.ejb.security.application.EJBSecurityManager.loadPolicyConfiguration(EJBSecurityManager.java:256)
at org.glassfish.ejb.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:317)
at org.glassfish.ejb.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:190)
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:209)
... 33 more
Caused by: java.lang.NoClassDefFoundError: com/app/model/User
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.getMethods(Class.java:1410)
at com.sun.enterprise.deployment.EjbDescriptor.addAllInterfaceMethodsIn(EjbDescriptor.java:2327)
at com.sun.enterprise.deployment.EjbDescriptor.getLocalRemoteBusinessMethodDescriptors(EjbDescriptor.java:2280)
... 40 more
答案 0 :(得分:0)
您需要在战争中部署外部lib(例如在WEB-INF/lib
中)或将其放置在容器类路径中(不是首选)。如何执行此操作取决于您的容器和buildtool / ide。