History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: HJMS-56
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Colin Crist
Reporter: Madhusudhan Konda
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
HermesJMS

ClassCastException when searching a MapMessage

Created: 30/Oct/07 11:20 AM   Updated: 19/Dec/07 09:04 AM
Component/s: None
Affects Version/s: 1.12
Fix Version/s: 1.13

Environment: JBossMessaging 1.2.0.GA and JBoss AS 4.0.5.GA with Hermes 1.12


 Description  « Hide
I have a topic with MapMessages which has Surname=Barry as one of he key-value properties.

When I do a search on this topic wiht this search criteria, I get the ClassCastException (org.jboss.jms.destination.JBossTopic)

The log info:
 
2007-10-30 14:08:11,160 [Hermes ThreadPool-3] DEBUG hermes.impl.jms.ThreadLocalSessionManager - session closed, closing its Connection

2007-10-30 14:08:11,160 [Hermes ThreadPool-3] DEBUG hermes.browser.HermesBrowser - Connection JBMSession closed

2007-10-30 14:08:11,160 [Hermes ThreadPool-3] ERROR hermes.browser.tasks.HermesBrowserTaskListener - org.jboss.jms.destination.JBossTopic

java.lang.ClassCastException: org.jboss.jms.destination.JBossTopic

            at hermes.impl.jms.AbstractSessionManager.createBrowser(AbstractSessionManager.java:379)

            at hermes.impl.DefaultHermesImpl.createBrowser(DefaultHermesImpl.java:227)

            at hermes.browser.tasks.BrowseDestinationTask.createBrowser(BrowseDestinationTask.java:109)

            at hermes.browser.tasks.StringSearchBrowseDestinationTask.createBrowser(StringSearchBrowseDestinationTask.java:66)

            at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:141)

            at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)

            at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)

            at java.lang.Thread.run(Thread.java:595)

2007-10-30 14:08:11,192 [Hermes ThreadPool-3] DEBUG hermes.browser.tasks.ThreadPool - task hermes.browser.tasks.StringSearchBrowseDestinationTask@14ee401 stopped

the DEBUG statement suggest that the requestee is queue when in reality is a topic.

Obviously this line (from AbtractSessionManager) throws a class cast exception:

final Queue queue= (Queue) destinationManager.getDestination(getSession(), config.getName(), Domain.QUEUE) ;

I'm not sure why the queue is passed in place of topic, possibly DestinationConfig is populated with wrong info.

//DefaultHermesImpl.java
public QueueBrowser createBrowser(DestinationConfig config) throws JMSException
   {

      Thread.currentThread().setContextClassLoader(contextClassLoader);
      if (config.getDomain() == Domain.TOPIC.getId() && config.isDurable())
      {
         return getAdminAdapter().createDurableSubscriptionBrowser(config);
      }
      else
      {
         return sessionManager.createBrowser(this, config);
      }
   }
I think this is something the way JBM is implementing the destinations.

Thanks
Madhu



 All   Comments   Change History      Sort Order:
Colin Crist [19/Dec/07 07:56 AM]
I've just tested this with jboss-messaging-1.4.0-SP3 and Jboss server 4.2.1GA and I not see the CCE.

I suspect whatever the problem in JBM was has now been fixed - unless you can shed any more light on the problem, I'll close this in a cpl of days.

Colin Crist [19/Dec/07 07:58 AM]
I just realised you said on a topic. I tested with a queue. I can now replicate the problem with a topic.

Colin Crist [19/Dec/07 09:04 AM]
The code had a hardwired reference to the queue domain rather than taking it from the destination configuration.