struts2,hibernate4,spring3配置时问题汇总及解决办法

1.java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
缺少asm-3.3.jar
2.java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor
缺少asm-commons-3.3.jar
3.java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
缺少spring-web-3.2.3.RELEASE.jar
4.java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
缺少spring-web-3.2.3.RELEASE.jar
5.java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener
缺少spring-web-3.2.3.RELEASE.jar
6.java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
缺少spring-web-3.2.3.RELEASE.jar
7.java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext
缺少spring-context-3.2.3.RELEASE.jar
8.Caused by: java.lang.ClassNotFoundException: org.springframework.beans.FatalBeanException
缺少spring-beans-3.2.3.RELEASE.jar
9.Caused by: java.lang.ClassNotFoundException: org.springframework.core.NestedRuntimeException
缺少spring-core-3.2.3.RELEASE.jar
10.java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
缺少log4j-1.2.16.jar
11.

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://www.springframework.org/schema/tx]
缺少spring-tx-3.2.3.RELEASE.jar
12.org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from class path resource
[resource/applicationContext.xml]; nested exception is
java.lang.NoClassDefFoundError:
org/aopalliance/intercept/MethodInterceptor
缺少aopalliance-1.0.jar
13.

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://www.springframework.org/schema/aop]
缺少spring-aop-3.2.3.RELEASE.jar
14.java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
缺少spring-expression-3.2.3.RELEASE.jar
15.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘dataSource‘ defined in class path resource
[resource/applicationContext.xml]: BeanPostProcessor before
instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0‘:
Cannot resolve reference to bean ‘pointcut‘ while setting bean property
‘pointcut‘; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘pointcut‘: Instantiation of bean failed; nested
exception is java.lang.NoClassDefFoundError:
org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
缺少spring-aspects-3.2.3.RELEASE.jar、aspectjweaver.jar、aspectjrt.jar
16.
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]
for bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]; nested exception is
java.lang.ClassNotFoundException:
org.springframework.orm.hibernate4.LocalSessionFactoryBean
缺少spring-orm-3.2.3.RELEASE.jar
17.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/hibernate/annotations/common/reflection/ReflectionManager
缺少hibernate-commons-annotations-4.0.2.Final.jar
18.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/dom4j/DocumentException
缺少dom4j-1.6.1.jar
19.org.springframework.beans.factory.BeanCreationException:
Error creating bean with name ‘sessionFactory‘ defined in class path
resource [resource/applicationContext.xml]: Invocation of init method
failed; nested exception is java.lang.NoClassDefFoundError:
org/jboss/logging/BasicLogger
缺少jboss-logging-3.1.1.GA.jar
20.  
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
javax/transaction/SystemException
缺少jboss-transaction-api_1.1_spec-1.0.1.Final.jar
21.  
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
javax/persistence/Entity
缺少hibernate-jpa-2.0-api-1.0.1.Final.jar
22.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is
org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level
cache is used in the application, but property
hibernate.cache.region.factory_class is not given, please either disable
second level cache or set correct region factory class name to property
hibernate.cache.region.factory_class (and make sure the second level
cache provider, hibernate-infinispan, for example, is available in the
classpath).
hibernate.cfg.xml配置中需添加:
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
23.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘sessionFactory‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/slf4j/LoggerFactory
缺少slf4j-api-1.6.1.jar
24.
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name ‘transactionManager‘ defined in class path resource
[resource/applicationContext.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
缺少spring-jdbc-3.2.3.RELEASE.jar
25.
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [com.cjjt.dao.impl.BaseDaoImpl] for bean with name ‘baseDao‘
defined in class path resource [resource/applicationContext.xml]; nested
exception is java.lang.ClassNotFoundException:
com.cjjt.dao.impl.BaseDaoImpl
26.Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
缺少struts2-spring-plugin-2.3.15.jar
27.org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException:
Batch update returned unexpected row count from update [0]; actual row
count: 0; expected: 1; nested exception is
org.hibernate.StaleStateException: Batch update returned unexpected row
count from update [0]; actual row count: 0; expected: 1

28.java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
 问题及解决办法:缺少commons-logging.jar,需要在lib中添加。
 29.NoClassDefFoundError: org/logicalcobwebs/cglib/core/NamingPolicy
 问题及解决办法:默认hibernate4下连接池jar包为较老的proxool-0.8.3.jar。需要换成proxool-0.9.1.jar和proxool-cglib.jar
 30.org.logicalcobwebs.proxool.ShutdownHook - Problem calling "get cause" on IllegalStateException.

问题及解决办法:默认hibernate4下连接池jar包为较老的proxool-0.8.3.jar。需要换成proxool-0.9.1.jar和proxool-cglib.jar

时间: 2024-11-10 08:29:24

struts2,hibernate4,spring3配置时问题汇总及解决办法的相关文章

Launcher Activity在开机时重启两次解决办法

今天在看log的时候发现,Launcher activity会被onDestroy掉一次,然后再重启. 可能原因猜测: 1.横竖屏切换 2.MCC MNC等Configuration改变引起的 MCC(移动国家码)和 MNC(移动网络码) 由于当时的Launcher设置为强制横屏了,应该是不会引起重启的. 对于Configuration改变系统会发一个android.intent.action.CONFIGURATION_CHANGED的广播 于是就做了一个广播接收器去检测是不是由于Config

tomcat单独启动时闪退的解决办法,以及修改端口8080为80,

tomcat单独启动时闪退的解决办法: 点击" startup",马上就闪退了:原因一般都是没有配置%JAVA_HOME%和tomcat的环境变量造成的: 很简单: 在startup.bat那个文件下,编辑点进去之后,在最上边的echo off上面加上: SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_60 SET TOMCAT_HOME=C:\apache-tomcat-7.0.53 然后shutdown.bat里面也要加上这两句话: 然后重

Win 2008 R2安装SQL Server 2008“性能计数器注册表配置单元一致性”失败的解决办法

Win 2008 R2安装SQL Server 2008"性能计数器注册表配置单元一致性"失败的解决办法(2011-02-23 19:37:32) 转载▼   今天在惠普服务器上安装数据库2008时,在进行数据库安装检测时总是有一点通不过,提示"性能计数器注册表配置单元一致性失败".以前在其他的服务器上安装都没有碰到过这个问题.开始以为系统没有装好,后面重装了还是一样的.但同一张系统盘在IBM等其他服务器安装系统后,再安装数据库没有出现此问题,很是令人费解.后来在网

dedecms添加文章时提示标题为空,编辑文章时编辑器空白的解决办法

dedecms添加文章时提示标题为空,编辑文章时编辑器空白的解决办法 dedecms出现这个问题与代码无关,主要是和PHP的版本有关,用的PHP5.4,更换成PHP5.2之后就不会有这个问题了. 问题原因是:php5.4版本中htmlspecialchars在php5.4默认为utf8编码,gbk编码的字符串经过htmlspecialchars 转义后的中文字符串为空了,所以造成添加文章时提示"标题不能为空",编辑文章时编辑器内容空白. 解决的办法:标题不能为空修改dede/artic

20140509-MySQL导入脚本文件,插入数据时显示乱码的解决办法

20140509-MySQL导入脚本文件,插入数据时显示乱码的解决办法 打开CMD输入以下命令: mysql –u root –p 然后输入密码: 在导入脚本文件之前,对字符编码进行设置: charset gbk; 说明:上面的这条语句非常关键,这样不论你在cmd窗口,还是使用客户端输入中文,都能够正确保存了. 建议初学者不要使用SQLyog或者Navicat Premium等客户端连接工具.

MVC 使用ckfinder时提示客户端危险解决办法

MVC 使用ckfinder时提示客户端危险解决办法 在处理接收信息的Controller前面加   [ValidateInput(false)]形如:[HttpPost][ValidateInput(false)] public ActionResult GoodDetail(FormCollection form){return View();} 这种解决方法是把验证去掉了,对应网站安全性要求不高的(比如自己的后台)可以使用,论坛文本编辑器不建议

android viewpager fragment切换时界面卡顿解决办法

目前开发的程序在切换View时界面卡顿现象比较严重,影响用户体验,当前项目共就四个View,每个View也只是按钮,所以可以同时加载,不让其它view销毁. 只需在Adapter中重载destroyItem类即可 @Override public void destroyItem(ViewGroup container, int position, Object object) { //重载该方法,防止其它视图被销毁,防止加载视图卡顿 //super.destroyItem(container,

启动Tomcat时的常见问题及解决办法

问题一:环境变量 1.检查jdk 验证jdk的配置,在运行-cmd中输入 java -version 即表示安装成功. 如果jdk没有问题,还需要配置两个环境变量.找到jdk和jre的路径,配置JAVA_HOME和JRE_HOME,变量值为jdk的安装路径. JAVA_HOME D:\Program Files (x86)\Java\jdk1.6.0_10 JRE_HOME C:\Program Files (x86)\Java\jre6 如果不清楚是否配置成功,可使用命令来检查.如下图,提示J

Unity3d导出Android的apk文件时相关问题的解决办法

[狗刨学习网] 今天上午着手将一个unity3d开发的小游戏build到android手机上运行,结果遇到了不少问题. 首先遇到的第一个问题是在build到一半的时候,弹出如下报错: Error building Player: UnityException: No platforms found Android SDK does not include any platforms! Did you run Android SDK setup to install the platform(s)