在写完ssh登陆后,我启动tomcat报出了这样的异常:Error creating bean with name 'mlogin' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'SessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'bookshop' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookshop' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool。
解决的方法和出错的原因:
因为路径中存在和asm-2.2.3.jar冲突的包。
删除asm-2.2.3.jar问题就解决了。
删除asm-2.2.3.jar的方法:右键所建的工程,点properties——>java Build path--->libaries,把asm-2.2.3.jar包remove了 (开发工具是myeclipse).