[jboss-user] [JBoss Portal Development] - Can not get JNDI connection from Data sourceSQLState with oracle 10g
raju k
do-not-reply at jboss.com
Fri Jun 4 10:04:51 EDT 2010
raju k [http://community.jboss.org/people/komariraj] created the discussion
"Can not get JNDI connection from Data sourceSQLState with oracle 10g"
To view the discussion, visit: http://community.jboss.org/message/546225#546225
--------------------------------------------------------------
Hi all
i am using jboss portal 2.6.8 server with oracle 10g..
i am getting follwing exception when creating datasource object for Oracle 10g using JNDI.
*Can not get JNDI connection from Data sourceSQLState: null Vendor Code: 0 Could not create connection; - nested throwable: (java.lang.NullPointerException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.NullPointerException))*
*step-1: portal-oracle-ds.xml*
<datasources>
<local-tx-datasource>
<jndi-name>jndiname</jndi-name>
<connection-url>jdbc:oracle:thin:@server:orcl</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>user</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
I copied this xml file in to deploy folder of jboss.
*s**tep: 2* classes12.jar copied in my war file lib only
*
*
*step-3*: in my java code ...
line-1: InitialContext initialContext = new InitialContext();
line-2: DataSource dataSource = (DataSource)initialContext.lookup("java:/jndiname");
line-3: java.sql.Connection dbconnection = dataSource.getConnection();
when ever i am executing line-3, getting above exception...
if any body knows about this problam , please help...
Thanks in advance..
Raju.K
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546225#546225]
Start a new discussion in JBoss Portal Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2014]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100604/4d542d89/attachment-0001.html
More information about the jboss-user
mailing list