tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException

时间:2022-04-14 10:25:27
win7 系统  +jdk1.6 +myeclipse8.5 

启动报错代码
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'g3ShopBoss' defined in class path resource [spring/spring_g3shop.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/ejb/CreateException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoClassDefFoundError: javax/ejb/CreateException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)
at java.lang.Class.getConstructor0(Class.java:2708)
at java.lang.Class.getDeclaredConstructor(Class.java:1987)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:54)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 40 more
Caused by: java.lang.ClassNotFoundException: javax.ejb.CreateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 46 more
2014-8-29 11:18:57 org.apache.catalina.core.StandardContext listenerStart

3 个解决方案

#1


G3ShopBoss类的spring配置文件
<?xml version="1.0" encoding="GBK"?>

<!--
  - spring 平台配置
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


<!--
========================= Service配置 ===============================
-->
<bean id="g3shopService" class="com.gohighsoft.g3.service.G3ShopServiceImp" />
<bean id="g3ShopBoss" class="com.gohighsoft.g3.impl.G3ShopBoss" />
<bean id="opsmsService" class="com.gohighsoft.g3.impl.OPSMSServiceImpl" />

<bean id="bossImpl" class="com.gohighsoft.g3.impl.BossImpl" />
<!--  -->
<bean id="g3shopBoss" class="com.gohighsoft.g3.impl.G3ShopBoss" />

</beans>

#2


java.lang.ClassNotFoundException: javax.ejb.CreateException
java.lang.NoClassDefFoundError: javax/ejb/CreateException


看看是不是少ejb的jar包。

#3


项目是别人的,我拿来看看,
lib 图片 
图1 
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException

图2
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException
图3
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException

#1


G3ShopBoss类的spring配置文件
<?xml version="1.0" encoding="GBK"?>

<!--
  - spring 平台配置
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


<!--
========================= Service配置 ===============================
-->
<bean id="g3shopService" class="com.gohighsoft.g3.service.G3ShopServiceImp" />
<bean id="g3ShopBoss" class="com.gohighsoft.g3.impl.G3ShopBoss" />
<bean id="opsmsService" class="com.gohighsoft.g3.impl.OPSMSServiceImpl" />

<bean id="bossImpl" class="com.gohighsoft.g3.impl.BossImpl" />
<!--  -->
<bean id="g3shopBoss" class="com.gohighsoft.g3.impl.G3ShopBoss" />

</beans>

#2


java.lang.ClassNotFoundException: javax.ejb.CreateException
java.lang.NoClassDefFoundError: javax/ejb/CreateException


看看是不是少ejb的jar包。

#3


项目是别人的,我拿来看看,
lib 图片 
图1 
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException

图2
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException
图3
tomcat6 启动报错 java.lang.NoClassDefFoundError: javax/ejb/CreateException