public void init(Context ctx, String topicName)
throws NamingException, JMSException, InterruptedException
{
System.out.println("Looking up TopicConnectionFactory: " + JMS_FACTORY);
tconFactory = (TopicConnectionFactory) ctx.lookup(JMS_FACTORY);
System.out.println("Creating TopicConnection..");
tcon = tconFactory.createTopicConnection();
System.out.println("Creating TopicSession..");
tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
try {
topic = (Topic) ctx.lookup(topicName);
} catch (NamingException ne) {
topic = tsession.createTopic(topicName);
ctx.bind(topicName, topic);
}
System.out.println("Creating DurableSubscriber...");
tsubscriber = tsession.createSubscriber(topic);
//tsubscriber = tsession.createDurableSubscriber(topic, "Subscriber 1");
System.out.println("Created DurableSubscriber...");
tsubscriber.setMessageListener(this);
tcon.start();
}
Here is the output when I try to run the entire thing:
C:\work\jms\topic\classes>java -cp C:\weblogic\classes;C:\weblogic\lib\weblogica
ux.jar;.\ TopicReceive t3://localhost
Looking up TopicConnectionFactory: jms.connection.isdsLogFactory
Creating TopicConnection..
Creating TopicSession..
Creating DurableSubscriber...
Exception in thread "main" javax.jms.JMSException: System error: java.lang.ClassCastException:
weblogic.jms.common.SessionCallback_WLStub
at weblogic.jms.common.JMSUtilities.jmsException(JMSUtilities.java:18)
at weblogic.jms.client.JMSSession.handleException(JMSSession.java:682)
at weblogic.jms.client.JMSSession.establishSessionCallback(JMSSession.java:652)
at weblogic.jms.client.JMSTopicSession.createSubscriber(JMSTopicSession.java:71)
at weblogic.jms.client.JMSTopicSession.createSubscriber(JMSTopicSession.java:56)
at TopicReceive.init(TopicReceive.java:73)
at TopicReceive.main(TopicReceive.java:101)
Any hints on this?
What JDK/J2EE versions are you running?
"Ivaylo Mihov" <i...@instill.com> wrote in message
news:3b704fcd$1...@newsgroups.bea.com...
You need to apply the weblogic510sp10.jar to both the server and the client.
-Lisa
-Lisa