配置好了之后访问是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>
        <!-- 允许最大连接数,超过了这个连接,再有请求时,就排在队列中等候,最大的等待请求数由maximum-new-connections决定-->
        <maximum-connection-count>100</maximum-connection-count>
        <!-- 最小连接数-->
        <minimum-connection-count>10</minimum-connection-count>
    </proxool>
</something-else-entirely>[数据库工厂类]代码如下:public class HibernateFactory {
private static final SessionFactory sessionFactory;
static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) { 
throw new ExceptionInInitializerError(ex);
}
}
public static final ThreadLocal session = new ThreadLocal();
public static Session currentSession() {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}
public static void closeSession() {
Session s = (Session) session.get();
if (s != null)
s.close();
session.set(null);
}
}

解决方案 »

  1.   

    找不到proxool.xml 现在这两个配置文件怎么放的
      

  2.   

    这两个配置文件在同一个目录下放着:都在WEB-INF\classes
      

  3.   

    在网上查了,好象是版本的问题:我现在的版本是:
    proxool-0.8.3.jar
    hibernate3.jar
    jdbc2_0-stdext.jar
    mysql-connector-java-5.0.0-beta-bin.jar我那个版本不适合?
      

  4.   

    跟这个有关么?
    hibernate.proxool.existing_pool true
    我看你没有这个设置吧?
      

  5.   

    hibernate.proxool.existing_pool true
    设置后现在TOMCAT报错是:org.hibernate.exception.JDBCConnectionException: Cannot open connection晕呀