[size=large]这样的配置用了好久了,一直没出状况,今天突然出状况了,而且重新集成ssh框架后也是同样的错误,郁闷中...,MyEclipse启动tomcat就报错,不知所谓何? 贴出来请教下有遇到此问题的大侠:[/size]
平台采用ssh框架,集成环境的jar包是用MyEclipse8.0M2自动创建,
[img]http://dl.iteye.com/upload/attachment/188763/761d5160-fb8c-3b87-bbbb-c9e23a7c008f.png[/img]
ApplicationContext.xml配置:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- 定义数据源Bean -->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://127.0.0.1:3306/task_system?useUnicode=true&characterEncoding=UTF-8">
</property>
<property name="username" value="root"></property>
<property name="password" value="1234"></property>
</bean>
<!--定义了Hibernate的SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">20</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/pojo/UserDept.hbm.xml</value>
<value>/pojo/UserEmployee.hbm.xml</value>
<value>/pojo/UserJob.hbm.xml</value>
</list>
</property>
</bean>
报错:
严重: 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:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
[b]问题补充:[/b]
问题解决了,是我不知道什么时候把jsp页面的struts标签里加个html标签了,肯定是放错位置了,后来纠正后,又不小心还原了一下吧,所以没发现,今天看了楼下的朋友的答案,提醒了我,在jsp页面里把代码分段删除测试,终于发现问题之所在了。谢谢您的热心,多亏您提醒我。