[jboss-jira] [JBoss JIRA] Updated: (JBCOMMON-93) org.jboss.util.naming.NonSerializableFactory causes JNDI lookup failure

Alan Feng (JIRA) jira-events at lists.jboss.org
Tue Sep 29 15:21:49 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBCOMMON-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Feng updated JBCOMMON-93:
------------------------------

    Attachment: jboss-test.ear.zip


This simple EAR contains the org.jboss.util.naming.NonSerializableFactory class in the classpath of the included WAR file. It looksup the default "java:/DefaultDS" DataSource and prints a message to the System.out whether the lookup is successful or not.

Because the described problem, the lookup will fail. However, removing the mentioned class from the classpath will make the lookup succeed. 

> 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.14.GA, 2.2.15.GA
>            Reporter: Alan Feng
>         Attachments: jboss-test.ear.zip
>
>
> 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

        



More information about the jboss-jira mailing list