spring 结合 proxool连接池 启动tomcat报错:Attempt to refer to a unregistered pool by its alias

注:转自:http://dsna.iteye.com/blog/707460


spring 结合 proxool连接池 启动tomcat报错:

Attempt to refer to a unregistered pool by its alias ..... 


原因:

org.springframework.web.context.ContextLoaderListener 加载先于proxool


解决办法:将proxool 也改成listener加载并先于spring

由于proxool 还没有listener的实现,所以自己写了一个以listener方式加载proxool 的实现的补丁proxool-listenerCfg.jar


下载补丁修改web.xml

<servlet>   
        <servlet-name>ServletConfigurator</servlet-name>   
        <servlet-class>   
            org.logicalcobwebs.proxool.configuration.ServletConfigurator   
        </servlet-class>   
        <init-param>   
            <param-name>xmlFile</param-name>   
            <param-value>WEB-INF/proxool.xml</param-value>   
        </init-param>   
        <load-on-startup>1</load-on-startup>   
    </servlet>

改为:

<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>







你可能感兴趣的:(spring 结合 proxool连接池 启动tomcat报错:Attempt to refer to a unregistered pool by its alias)