请问,如何使用Proxool配置JNDI数据源,急
目前的配置文件如下:
Proxool.xml
<?xml version= "1.0 " encoding= "UTF-8 "?>
<something-else-entirely>
<proxool>
<alias> DBPool </alias>
<driver-url> jdbc:oracle:thin:@127.0.0.16:1521:ora </driver-url>
<driver-class> oracle.jdbc.driver.OracleDriver </driver-class>
<driver-properties>
<property name= "user " value= "test "/>
<property name= "password " value= "1234 "/>
</driver-properties>
<maximum-connection-count> 10 </maximum-connection-count>
<house-keeping-test-sql> select sysdate from dual </house-keeping-test-sql>
<jndi-name> jdbc/mydatasource </jndi-name>
<jndi-java.naming.factory.initial> com.caucho.naming.InitialContextFactoryImpl </jndi-java.naming.factory.initial>
<jndi-java.naming.provider.url> localhost:1099 </jndi-java.naming.provider.url>
</proxool>
</something-else-entirely>
在web.xml加入了
<servlet>
<servlet-name> proxoolServletConfigurator </servlet-name>
<servlet-class> org.logicalcobwebs.proxool.configuration.ServletConfigurator </servlet-class>
<init-param>
<param-name> xmlFile </param-name>
<param-value> WEB-INF/src/proxool.xml </param-value>
</init-param>
<load-on-startup> 1 </load-on-startup>
</servlet>
启动Tomcat初始化Proxool时总是报如下错误:
2007-03-12 14:00:11] [INFO ] initialize Log4j over...
[2007-03-12 14:00:11] [INFO ] Proxool 0.9.0RC3 (10-Jan-2007 01:38)
[2007-03-12 14:00:11] [ERROR] JNDI DataSource binding of DBPool pool failed.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.logicalcobwebs.proxool.ProxoolFacade.registerDataSource(ProxoolFacade.java:780)
at org.logicalcobwebs.proxool.ProxoolFacade.registerConnectionPool(ProxoolFacade.java:116)
at org.logicalcobwebs.proxool.ProxoolFacade.registerConnectionPool(ProxoolFacade.java:97)
at org.logicalcobwebs.proxool.ProxoolFacade.registerConnectionPool(ProxoolFacade.java:69)
at org.logicalcobwebs.proxool.configuration.XMLConfigurator.endElement(XMLConfigurator.java:196)
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 org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:87)
at org.logicalcobwebs.proxool.configuration.JAXPConfigurator.configure(JAXPConfigurator.java:56)
at org.logicalcobwebs.proxool.configuration.ServletConfigurator.init(ServletConfigurator.java:120)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by: org.logicalcobwebs.proxool.ProxoolException: JNDI binding of DataSource for alias DBPool failed.
at org.logicalcobwebs.proxool.admin.jndi.ProxoolJNDIHelper.registerDatasource(ProxoolJNDIHelper.java:42)
... 48 more
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.bind(NamingContext.java:842)
at org.apache.naming.NamingContext.rebind(NamingContext.java:207)
at org.apache.naming.NamingContext.rebind(NamingContext.java:222)
at org.apache.naming.SelectorContext.rebind(SelectorContext.java:206)
at javax.naming.InitialContext.rebind(InitialContext.java:367)
at org.logicalcobwebs.proxool.admin.jndi.ProxoolJNDIHelper.registerDatasource(ProxoolJNDIHelper.java:40)
... 48 more
我现在也不知道哪里配错了,望大侠赐教~~
[解决办法]
配置文件放到 web.xml里面啊 你那 Proxool.xml 不需要
[解决办法]
jndi好象要定义到server.xml中
[解决办法]
就是啊,等待答案啊!
[解决办法]
jndi不能配到这里面吧???
[解决办法]
<param-value> WEB-INF/src/proxool.xml </param-value>