[Ds-java-dev] [jira] Resolved: (DS-286) Cannot connect to a JNDIDatasource
sumedha rubasinghe (JIRA)
jira at wso2.org
Wed Sep 10 20:07:42 PDT 2008
[ https://wso2.org/jira/browse/DS-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
sumedha rubasinghe resolved DS-286.
-----------------------------------
Resolution: Fixed
Fixed.
See my tutorial http://wso2.org/blog/sumedha/4081.
> Cannot connect to a JNDIDatasource
> ----------------------------------
>
> Key: DS-286
> URL: https://wso2.org/jira/browse/DS-286
> Project: WSO2 Data Services
> Issue Type: Bug
> Components: core
> Affects Versions: 1.0-beta10
> Environment: jboss 4.2.2 GA, jdk15, winxp
> Reporter: Charitha Kankanamge
> Assignee: sumedha rubasinghe
> Priority: Blocker
> Fix For: 1.0
>
> Attachments: JNDIDS.dbs
>
>
> I have configured a mysql datasource in JBOSS by copying a mysql-ds.xml in to ./server/default/deploy directory.
> <?xml version="1.0" encoding="UTF-8"?>
> <datasources>
> <local-tx-datasource>
>
> <jndi-name>MySqlDS</jndi-name>
>
> <connection-url>jdbc:mysql://localhost:3306/employee</connection-url>
> <driver-class>com.mysql.jdbc.Driver</driver-class>
>
> <user-name>root</user-name>
> <password></password>
>
> <connection-property name="autoReconnect">true</connection-property>
>
> <!-- Typemapping for JBoss 4.0 -->
> <metadata>
> <type-mapping>mySQL</type-mapping>
> </metadata>
>
> </local-tx-datasource>
> </datasources>
> When I restarted jboss, I saw the following message in console. (Therefore I think jndi datasource is bound properly)
> 11:07:05,687 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySqlDS' to JNDI name 'java:MySqlDS'
> Then I created a jndi data service and deployed. It deploys as a faulty service with the following exception.
> ERROR - Naming error occurred while trying to retrieve JDBC Connection from JNDI tree. {org.wso2.ws.dataservice.JNDIUtils}
> javax.naming.NameNotFoundException: MySqlDS not bound
> at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
> at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
> at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
> at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
> 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> at sun.rmi.transport.Transport$1.run(Transport.java:153)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
> at java.lang.Thread.run(Thread.java:595)
> at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
> at javax.naming.InitialContext.lookup(InitialContext.java:351)
> at org.wso2.ws.dataservice.JNDIUtils.getJNDIResource(JNDIUtils.java:95)
> at org.wso2.ws.dataservice.JNDIUtils.getDataSource(JNDIUtils.java:67)
> at org.wso2.ws.dataservice.DBDeployer.createDBService(DBDeployer.java:297)
> at org.wso2.ws.dataservice.DBDeployer.processService(DBDeployer.java:828)
> at org.wso2.ws.dataservice.DBDeployer.deploy(DBDeployer.java:130)
> at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
> at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
> at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
> at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
> at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
> at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324)
> at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64)
> at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71)
> at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> [2008-08-20 10:50:14,562] ERROR - The JNDIDS.dbs service, which is not valid, caused Naming error occurred while trying to retrieve JDBC Connection from JNDI tree. {org.wso2.ws.da
> taservice.DBDeployer}
> org.apache.axis2.AxisFault: Naming error occurred while trying to retrieve JDBC Connection from JNDI tree.
> at org.wso2.ws.dataservice.JNDIUtils.getDataSource(JNDIUtils.java:78)
> at org.wso2.ws.dataservice.DBDeployer.createDBService(DBDeployer.java:297)
> at org.wso2.ws.dataservice.DBDeployer.processService(DBDeployer.java:828)
> at org.wso2.ws.dataservice.DBDeployer.deploy(DBDeployer.java:130)
> at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
> at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)
> at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
> at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)
> at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)
> at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324)
> at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64)
> at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71)
> at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: javax.naming.NameNotFoundException: MySqlDS not bound
> at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
> at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
> at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
> at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
> 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
> at sun.rmi.transport.Transport$1.run(Transport.java:153)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
> at java.lang.Thread.run(Thread.java:595)
> at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
> at javax.naming.InitialContext.lookup(InitialContext.java:351)
> at org.wso2.ws.dataservice.JNDIUtils.getJNDIResource(JNDIUtils.java:95)
> at org.wso2.ws.dataservice.JNDIUtils.getDataSource(JNDIUtils.java:67)
> ... 14 more
> [2008-08-20 10:50:14,906] INFO - Trying to re-establish fautly database connection for data services :D:\wso2ds\WSO2-D~1.0-B\bin\..\repository\dataservices\JNDIDS.dbs {org.wso2.w
> s.dataservice.FaultyServiceRectifier}
> [2008-08-20 10:50:15,031] ERROR - Error occured connecting to database using connection pooling manager {org.wso2.ws.dataservice.DBCPConnectionManager}
> java.lang.NullPointerException
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:164)
> at org.wso2.ws.dataservice.DBCPConnectionManager.connectToDB(DBCPConnectionManager.java:80)
> at org.wso2.ws.dataservice.DBCPConnectionManager.<init>(DBCPConnectionManager.java:37)
> at org.wso2.ws.dataservice.DBUtils.initializeDBConnectionManager(DBUtils.java:1329)
> at org.wso2.ws.dataservice.FaultyServiceRectifier.run(FaultyServiceRectifier.java:44)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the Ds-java-dev
mailing list