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

Failed to create table for this segment



Pega 7.3.1 is installed on WebSphere Application Server (WAS) Liberty server.
Pega Marketing is installed on the application.
Error occurs when the 'Use configuration in preferences' option in the ExternalMKT database setting is selected to create a segment.

Error Messages

Error in the UI:

Failed to create table for this segment.

Error in the PegaRULES log file:

egamkt_engine_pegamktutilities) ERROR   - Cannot get DB connection using JNDI lookup javax.naming.NamingException: CWNEN1000E: A JNDI operation on a java:comp/env name cannot be completed because the current thread is not associated with a Java Enterprise Edition application component. This condition can occur when the JNDI client using the java:comp/env name does not occur on the thread of a server application request. Make sure that a Java EE application does not run JNDI operations on java:comp/env names within static code blocks or in threads created by that application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on java:comp/env names.

Steps to Reproduce

  1. Stop the Liberty Server.
  2. Define the jndi/mktDatasource settings in the Liberty profile server.xml file.
  3. In the prconfig.xml file define the Java Naming and Directory Interface (JNDI) settings as below,

    <env name="database/databases/ExternalMKTData/dataSource" value="jdbc/mktDataSource"/> 

  4. Verify the below Pega out-of-the-box Dynamic System Settings (DSS) rule and retain the default. 

  5. Start the server.
  6. Log in to the application.
  7. Open the ExternalMKT Data-Admin-DB-Name rule.
  8. Configure it to use 'Use configuration in preferences' and save it.
  9. Log in to the Pega Marketing portal.
  10. Create an audience (segment rule).

Root Cause

The mktDatasource fetches the DSS value when 'Use configuration in preferences' is selected.
The error occurs due mismatch of the prconfig.xml and DSS values.


It is recommended to use JDBC Pool connection.

For information about the usage of JDBC Pool Connection, refer to:

Perform the following local-change to maintain the prconfig.xml file:

  1. Edit the DSS.

  2. Set the value to jndi/mktDatasource instead of java:comp/jndi/mktDatasource

Published January 4, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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