cancel
Showing results for 
Search instead for 
Did you mean: 

DataSource name in persistent.xml gives error

Former Member
0 Kudos

Hi,

I'm getting the error:Application cannot be started: It has hard reference to resource jdbc/ds1 with type javax.sql.DataSource, which is not active on the server.

I do have a JDBC Connector with that name (jdbc/ds1), I also have a reference in the JNDI Registry with that name, but it seems to be looking in the registry for the fully-qualified reference ejbContainer/cmp/tx/sap.com/myApp/jdbc/ds1. If I change the Datasource name to java:comp/env/jdbc/ds1 it doesn't work either. What should I be using for the DataSource name?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ashley,

did you create a Data-Source-Alias in your EAR-projekt?

If not right-click on EAR-projekt, choose New -> META-INF/data-source-aliases.xml

Use the Data-Source name from your persistent.xml.

Hope it helps...

Answers (2)

Answers (2)

Former Member
0 Kudos

No, unfortunately, data-source-alias does not seem to be the answer. My data source is not the default datasource. It doesn't seem to matter what I put in there, I still get the same problem.

I have solved the problem, however, by adding a data-sources.xml to the ear META-INF This creates the JDBC Connection at deploy time...

Thanks for your help - yoou did point me in the right direction!

Former Member
0 Kudos

Hi Ashley,

you have to specify the DataSource name only (not the path to the DataSource reference in the JNDI registry). See also the example in the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/d2/369f1dddb7ff4c96c2bacdd7aa6c87/frameset.htm">docs</a> about the persistent.dtd. In your case this should be <b>ds1</b> only.

It might also be a good idea if your DataSource setup is successful. To do this you can use the telnet administrator of the J2EE Engine and execute the TEST_DS shell command (info about the command<a href="http://help.sap.com/saphelp_nw04/helpdata/en/06/37c8886ccd4759ae64ba831431864a/frameset.htm">here</a>).

Hope that helps!