[jboss-user] [JNDI and Naming] - Connecting DataSource in JBOSS 6 from outside the container or standalone java client

Samir PAtil do-not-reply at jboss.com
Tue Feb 5 07:12:12 EST 2013


Samir PAtil [https://community.jboss.org/people/samir.patil] created the discussion

"Connecting DataSource in JBOSS 6 from outside the container or standalone java client"

To view the discussion, visit: https://community.jboss.org/message/796127#796127

--------------------------------------------------------------
Hi All,

We are using JBOSS 6, and Spring 3.0.8 and Hibernate.  We are using following configuration to connect to database with war application file for connecting to database.  The below works fine
<jee:jndi-lookup id="dataSource" jndi-name="jboss/clrt"/>.

But now we have a requirement which requires standalone program to be run as client which need to connect datasource through jndi. We are unable to connect to database with above configuration.  We tried some of the below configuration but that too didn't work. It gives error java.net.sockettimeoutexception receive timed out while connecting to datasource.

Please can anyone help us to resolve this issue. Also can any one confirm are we using right configuration of jndi i/p and port address for connecting datasource configured with jboss.

|  | <jee:jndi-lookup id="dataSource" jndi-name="jboss/clrt"> |
|  |  |  <jee:environment> |
|  |  |  java.naming.provider.url=jnp://localhost:4447 |
|  |  |  java.naming.factory.url.pkgs=org.jnp.interfaces:org.jboss.naming |
|  |  |  java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory |
|  |  |  </jee:environment> |
|  | </jee:jndi-lookup> |

|  | <jee:jndi-lookup id="dataSource" jndi-name="jboss/clrt"> |
|  |  |  <jee:environment> |
|  |  |  java.naming.provider.url=jnp://localhost:1099 |
|  |  |  java.naming.factory.url.pkgs=org.jnp.interfaces:org.jboss.naming |
|  |  |  java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory |
|  |  |  </jee:environment> |
|  | </jee:jndi-lookup> |

Thanks
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796127#796127]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130205/e8bbc6d7/attachment.html 


More information about the jboss-user mailing list