activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Barrow (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-3974) JNDI lookup for dynamic queues or topics containing slash character: wrong type returned
Date Tue, 14 Aug 2012 20:41:38 GMT

    [ https://issues.apache.org/jira/browse/AMQ-3974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434487#comment-13434487
] 

Christopher Barrow commented on AMQ-3974:
-----------------------------------------

Workaround is to use Session.createQueue (or createTopic) instead of doing the JNDI lookups.
                
> JNDI lookup for dynamic queues or topics containing slash character: wrong type returned
> ----------------------------------------------------------------------------------------
>
>                 Key: AMQ-3974
>                 URL: https://issues.apache.org/jira/browse/AMQ-3974
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.1
>         Environment: Windows7, ActiveMQ 5.5.1
>            Reporter: Christopher Barrow
>            Priority: Minor
>         Attachments: JNDILookup.java
>
>
> If a JNDI lookup is done for a dynamic or topic called "a/b" then another lookup is done
for "a", then the second lookup returns an instance of org.apache.activemq.jndi.ReadOnlyContext
instead of a Queue. Example:
> # Object q1 = context.lookup("dynamicQueues/a/b");
>   This correctly returns a Queue object
> # Object q2 = context.lookup("dynamicQueues/a");
>   This incorrectly returns a ReadOnlyContext object instead of a Queue.
> To reproduce:
> # drop attached file JNDILookup.java into $ACTIVEMQ_HOME/example/src
> # edit build.xml in the example directory to add the following:
> {quote}
>     <target name="jndi" depends="compile" description="Runs JDNI testcase">
>         <echo>Running a Log4j JMS Appender example</echo>
>         <java classname="JNDILookup" fork="yes" maxmemory="100M">
>             <classpath refid="javac.classpath" />
>         </java>
>     </target>
> {quote}
> # run by issuing the command "ant jndi". 
> # Observce that the output is as follows:
> {quote}
> jndi:
>      [echo] Running JNDI testcases
>      [java] wrongObjectTypeFound: ERROR q2 is not a queue, q2=org.apache.activemq.jndi.ReadOnlyContext@7ddf5a8f
>      [java] wrongDestinationFound: ERROR q2 has unexpected name a, expected a/b
> {quote}
> The message starting "wrongObjectTypeFound:" demonstrates the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message