spring问题求助org.springframework.beans.factory.CannotLoadBeanClassException:
严重: Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.test.db.BeanFactoryPost] for bean with name 'com.test.db.BeanFactoryPost' defined in ServletContext resource [/WEB-INF/contextConfig.xml]; nested exception is java.lang.ClassNotFoundException: com.test.db.BeanFactoryPost
Caused by: java.lang.ClassNotFoundException: com.test.db.BeanFactoryPost
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:177)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:313)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:912)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165)
at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:397)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:330)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
2009-3-30 15:37:36 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-3-30 15:37:36 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
2009-3-30 15:37:36 org.apache.coyote.http11.Http11Protocol start
contextConfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- common-->
<bean class="com.test.db.BeanFactoryPost" />
</beans>
jdk是ibm1.4
[解决办法]
类找不到
[解决办法]
有这个类啊
[解决办法]
com.test.db.BeanFactoryPost 路径有没写错啊
[解决办法]
是不是spring的配置文件放的路径不对啊?找不到这个类了
[解决办法]
<bean id="" class="com.test.db.BeanFactoryPost"/>
[解决办法]
bean的id没写,所以找不到
[解决办法]
我的也是这个问题。。。
[解决办法]
不知道为啥,用myeclispse自带的服务器就出错,其它的服务器就没问题啊。高手来帮帮忙
[解决办法]
我也是这个问题,配置都对呀。
[解决办法]
我的也出现这个问题了 困扰了好久了 这问题到底怎么解决啊 大家帮帮忙吧
[解决办法]
这个问题Cannot find class [com.test.db.BeanFactoryPost]
你可以到 部署的服务器里找找看 到底有没有这个class 如果没有打开这个类 再保存一下就能看见了
如果是Eclipse的话 可能就是这个原因!
[解决办法]
我也出现这个问题,以前一直可以
[解决办法]
注意你项目中WebContent/WEB-INF/classes目录。如果没有这个目录,你要设置下Eclipse的编译路径,将它指上它,具体在Java Build Path,设置Default output folder
[解决办法]
LZ不厚道
没给人结分可不好啊
[解决办法]
有可能是JDK的问题!
[解决办法]
JDK
[解决办法]
只要不用MyEclipse里面自带的jdk和tomcat就可以解决了,我的就是这样解决的。
[解决办法]
我也有这个问题啊
[解决办法]
把MyEclipse里面的那个classes删除让他重新编译就没什么问题了,只要配置是对的
[解决办法]