proxool成功配置

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ??


org.logicalcobwebs.proxool.ProxoolException: Parsing failed.??

http://blog.sina.com.cn/s/blog_4a04ce7601009tin.html解决此问题:
org.hibernate.HibernateException:   Proxool   Provider   unable   to   load   JAXP   configurator   file:   proxool.xml 

hibernate3.2和proxool0.9.1的配置如下:
(1)hibernate.hbm.xml中添加:
<property name="hibernate.proxool.pool_alias">pool</property>
     <property name="hibernate.proxool.xml">proxool.xml</property>
     <property name="hibernate.proxool.existing_pool">true</property>
     <property name="connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider
(2)在web.xml中添加:
<servlet>
     <servlet-name>proxoolInitialServlet</servlet-name>
     <servlet-class>
      org.logicalcobwebs.proxool.configuration.ServletConfigurator
     </servlet-class>
     <init-param>
      <param-name>xmlFile</param-name>
      <param-value>WEB-INF/classes/proxool.xml</param-value>
     </init-param>
     <load-on-startup>1</load-on-startup>
</servlet>

  <servlet>
   <servlet-name>proxool</servlet-name>
   <servlet-class>
    org.logicalcobwebs.proxool.admin.servlet.AdminServlet
    </servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>proxool</servlet-name>
   <url-pattern>/Admin/proxool</url-pattern>
</servlet-mapping>
(3)在src目录下建一个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>pool</alias>

           <!-- proxool只能管理由自己产生的连接 -->
           <driver-url>jdbc:mysql://localhost:3306/zhangwei
           </driver-url>

           <driver-class>com.mysql.jdbc.Driver</driver-class>
           <driver-properties>
               <property name="user" value="root" />
               <property name="password" value="path" />
           </driver-properties>

           <house-keeping-sleep-time>90000</house-keeping-sleep-time>

           <prototype-count>15</prototype-count>
           <maximum-connection-count>500</maximum-connection-count>
           <minimum-connection-count>30</minimum-connection-count>
           <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>

       </proxool>

</something-else-entirely>

搞了半天终于成功了。呵呵。。。。

你可能感兴趣的:(mysql,xml,Hibernate,jdbc,配置管理)