MyEclipse6.0.0 GA中Hibernate3或Hibernate3.1的库不好用

Problem
最近在搞SSH,用的是MyEclipse6。今天用它来给一个新工程add Hibernate Capabilities.但是部署运行项目,其间报错如下:
%%%% Error Creating SessionFactory %%%%
java.lang.SecurityException: class "org.apache.commons.collections.SequencedHashMap"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:775)
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at org.hibernate.mapping.Table.<init>(Table.java:33)
	at org.hibernate.cfg.Mappings.addTable(Mappings.java:165)
	at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:299)
	at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:282)
	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
	at org.hibernate.cfg.Configuration.add(Configuration.java:386)
	at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
	at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
	at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
	at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
	at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
	at edu.dhu.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:30)
	at edu.dhu.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
	at edu.dhu.service.UserServiceImpl.isValidUser(UserServiceImpl.java:58)
	at edu.dhu.struts.action.LoginAction.execute(LoginAction.java:48)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:595)


Solution
查阅网上解答,得知为MyEclipse6里面的Hibernate library是有问题的。于是我把Hibernate的库从Build Path中remove掉。然后从网上下载Hibernate,把Hibernate3.jar和其lib下所有jar文件拷贝到我的项目的lib下。这样,重新部署和运行,没有再出现该报错。

你可能感兴趣的:(java,apache,Hibernate,struts,ssh)