IBM Support

J2CA0009E: An exception occurred while trying to instantiate the ManagedConnectionFactory class

Troubleshooting


Problem

An EAR was deployed to WebSphere Application Server that was previously used on WebSphere Application Server V5.0 or V5.1 and that uses a data source without going through the migration process in the WebSphere Information Center. When the EJB that used that data source was executed on WebSphere Application Server, the result was a J2CA0009E error due to a NoSuchMethodException. However, using the test connection for the data source in WebSphere Application Server functions properly. In addition to the J2CA009E, a NMSV0605W will be logged in the SystemOut.log

Cause

If one includes the connector.jar file from WebSphere Application Server V5.0 or V5.1 in an EAR file, and then deploys that EAR file WebSphere Application Server, then this causes the incorrect classes (the ones from the connector.jar in the ear) to be loaded and results in the J2CA0009E.

The reason that the java.lang.NoSuchMethodException is thrown is that the required method is not in the connector.jar.


java.lang.NoSuchMethodException: com.ibm.ejs.j2c.DefaultSecurityHelper.<init>
(javax.resource.spi.ManagedConnectionFactory, com.ibm.ejs.j2c.MCFExtendedProperties)

This exception indicates that there was no constructor for com.ibm.ejs.j2c.DefaultSecurityHelper that expected the two parameters ManagedConnectionFactory and MCFExtendedProperties.

This problem can happen when developing an application with an IDE, such as IBM Rational Application Developer. If one resolves missing jars by including them in the ear versus adding them to the classpath, then this problem may result.

This is what will be logged in the SystemOut.log file


[10/17/05 15:06:29:471 EDT] 0000003b ConnectionFac E J2CA0009E: An exception occurred while trying to instantiate the ManagedConnectionFactory class com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jdbc/AUE : java.lang.NoSuchMethodException: com.ibm.ejs.j2c.DefaultSecurityHelper.<init>(javax.resource.spi.ManagedConnectionFactory, com.ibm.ejs.j2c.MCFExtendedProperties)
at java.lang.Class.getConstructor1(Class.java(Compiled Code))
at java.lang.Class.getConstructor(Class.java:1124)
at com.ibm.ejs.j2c.J2CUtilityClass.createSecurityHelper
(J2CUtilityClass.java:1244)
at com.ibm.ejs.j2c.J2CUtilityClass.createMCFEntry
(J2CUtilityClass.java:650)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderServerImpl.createMCFandPM
(ConnectionFactoryBuilderServerImpl.java:528)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderServerImpl.processObjectInstance
(ConnectionFactoryBuilderServerImpl.java:867)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance
(ConnectionFactoryBuilderImpl.java:557)
at javax.naming.spi.NamingManager.getObjectInstance
(NamingManager.java:314)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt
(Helpers.java:874)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup
(Helpers.java:681)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults
(CNContextImpl.java:1937)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup
(CNContextImpl.java:1792)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup
(CNContextImpl.java:1707)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt
(CNContextImpl.java:1412)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup
(CNContextImpl.java:1290)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.trilogy.ibm.persistence.DataSourceConnectionFactory.getConnection
(DataSourceConnectionFactory.java:96)
at com.trilogy.ibm.healthcheck.DBCheck.DBConnectionCheck(DBCheck.java:38)
at com.trilogy.ibm.healthcheck.HealthCheckServlet.checkStatus
(HealthCheckServlet.java:125)
at com.trilogy.ibm.healthcheck.HealthCheckServlet.doGet
(HealthCheckServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

[10/17/05 15:06:29:645 EDT] 0000003b Helpers W NMSV0605W: A Reference object looked up from the context "WASCELL/nodes/WASNODE/servers/aue" with the name "jdbc/AUE" was sent to the JNDI Naming Manager and an exception resulted. Reference data

Resolving The Problem

Remove the connector.jar file from the EAR file that is deployed to WebSphere Application Server and re-deploy the EAR.

See the WebSphere Application Server Information Center for details on migrating applications.

Note! This is something that happens on WebSphere Studio Application Developer/IBM Rational Application Developer where a person can incorporate jar files that help them get their application to work but the proper way to do things of this nature is to either create auxiliary libraries in WebSphere or utilize the functionality/methodology intended to be used in the later version of WebSphere.

NOTE! It is always recommended to go through the migration process when moving from one major release to the next. It is always recommended to test any upgrade in a test environment prior to applying it to production.

Related Information

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Deploy (for example: AAT or ANT or EAR\/WAR\/JAR)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF012","label":"IBM i"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Network Deployment","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":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21223233