Spring监听器与proxool.xml(数据库连接池)

来源:互联网 发布:oracle数据库基本语句 编辑:程序博客网 时间:2024/06/06 17:44

原文:http://my.oschina.net/u/996297/blog/137818

spring监听器在服务器加载时,会比proxool.xml(数据库连接池)先运行,所以必须在web.xml里面配置好,让proxool.xml比spring监听器先运行。

org.springframework.web.context.ContextLoaderListener 加载先于proxool 
 
 解决办法:将proxool 也改成listener加载并先于spring
由于proxool 还没有listener的实现,所以自己写了一个以listener方式加载proxool 的实现的补丁


Web.xml配置改为:

Xml代码

<context-param>      
<param-name>proxoolConfigLocation</param-name>     
 
<param-value>WEB-INF/proxool.xml</param-value>  
</context-param>  
<listener>     
 
<listener-class>org.logicalcobwebs.proxool.configuration.ListenerConfigurator</listener-class> 
</listener>  
<listener>         
 
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener>  


0 0