Uploaded image for project: 'JBoss Common'
  1. JBoss Common
  2. JBCOMMON-93

org.jboss.util.naming.NonSerializableFactory causes JNDI lookup failure

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.14.GA, 2.2.15.GA
    • Fix Version/s: None
    • Component/s: common-core (2.x)
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Remove this class from the jboss-common-core.jar file will fix the problem.

      Show
      Remove this class from the jboss-common-core.jar file will fix the problem.

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                alllle Alan Feng
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: