cancel
Showing results for 
Search instead for 
Did you mean: 

JNDI connection factory not deployed or not started?

0 Kudos

I am deploying our J2EE application which accesses a custom data-source using JNDI. I am getting following error while deploying our ear file.

 Invocation of in
it method failed; nested exception is javax.naming.NamingException: Exception during lookup operation of object with name webContainer/applications/JavaEE/xxxxxx-xx-EAR/xxxxxxxx-xx/java:comp/env/jdbc/myCustomDS, cannot resolve object reference. [Root exception is com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "jdbc/myCustomDS" does not exist. Possible reaso
ns: the adapter in which ConnectionFactory "jdbc/myCustomDS" is defined is not deployed or not started.]]

I have defined myCustomDS and I can see it in JNDI browser.

Could you please help me what am I missing?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I was able to resolve the issue. Posting here for information. To resolve the issue, we need to refer custom datasource without /jdbc.

I.e in our web.xml used

<resource-ref>
    <description>Private DataSource</description>
    <res-ref-name>myCustomDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

And while accessing the data-source in application used java:comp/env/myCustomDS

Answers (1)

Answers (1)

oppancs
Contributor
0 Kudos

Dear Sanket,


The exception refers to that the DataSource Aliases is not defined correctly in your application server. Please try the followings:


1. Open Config Tool "LocalDrive:\usr\sap\<SID>\<instnr>\j2ee\configtool".
2. Navigate to template -> cluster-data -> instance -> services -> dbpool.
3. Check if the value of sysDS-dataSourceName is the same as described in the exception. If it is different, set the correct one as custom value.
4. The same should be set in template level: Navigate to template -> cluster-data -> services -> dbpool -> set the custom value if necessary.
5. Save Config Tool.
6. Restart the whole cluster (not only the affected instance).


If it does not help you should remove the value of sys.DS.additionalProperties parameter:


1. Open Config Tool "LocalDrive:\usr\sap\<SID>\<instnr>\j2ee\configtool".
2. Navigate to template -> cluster-data -> instance -> services -> dbpool.
3. Remove the value of sys.DS.additionalProperties.
4. The same should be done in template level: Navigate to template -> cluster-data -> services -> dbpool -> Remove the value of sys.DS.additionalProperties.
5. Save Config Tool.
6. Restart the whole cluster (not only the affected instance).


Best Regards,
Barnabás Paksi