1:NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException 解决办法,
是因为缺少了aspectjweaver.jar ,
2:Cannot find class [com.mchange.v2.c3p0.ComboPooledDataSource]
是因为缺少了c3p0-0.9.0.4.jar,
3:NoClassDefFoundError: org/slf4j/LoggerFactory和NoClassDefFoundError: org/apache/log4j/LogManager解决方法
这是因为项目缺少slf4j-api.jar和slf4j-log4j12.jar这两个jar包导致的错误。
4:java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter解决方法
缺少javassist包
5:org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [dao.impl.UserDaoImpl]: Does the parameter type of the setter match the return type of the getter?
6:Invalid property 'sessionFactory' of bean class [org.springframework.jdbc.datasource.DataSourceTransactionManager]: Bean property 'sessionFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?方法1、
在对应UserDaoImpl中加入sessionfactory的set方法、get方法。
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
继承JdbcDaoSupport。
UserDaoImpl extends JdbcDaoSupport
方法2、
UserDaoImpl extends HibernateDaoSupport
用JdbcTempalte或HibernateTempalte操作数据库。
使用Spring3.0.3集成hibernate3,在添加声明式事务管理后,测试,发现抛出java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor异常
错误原因:
缺少aopalliance.jar包,从别的地方下载这个包大多都会产生另外一个异常,从springsource下载这个 com.springsource.org.aopalliance-1.0.0包就可以解决的这个问题
8:java.lang.NoClassDefFoundError: Lcom/opensymphony/xwork2/util/logging/Logger tomcat6 启动错误
9:NoClassDefFoundError: antlr/ANTLRException报错问题的修改java.lang.NoClassDefFoundError: Lcom/opensymphony/xwork2/util/logging/Logger;Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.logging.Logger
原因是struts2的包和xwork的包的版本不同我用的是xwork-2.0.4.jarstruts2-core-2.1.8.1.jar
那么struts2-core-2.1.8.1.jar包下面的org.apache.struts2.dispatcher.FilterDispatcher类有一个log全局变量private Logger log = LoggerFactory.getLogger(FilterDispatcher.class);LoggerFactory是在com.opensymphony.xwork2.util.logging.LoggerFactory;而xwork-2.0.4.jar没有这个类,要下载xwork-2.1.2.jar以上的版本才Yui有这个logging包