org.jboss.util.naming.NonSerializableFactory causes JNDI lookup failure
-----------------------------------------------------------------------
Key: JBCOMMON-93
URL:
https://jira.jboss.org/jira/browse/JBCOMMON-93
Project: JBoss Common
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: common-core (2.x)
Affects Versions: 2.2.15.GA, 2.2.14.GA
Reporter: Alan Feng
The problem was discovered when using JBoss Cache. When including JBoss Cache in the
custom application EAR/lib, jboss-common-core.jar is also included as a dependent JAR
file. However, the org.jboss.util.naming.NonSerializableFactory class in the
jboss-common-core.jar is causing JNDI lookup failures (returning NULL while the object
exists in the JNDI tree).
What happened, from tracing into the code, is:
When invoking InitialContext.lookup() method, the
org.jboss.util.naming.NonSerializableFactory class is automatically used as the factory
class to lookup object from the JNDI tree with the "getObjectInstance" method.
However, its internal "wrapperMap" property is empty, never filled with any JNDI
objects. Therefore, the lookup always returns NULL even when the object exists.
I consider the problem is with the org.jboss.util.naming.NonSerializableFactory class in
the JBoss Common project because this problem will occur when:
- The custom EAR uses scoped deployment
- The org.jboss.util.naming.NonSerializableFactory is in the EAR's classpath (such as
including the jboss-common-core.jar file in the EAR/lib folder)
In other words, the jboss-common-core.jar can not be included in individual EAR file.
Please note that there is another NonSerializableFactory class which is in a different
package "org.jboss.naming", that class has nothing to do with this problem.
I'll attach a sample EAR to demonstrate the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira