Quantcast

Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

AshutoshSingh
This post has NOT been accepted by the mailing list yet.
Hi All,

I am running a sample POC and trying to fetch records from Oracle 11g XE database. This db is installed on local server.

I configured context.xml as guided in the "770-005 OpenESB Standalone Database connection.pdf" (link given below)

http://open-esb.net/files/OpenESB%20Documents/Pymma/rt@!&%60%60WERTO/770-005%20OE%20Database%20connection%20with%20JNDI%20.pdf

JNDI name is given as "jdbc_localDB".

However my test case is failing with below error.

"   Caused by: Error occured while looking up jndi resource with jndi name.
   Caused by: Name [jdbc_localDB] is not bound in this Context. Unable to find [jdbc_localDB].</
"
I am attaching my configuration and context.xml file, error details and my configuration.

It will be great help if someone can analyze and let me know what configuration is missing from my side.

My server is OpenESB SE version 3.0.5.

Thanks<nabble_a href="context.xml">context.xmlConfiguration_Details.docx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

AshutoshSingh
This post has NOT been accepted by the mailing list yet.
Attaching zip version of context.xmlcontext.zip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

Paul Perez
Administrator
Hello AshutoshSingh

At the first glance the way you work seems correct.  but the JMDI in not is you OpenESB context.The first thing you have to check is your instance log file OE-HOME/OE-INSTANCE/logs/server.log
Stop your instance OpenESB delete your log file restart you instance and analyse the log. The connection to your database and the JNDI name are defined when the instance start.
You will see easily if the JNDI name has been well defined.

Then let us know

regards

Paul
www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

AshutoshSingh
This post has NOT been accepted by the mailing list yet.
Hello Paul,

Thanks for the guidance. I checked the logs. Looks like following are the culprits.

"
2016-04-01T08:26:00.689+0530 INFO [net.openesb.standalone.naming.jndi.AbstractContextFactory] (main) OESE-1406: Loading context from C:\OpenESB\OE-Instance\config\context.xml.
2016-04-01T08:26:00.705+0530 INFO [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1502: Trying to create datasource OracleThin
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property driverType not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING
[net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property databaseName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property portNumber not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property serverName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property password not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property user not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 INFO [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1506: Datasource properties have been settled for OracleThin
2016-04-01T08:26:00.845+0530 SEVERE [org.apache.tomcat.jdbc.pool.ConnectionPool] (main) Unable to create initial connections of pool.
java.sql.SQLException: DataSource is of unknown class:class oracle.jdbc.OracleDriver

        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:236)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
"

Now my doubt is how do I know that what are the properties to be used to connect to OracleThin Driver as I am getting errors like "property databaseName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)"?

Secondly  I got the error of "java.sql.SQLException: DataSource is of unknown class:class oracle.jdbc.OracleDriver". If Driver class is not correct for OracleThin then how to do I get the correct driver class. This value I got from the connection i created from OpenESB Studio.

Thanks,
Ashutosh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

vishnu.piskala

Hi Ashutosh

 

You are using oracle.jdbc.OracleDriver. This class does not support DataSource implementation. Please use oracle.jdbc.pool.OracleDataSource

 

https://docs.oracle.com/cd/E18283_01/appdev.112/e13995/oracle/jdbc/pool/OracleDataSource.html

 

Regards

Vishnu

 

From: AshutoshSingh [via OpenESB Community Forum] [mailto:[hidden email]]
Sent: 01 April 2016 08:41
To: vishnu.piskala
Subject: Re: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

 

Hello Paul,

Thanks for the guidance. I checked the logs. Looks like following are the culprits.

"
2016-04-01T08:26:00.689+0530 INFO [net.openesb.standalone.naming.jndi.AbstractContextFactory] (main) OESE-1406: Loading context from C:\OpenESB\OE-Instance\config\context.xml.
2016-04-01T08:26:00.705+0530 INFO [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1502: Trying to create datasource OracleThin
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property driverType not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING
[net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property databaseName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property portNumber not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property serverName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property password not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 WARNING [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1507: Datasource property user not found for datasource OracleThin (in oracle.jdbc.OracleDriver)
2016-04-01T08:26:00.814+0530 INFO [net.openesb.standalone.naming.jndi.ds.tomcat.TomcatDataSourcePoolFactory] (main) OESE-1506: Datasource properties have been settled for OracleThin
2016-04-01T08:26:00.845+0530 SEVERE [org.apache.tomcat.jdbc.pool.ConnectionPool] (main) Unable to create initial connections of pool.
java.sql.SQLException: DataSource is of unknown class:class oracle.jdbc.OracleDriver

        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:236)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
"

Now my doubt is how do I know that what are the properties to be used to connect to OracleThin Driver as I am getting errors like "property databaseName not found for datasource OracleThin (in oracle.jdbc.OracleDriver)"?

Secondly  I got the error of "java.sql.SQLException: DataSource is of unknown class:class oracle.jdbc.OracleDriver". If Driver class is not correct for OracleThin then how to do I get the correct driver class. This value I got from the connection i created from OpenESB Studio.

Thanks,
Ashutosh


To start a new topic under OpenESB Community Forum, email [hidden email]
To unsubscribe from OpenESB Community Forum, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

AshutoshSingh
This post has NOT been accepted by the mailing list yet.
Yes Vishnu, You are right. I just now de-compiled ojdbc7.jar to check if given class file exists or not. Found that it does not exist. Correct class will be as you mentioned "oracle.jdbc.pool.OracleDataSource". After checking the code of OracleDataSource.class file, I could see all properties which it supports.

So I found that there is no issue with the properties I am passing. Issue is with the datasource-classname. After I updated it to "oracle.jdbc.pool.OracleDataSource", I got the adapter working.

Thanks all for your support.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Database Adapter Issue: "Error occured while looking up jndi resource with jndi name"

marcelo.moscoso
This post has NOT been accepted by the mailing list yet.

I solved the problem with sqlserver and mysql:

<?xml version="1.0" encoding="UTF-8"?>

<context xmlns="http://www.open-esb.net/standalone/jndi/">
   
    <dataSource-pool-properties>
        <dbConnector-name>MSSQLPoll</dbConnector-name>
        <datasource-classname>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-classname>       
        <resource-type>Datasource</resource-type>
        <database-name>Microsoft SQL Server</database-name>       
        <database-vendor>MS</database-vendor>
        <database-version>12.02</database-version>               
        <dbconnector-description>DBConnector for SQL</dbconnector-description>
        <dataSource-properties>
            <property>
                <name>dataSourceURL</name>
                <value>jdbc:sqlserver://192.168.0.103:1441;databaseName=integracion_esb;user=sa;password=123456</value>
                <description>URL value for MSSLQ Connection </description>
            </property>
        </dataSource-properties>
        <pool-properties>
            <property>
                <name>initialSize</name>
                <value>1</value>
                <description></description>
            </property>
            <property>
                <name>maxActive</name>
                <value>50</value>
                <description></description>
            </property>
            <property>
                <name>maxIdle</name>
                <value>2</value>
                <description></description>
            </property>
            <property>
                <name>minIdle</name>
                <value>2</value>
                <description></description>
            </property>
        </pool-properties>
    </dataSource-pool-properties>
       
        <dataSource-pool-properties>
        <dbConnector-name>MYSQLPoll</dbConnector-name>
        <datasource-classname>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</datasource-classname>
        <resource-type>Datasource</resource-type>
        <database-name>MYSQL</database-name>
        <database-vendor>Oracle</database-vendor>
        <database-version>5.6</database-version>
        <dbconnector-description>DBConnector for MySQL</dbconnector-description>
        <dataSource-properties>
            <property>
                <name>user</name>
                <value>intra</value>
                <description></description>
            </property>
            <property>
                <name>password</name>
                <value>intranet</value>
                <description></description>
            </property>
            <property>
                <name>hostName</name>
                <value>192.168.0.101</value>
                <description></description>
            </property>
            <property>
                <name>port</name>
                <value>3306</value>
                <description></description>
            </property>
            <property>
                <name>databaseName</name>
                <value>intranet</value>
                <description></description>
            </property>
        </dataSource-properties>
        <pool-properties>
            <property>
                <name>initialSize</name>
                <value>11</value>
                <description></description>
            </property>
            <property>
                <name>maxActive</name>
                <value>20</value>
                <description></description>
            </property>
            <property>
                <name>maxIdle</name>
                <value>11</value>
                <description></description>
            </property>
            <property>
                <name>minIdle</name>
                <value>10</value>
                <description></description>
            </property>
        </pool-properties>
    </dataSource-pool-properties>

       
        <jdbc-resources>
                <dbConnector-name>MYSQLPoll</dbConnector-name>
                <jndi-name>mysqljndi</jndi-name>
                <description>Datasource connection to MySQL</description>
        </jdbc-resources>
       
        <jdbc-resources>
        <dbConnector-name>MSSQLPoll</dbConnector-name>
        <jndi-name>integration_esb</jndi-name>
        <description>Datasource connection to MSSQL</description>
    </jdbc-resources>
   
</context>


---------------------------------
1.- copy drive : D:\marcelomos\programas\OpenESB-SE-3.0.5\OE-Instance\lib\ext
2.- set CA config-extention : DB_02
3. sun-database-binding  application contiguration : DB_02 and jndi_name
4.-bepl wsdl : jndiName




Loading...