Sunday, August 9, 2009

CannotInstantiateObjectException

ConnectionFac E J2CA0106E: A 5.0 DataSource was attempted to be used in a WebModule that was not level 2.3.
W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jdbc/client" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl
Reference Factory Class Location URLs:

Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.Exception: Attempted to use a 5.0 DataSource outside of a 2.3 servlet
Cause:

As it explains clearly, trying to use servlet 2.3 under 2.2 dtd defintion.

Solution:

Replace Doctype declartion in web.xml
from

DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.
//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"

to

DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.
//DTD Web Application 2.3//EN" 
"http://java.sun.com/dtd/web-app_2_3.dtd"

No comments:

Post a Comment