java.lang.SecurityException: class "javax.xml.bind.JAXBContext"'s signer information does not match signer information of other classes in the same package
这个错误是因为载入的包里面有两个相同路径的类,就是在一个包里面有两个同名的类
有可能是将相同的包载入两次或者把包解开后,先将jar文件载入了,后又将解开的类载入了
Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
试试自己去下一个spring的包,把包里的spring.jar加到项目里去。eclipse生成的时候可能会有些包没有放进去。
Error creating bean with name 'datasource' defined in file
Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
试试将commons-dbcp.jar,commons-pool.jar和commons- collections.jar加入CLASSPATH中
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in resource [/WEB-INF/dataAccessContext-hibernate.xml] of ServletContext: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
Invalid path /addcustomer was requested
输入的路径不正确,检查spring中注册的action的路径和输入的路径是否一致,留意大小写是否一致
2007-08-08 15:36:17,406 ERROR [org.hibernate.proxy.BasicLazyInitializer] - CGLIB Enhancement failed: dao.User
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
Spring 和 Hibernate 共用的一些 jar 文件发生了版本冲突, 删除 WEB-INF/lib/asm-2.2.3.jar 然后重启 Tomcat.
asm-2.2.3.jar
asm.jar
asm-attrs.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
另外,如果报以下错:
Caused by: java.lang.SecurityException: class "org.objectweb.asm.CodeVisitor"'s signer information does not match signer information of other classes in the same package
也是由于上一个原因,即Spring 和 Hibernate 共用的一些 jar 文件发生了版本冲突,需要删除asm-2.2.3.jar
检查一下配置文件。
比如struts-config里,action的名称和路径是否一致,是否和spring里注册的名字一致。特别留意大小写。hbm文件配置是否有错,大小写。。。
----------------------------------------------------------------------------------------------
%%%%Error Creating SessionFactory %%%% java.lang.SecurityException: class"org.apache.commons.collections.SequencedHashMap"'s signer informationdoes not match signer information of other classes in the same package
因为我用的6.0.1,所以怎么也没出现这个异常。后来Google搜到很多人遇到了这个故障,猜测是commons-collections.jar的问题,可能和MyEclipse 6.0.0自带的包有问题导致。例如下面的是一个解决方案:
解决方案:
1)下载 MyEclipse 6.0.1 来开发;
2)或者去http://commons.apache.org/collections/ 下载一个新的包,把原来的commons-collections-xxx.jar给删了,然后用新的包替换。注意:一定要到应用的发布目录去做这个工作,而且替换后不能重新发布应用,然后立即重启Tomcat再测试。
--------------------------------------------------------------------------------------------------------
1、java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.nullSafeToString(Ljava/lang/Object;)Ljava/lang/String;
spring的jar包冲突错误:
我的是用的spring2.0的jar包,应为要用工作调度所以加了一个1.2版本的spring.jar做支持,项目跑在容器下跑没事,单元测试就会出现以上错误。
参考资料:http://www.javaeye.com/post/365364
2、
support.DisposableBeanAdapter (DisposableBeanAdapter.java:148) - Couldn't invoke destroy method of bean with name 'sessionFactory'
java.lang.IllegalStateException: Shutdown in progress
查了以下资料,也有人遇到过,找了一类似http://www.blogjava.net/allen-zhe/archive/2007/03/20/104880.html,我的解决方式,就在数据源配置那加了一个destroy-method="close"配置就可以了。
解决方法是看了http://forum.springframework.org/archive/index.php/t-19665.html这片文章想出来的。
3、org.hibernate.HibernateException: CGLIB Enhancement failed:
原因是myeclipse6.0的cglib-2.1.3.jar有bug,改为cglib-2.1.jar就可以了
4、[这个是在服务器运行时才报的,有点跑题了]还有一种比较隐蔽的错误,只要log4j属性文件设置为debug时才会报的错误代码如下:
DEBUG [main] xml.DefaultNamespaceHandlerResolver (DefaultNamespaceHandlerResolver.java:128) - Ignoring namespace handler [org.springframework.scripting.config.LangNamespaceHandler]: handler class not found
java.lang.ClassNotFoundException: org.springframework.scripting.config.LangNamespaceHandler
找不到类的提示,在google上搜了一段时间没找到这个类在那个包里,最后一想肯定myeclipse自带的包肯定有,果然找到了,是少加载了spring-support.jar包。在myeclipse的Spring2.0 Misc Libraires库里作者: 囧囧有神 时间: 2011-7-13 15:55
如果再不行,都试试删删