on 02-26-2008 8:19 PM
I've created a JDBC data source with an alias, a/datasource. The alias shows up in the JNDI registry under /jdbc/a/datasource. In ejb-jar.xml, I have this:
<resource-ref>
<res-ref-name>jdbc/DefaultResourceRef</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Then, in ejb-j2ee-engine.xml, I have this:
<resource-ref>
<res-ref-name>jdbc/DefaultResourceRef</res-ref-name>
<res-link>jdbc/a/datasource</res-link>
</resource-ref>
Yet, when I execute this code:
ctx.lookup( "java:comp/env/jdbc/DefaultResourceRef");
I get an exception, with the core cause as follows::
Caused by: com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "jdbc/a/datasource" does not exist. Possible reasons: the connector in which ConnectionFactory "jdbc/a/datasource" is defined is not deployed or not started.
The JDBC connection is indeed functioning, and if I directly fetch jdbc/a/datasource, it works just fine.
What am I doing wrong?
Sometimes the datasource will go to not available state.you can start it using NWA. URL http://<nwserver>:50000/nwa
Slecect Configuration management>Infrastructure>application Resources.
Choose start and Stop Java EE Applications.
After opening this window search for your JDBC Connecter xml and choose start.
for example JDBCConnector_MYSQLDB_DS1.xml.
MYSQLDB_DS1 is my data source.
Sampath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the fallowing code.
DATASOURCENAME = "jdbc/MYSQLDB_DS1_ALIAS1"
ctx.lookup( DATASOURCENAME);
Go through this [blog|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8675] [original link is broken] [original link is broken] [original link is broken];
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.