ApplicationContext.xml:<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/study"></property>
<property name="username" value="root"></property>
<property name="password" value="zjm1982"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/zjm/study/vo/Codedb.hbm.xml</value>
<value>com/zjm/study/vo/Userdb.hbm.xml</value>
</list>
</property>
</bean>
</beans>
启动时报的错误:2009-06-19 19:07:25 [org.springframework.web.struts.ContextLoaderPlugIn]-[ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/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-------------------
不太懂,请问怎么回事
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/study"></property>
<property name="username" value="root"></property>
<property name="password" value="zjm1982"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/zjm/study/vo/Codedb.hbm.xml</value>
<value>com/zjm/study/vo/Userdb.hbm.xml</value>
</list>
</property>
</bean>
</beans>
启动时报的错误:2009-06-19 19:07:25 [org.springframework.web.struts.ContextLoaderPlugIn]-[ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/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-------------------
不太懂,请问怎么回事
解决方案 »
- java 运行excel
- ServletResponse中的Committed是什么意思?比如isCommitted()方法是干什么的?
- hibernate查询问题
- JSP中的自定义标签 能否在外标签下获得内标签
- EJB2.0中Entity Bean的主要作用是不是对象持久化?
- TOMCAT 6.0 运行正常的程序 在TOMCAT 5.5中出现错误
- 同个网络之间不同主机里的文件操作
- 用XML解析数据库记录。最好是有实例。在SQLSERVER2000中
- sun的deploytool工具怎么那么差?在我的电脑上总是不能正确显示窗口
- 简单问题,结果集操作------偶来为大家的专家分作贡献
- 有一道面试题,请帮忙解答一下。
- 为什么taobao选择php做站
从其他地方搜到的,你试试吧.
解决办法是:1.去掉类路径上的关于Hibernate的3个libasm.jarasm-attrs.jarcglib-2.1.3.jar
2.加入Spring中的以下4个libasm-2.2.3.jarasm-commons-2.2.3.jarasm-util-2.2.3.jarcglib-nodep-2.1_3.jar
2.删除这三个jar包asm.jar,asm-attrs.jar,cglib-2.1.3.jar
删除这三个jar包asm.jar,asm-attrs.jar,cglib-2.1.3.jar
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
红色部分有问题