Discussion:
[jboss-user] [JNDI and Naming] - Connecting DataSource in JBOSS 6 from outside the container or standalone java client
Samir PAtil
2013-02-05 12:12:12 UTC
Permalink
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]
Wolf-Dieter Fink
2013-02-05 20:03:59 UTC
Permalink
Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

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

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

--------------------------------------------------------------
In AS5 or 4 there was a configuration attribute to be able to use the DS via remote access. But in general this is not a good idea for many reasons and not longer supported in AS7 (don't know whether it will be in AS6)
--------------------------------------------------------------

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

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