ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Getting java.lang.ClassCastException: javax.naming.Reference

Post new topic  Reply to topic
 Getting java.lang.ClassCastException: javax.naming.Reference « View previous topic :: View next topic » 
Author Message
tapak
PostPosted: Fri Aug 24, 2007 7:18 am    Post subject: Getting java.lang.ClassCastException: javax.naming.Reference Reply with quote

Centurion

Joined: 26 Oct 2005
Posts: 149
Location: Hartford,CT

I am trying to create a userdefined node in Java which uses JMS to put a message. I know I can use the JMSNode . This is just to test a user defined node.

I create the Java Project , Plugin Node Project and Message flow project and able to successfully deploy the flow with the node to the broker.

I created a par file and added all the jar files required to the lib directory.


The code gets the QueueConnectionFactory by ldap lookup. It works fine when I use the same code in a Java client application .

But when I use it in the User defined node , the ldap lookup returns the object as javax.naming.Reference and giving me a classcastexception.
Any thoughts ? I added all the jar files in MQjava/lib to the par file lib directory.

Here is the code i used to get the type of object .

Code:

Object obj = context.lookup(lookupTCF);
                     String str = obj.getClass().getName();
                     System.out.println(str);
                     factory = (ConnectionFactory) context
                           .lookup(lookupTCF);
[/code]
_________________
IBM Certified Solution Designer -- WebSphere MQ V5.3
IBM Certified Solution Designer -- WebSphere Business Integration - Message Broker V5
IBM Certified Specialist -- IBM WebSphere App Svr Advd Single Svr Ed. for Multiplatforms (Java)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Getting java.lang.ClassCastException: javax.naming.Reference
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.