|
Problem(Abstract) |
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:
- Add a J2C authentication data alias entry to match the one defined for
the com.ibm.mapping.authDataAlias of the ibm-web-bnd.xmi.
- 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.
 |
|