Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

JNDI data source mkt connection could not be obtained

SA-69698

Summary



DataSource error occurs on Tomcat post installing Pega Marketing 8.1.and creating the DataSource to generate the externalmktData database.


Error Messages



The below errors occur: 
  • The DataSource jdbc/mktDataSource is invalid: Unable to obtain DataSource object: code: <none> SQLState: Name [jdbc/mktDataSource] is not bound in this Context. Unable to find [jdbc]. Message: <none>
     
  • DatabaseException caused by prior exception: javax.naming.NameNotFoundException: Name [jdbc/mktDataSource] is not bound in this Context. Unable to find [jdbc].
     
  • The DataSource jdbc/mktDataSource is invalid: A connection could not be obtained.


Steps to Reproduce



In the context.xml, add the following to create the data source. <Resource
name="jdbc/mktDataSource" auth="Container"
type="javax.sql.DataSource"



Root Cause



To use JDBC connection pooling to connect to the external database, the JNDI name must be specified. The required syntax for the JNDI name is java:comp/env/jdbc/<DataSource>.

However, in this use case, it was set as: "jdbc/mktDataSource".


Resolution



Perform the following local-change:
Replace <Data Source> with the name of the resource set in the config.xml file on the application server.

In the below image, the data source is set to mktDataSource.


Suggest Edit

Published December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us