SSH框架整合报错
2010-8-96:12:57org.apache.catalina.core.AprLifecycleListenerinit信息:TheAPRbasedApacheT...
2010-8-9 6:12:57 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_11\bin;D:\apache-tomcat-6.0.18\bin
2010-8-9 6:12:57 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8089
2010-8-9 6:12:57 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2279 ms
2010-8-9 6:12:58 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-8-9 6:12:58 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
log4j:WARN No appenders could be found for logger (org.springframework.util.ClassUtils).
log4j:WARN Please initialize the log4j system properly.
2010-8-9 6:13:02 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2010-8-9 6:13:08 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at 展开
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_11\bin;D:\apache-tomcat-6.0.18\bin
2010-8-9 6:12:57 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8089
2010-8-9 6:12:57 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2279 ms
2010-8-9 6:12:58 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-8-9 6:12:58 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
log4j:WARN No appenders could be found for logger (org.springframework.util.ClassUtils).
log4j:WARN Please initialize the log4j system properly.
2010-8-9 6:13:02 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2010-8-9 6:13:08 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at 展开
5个回答
展开全部
一、环境配置:
1.1 导包顺序:Struts ---->Spring ---> Hibernate
1.2 删除三个包:asm.jar/asm-attrs.jar /cglib-2.1.3.jar
1.3 添加一个包:commons-pool.jar
二、DAO:
2.1 代码:
DaoImpl extends HibernateDaoSupport
(CRUD: getHiberanteTemplate().save/update/delte/get/load/find(传参))
2.2 配置: 注入sessionFactory
三、Service:
3.1 代码:
3.1.1 所有业务方法中的实体类型应该是DTO 职责:处理业务/调用DAO
3.1.2 ServiceImpl 中定义DAO接口
3.2 配置: 注入DAO
四、Action:
4.1 代码:
4.1.1 Action 中定义Service接口
4.2 配置
4.2.1
<action type="org.springframework.web.struts.DelegatingActionProxy"/>
[将客户端请求转交给Spring容器的DelegatingActionProxy]
4.2.2
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="classpath:beans.xml" />
4.2.3
<bean name="path" class="action路径">
<注入Service/>
</bean>
1.1 导包顺序:Struts ---->Spring ---> Hibernate
1.2 删除三个包:asm.jar/asm-attrs.jar /cglib-2.1.3.jar
1.3 添加一个包:commons-pool.jar
二、DAO:
2.1 代码:
DaoImpl extends HibernateDaoSupport
(CRUD: getHiberanteTemplate().save/update/delte/get/load/find(传参))
2.2 配置: 注入sessionFactory
三、Service:
3.1 代码:
3.1.1 所有业务方法中的实体类型应该是DTO 职责:处理业务/调用DAO
3.1.2 ServiceImpl 中定义DAO接口
3.2 配置: 注入DAO
四、Action:
4.1 代码:
4.1.1 Action 中定义Service接口
4.2 配置
4.2.1
<action type="org.springframework.web.struts.DelegatingActionProxy"/>
[将客户端请求转交给Spring容器的DelegatingActionProxy]
4.2.2
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="classpath:beans.xml" />
4.2.3
<bean name="path" class="action路径">
<注入Service/>
</bean>
展开全部
把你部署工程tomcat下项目西面的lib下asm-2.2.3.jar去掉
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
删除 WEB-INF/lib/asm-2.2.3.jar 然后重启 Tomcat.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:这句话是关键,sessionFactory没有创建,仔细核对一下你的applicationContext.xml
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你里面的包有重复的,具体哪个我忘记了,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询