当前位置: 代码迷 >> Java Web开发 >> Hibernate+proxool链接数据失败是什么原因
  详细解决方案

Hibernate+proxool链接数据失败是什么原因

热度:92   发布时间:2016-04-17 15:34:08.0
Hibernate+proxool链接数据失败是什么原因?
配置好了之后访问是TOMCAT报如下错误:
Proxool   Provider   unable   to   load   JAXP   configurat   or   file:   proxool.xml
以下是所用到的代码,请大家帮我看看问题出在那里了?谢谢!


[hibernate.cfg.xml]代码如下:

<?xml   version= '1.0 '   encoding= 'UTF-8 '?>
<!DOCTYPE   hibernate-configuration   PUBLIC
                    "-//Hibernate/Hibernate   Configuration   DTD   3.0//EN "
                    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd ">
<hibernate-configuration>
<session-factory>  
<property   name= "hibernate.proxool.pool_alias "> dbpool </property>
<property   name= "hibernate.proxool.xml "> proxool.xml </property>
<property   name= "connection.provider_class "> org.hibernate.connection.ProxoolConnectionProvider </property>
<property   name= "hibernate.show_sql "> false </property>
<property   name= "hibernate.dialect "> org.hibernate.dialect.MySQLInnoDBDialect </property>
<property   name= "hibernate.connection.driver_class "> com.mysql.jdbc.Driver </property>  
<!--   Mapping   files   -->
<mapping   resource= "com/tcs/bean/entitybean/Employee.hbm.xml "   />
</session-factory>
</hibernate-configuration>


[proxool.xml]代码如下:

<?Xml   version= "1.0 "   encoding= "utf-8 "?>
<!--   the   proxool   configuration   can   be   embedded   within   your   own   application 's.
        Anything   outside   the   "proxool "   tag   is   ignored.   -->
<something-else-entirely>
        <proxool>
                <alias> dbpool </alias>
                <!--proxool只能管理由自己产生的连接-->
                <driver-url>
                    jdbc:mysql://127.0.0.1:3306/tcs?useUnicode=true&amp;characterEncoding=UTF-8
                </driver-url>
                <driver-class> com.mysql.jdbc.Driver </driver-class>
                <driver-properties>
                        <property   name= "user "   value= "root "   />
                        <property   name= "password "   value= "123123 "   />
                </driver-properties>
                <!--   proxool自动侦察各个连接状态的时间间隔(毫秒),侦察到空闲的连接就马上回收,超时的销毁-->
                <house-keeping-sleep-time> 90000 </house-keeping-sleep-time>
                <!--   最少保持的空闲连接数-->
                <prototype-count> 5 </prototype-count>
  相关解决方案