IBM Support

J2CA0044E occurs on getting a database connection

Troubleshooting


Problem

The Test Connection to the data source works successfully but the web application fails on getting the connection to the data source with error J2CA0044E in SystemOut.log.

Symptom

Excerpt of the error from SystemOut.log:


[5/29/06 6:27:56:672 CST] 0000002c WSDefaultPrin W   SECJ4062W: Cannot find the credential information.
[5/29/06 6:27:56:766 CST] 0000002c PrivExAction  E   J2CA0044E: The ConnectionManager failed to get a Subject from the security service associated with connection factory jdbc/test_Con3. Received exception javax.security.auth.login.LoginException: Incorrect authDataEntry
at com.ibm.ws.security.auth.j2c.WSDefaultPrincipalMapping.getMappedSubject(WSDefaultPrincipalMapping.java:314)
at com.ibm.ejs.j2c.PrivExAction.run(PrivExAction.java:140)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ejs.j2c.ConnectionManager.getSubject(ConnectionManager.java:1316)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:551)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:328)

Cause

If a webapp defined a resource reference binding for a data source in its ibm-web-bnd.xmi file, the com.ibm.mapping.authDataAlias must have the value of a configured J2C authentication data alias.

For example, for this resource reference binding, the authDataAlias of wdo_test_Con3 does not exist.


  <resRefBindings xmi:id="ResourceRefBinding_1148588779796" jndiName="jdbc/test_Con3"  
loginConfigurationName="DefaultPrincipalMapping">  
    <bindingResourceRef  href="WEB-INF/web.xml#ResourceRef_1148588779796"/>                  
    <properties xmi:id="Property_1148588779796" name="com.ibm.mapping.authDataAlias" value="wdo_test_Con3"/>
  </resRefBindings>  

Resolving The Problem

There are two solutions to resolve the above error:

  1. Add a J2C authentication data alias entry to match the one defined for the com.ibm.mapping.authDataAlias of the ibm-web-bnd.xmi.
  2. Change the value of the com.ibm.mapping.authDataAlias to match an existing (already defined) J2C authentication alias entry for your data base connection by:
    - Use some IDE tool such as IBM® Rational® Application Developer or the IBM Application Server Toolkit, or
    - Set the name to the correct value during the deployment of the application or after the application is deployed to WebSphere Application Server.

    Here is the example that shows you how to set the correct value after the application has been deployed to WebSphere® Application Server using WebSphere Administrative Console:
    Enterprise Applications > ApplicationName > Map resource references to resources
    In the section Specify authentication method:
    • Click the Use default method button.
    • Select the desired authentication data entry from the pull-down list
    • Click Apply

    You may need to restart the application for the change to take effect.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java 2 Connectivity (J2C)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0","Edition":"Advanced;Base;Developer;Express","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21246549