Proxool Provider unable to load JAXP configurator file: proxoolconf.xml

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
%%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: Proxool Provider unable to load JAXP configurator file: proxoolconf.xml
	at org.hibernate.connection.ProxoolConnectionProvider.configure(ProxoolConnectionProvider.java:125)
	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
	at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
	at dao.HibernateSessionFactory.(HibernateSessionFactory.java:31)
	at dao.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
	at work.ConnMysql.main(ConnMysql.java:30)
Caused by: org.logicalcobwebs.proxool.ProxoolException: Parsing failed.
	at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:91)
	at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:107)
	at org.hibernate.connection.ProxoolConnectionProvider.configure(ProxoolConnectionProvider.java:120)
	... 9 more
Caused by: org.logicalcobwebs.proxool.ProxoolException: Attempt to register duplicate pool called 'DBPool'
	at org.logicalcobwebs.proxool.configuration.XMLConfigurator.endElement(XMLConfigurator.java:198)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(Unknown Source)
	at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:87)
	... 11 more
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Could not read mappings from resource: dao/Day.hbm.xml
	at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)
	at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
	at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
	at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
	at dao.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:69)
	at dao.HibernateSessionFactory.getSession(HibernateSessionFactory.java:53)
	at dao.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
	at work.ConnMysql.main(ConnMysql.java:30)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping dao.Day
	at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:154)
	at org.hibernate.cfg.Configuration.add(Configuration.java:386)
	at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
	at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
	... 9 more
Exception in thread "main" java.lang.NullPointerException
	at work.ConnMysql.main(ConnMysql.java:30)


以上是在配置proxool连接池的时候遇到的问题。

以下是从http://hi.baidu.com/9prior/blog/item/ad3565cab53e214ef31fe7a1.html转载来的:

因为是在原本的工程上添加一个hibernate的插入测试,我不知道原来工程中已经有一个类是用来开连接池的,一启动服务器就可用自动打开。而我啥啥的在jsp页面里面重复的写了SessionFactory sf = new Configuration().configure()
       .buildSessionFactory();

这些,导致重新打开连接,慢不用说,还报出了错。

应该利用那个已写好的类来操作数据库的

以下附录在晚上找到的其他相关解决方式;

近日使用hibernate+proxool连接池时,总是报异常:
Proxool Provider unable to load JAXP configurator file: proxool.xml
org.logicalcobwebs.proxool.ProxoolException: Parsing failed.

我在网上查了N多的文章,总是解决不了问题.最后把web.xml中的以下配置删除,竟然好了,不知是什么原因.有知道原因的朋友,请留言! 先谢了!


    ServletConfigurator
   
        org.logicalcobwebs.proxool.configuration.ServletConfigurator
   

   
        xmlFile
        WEB-INF/classes/proxool.xml
   

    1



补充:
    解决hibernate和jdbc不能同时使用proxool的问题:
      proxool.xml
        org.hibernate.dialect.MySQLDialect
       true   //主要是加上此行既可
    true

==============================================================================

我就是通过删除build语句,就修改成功了。。(⊙﹏⊙b汗,折腾了一晚上就因为这一句话。。。)

当然,这也是和C3P0一个区别吧。

 

版权声明:本文为博主原创文章,未经博主允许不得转载。

转载于:https://www.cnblogs.com/wangicter/archive/2012/02/21/4767385.html

你可能感兴趣的:(Proxool Provider unable to load JAXP configurator file: proxoolconf.xml)