ssh框架搭建问题

xiejunxjss 2012-09-20 12:33:04
今天搭建ssh框架时报了这个错误,请大神分析一下,下面贴出代码,谢谢了
严重: action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
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:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.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/db_database07"></property>
<property name="username" value="root"></property>
<property name="password" value="111"></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/lwy/dto/Userlogin.hbm.xml</value>
<value>com/lwy/dto/Specialty.hbm.xml</value></list>
</property></bean>
<!-- 定义事务管理器 -->


<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<!--定义注释驱动-->
<tx:annotation-driven transaction-manager="transactionManager" />

<bean id="userLoginDao" class="com.lwy.dao.UserLoginDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="specialtyDao" class="com.lwy.dao.SpecialtyDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<bean name="/reg" class="com.lwy.action.RegAction">
<property name="userLoginDao" ref="userLginDao"></property>
<property name="specialtyDao" ref="specialtyDao"></property>
</bean>
</beans>
...全文
120 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
a82759082 2012-09-20
  • 打赏
  • 举报
回复
虽然感觉你不会结贴,但还是帮一下你吧,叫我Q1204922132,我这有你所需要的jar
monrove 2012-09-20
  • 打赏
  • 举报
回复
缺少common-pool.jar,Apache的官方网站上可以下载,目前最新版可能是1.6的吧(common-pool-1.6.jar)

67,538

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧