Hi,
I am using juddi-tomcat-2.0rc7 with its embedded tomcat server + mySql.
I have edited the server.xml file which is located at
$CATALINA_HOME\conf\server.xml and append the following to the file,
immediately above the </Host> tag according to the start guide:
<Context path="/juddi" docBase="juddi"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_juddiDB_log" suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="123456" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/juddi?autoReconnect=true"/>
</Context>
Also, I have modified $CATALINA_HOME\conf\Catalina\localhost\juddi.xml as
following:
<Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" username="root"
password="123456"
driverClassName=" com.mysql.jdbc.Driver "
url="jdbc:mysql://localhost/juddi ">
</Resource>
And, the $CATALINA_HOME\webapps\juddi\WEB-INF\ juddi.properties is modified
as following:
# jUDDI DataSource to use
juddi.isUseDataSource=true
#juddi.dataSource=java:comp/env/juddiDB
juddi.dataSource=jdbc/juddiDB
# straight JDBC
juddi.jdbcDriver=com.mysql.jdbc.Driver
juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
#juddi.jdbcUsername=juddi
#juddi.jdbcPassword=juddi
But after I start the tomcat server , I have Problems of acquiring a JDBC
DataSource from JNDI. the juddi.log's information is as following:
2009-07-03 15:59:07,093 INFO [org.apache.juddi.registry.RegistryServlet] -
Initializing jUDDI components.
2009-07-03 15:59:07,343 INFO [org.apache.juddi.util.jdbc.ConnectionManager]
- Using JNDI to aquire a JDBC DataSource with name: jdbc/juddiDB
2009-07-03 15:59:07,343 ERROR [org.apache.juddi.util.jdbc.ConnectionManager]
- Exception occurred while attempting to acquire a JDBC DataSource from
JNDI: Name jdbc is not bound in this Context
2009-07-03 15:59:07,343 ERROR [org.apache.juddi.registry.RegistryEngine] -
Could not create jUDDI database null
java.lang.NullPointerException
at
org.apache.juddi.registry.RegistryEngine.initializeDatabase(RegistryEngine.java:253)
at org.apache.juddi.registry.RegistryEngine.init(RegistryEngine.java:196)
at org.apache.juddi.registry.RegistryServlet.init(RegistryServlet.java:182)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2009-07-03 15:59:25,843 INFO [org.apache.juddi.util.jdbc.ConnectionManager]
- Using JNDI to aquire a JDBC DataSource with name: jdbc/juddiDB
2009-07-03 15:59:25,843 ERROR [org.apache.juddi.util.jdbc.ConnectionManager]
- Exception occurred while attempting to acquire a JDBC DataSource from
JNDI: Name jdbc is not bound in this Context
2009-07-03 15:59:25,843 ERROR [org.apache.juddi.registry.RegistryEngine] -
Could not create jUDDI database null
java.lang.NullPointerException
at
org.apache.juddi.registry.RegistryEngine.initializeDatabase(RegistryEngine.java:253)
at org.apache.juddi.registry.RegistryEngine.init(RegistryEngine.java:196)
at org.apache.jsp.happyjuddi_jsp._jspService(happyjuddi_jsp.java:219)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Can anyone help me this?
Thanks.
sara
--
View this message in context:
http://www.nabble.com/Problems-of-acquiring-a-JDBC-DataSource-from-JNDI-tp24323043p24323043.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
opensubscriber is not affiliated with the authors of this message nor responsible for its content.