By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,031 Members | 1,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,031 IT Pros & Developers. It's quick & easy.

Connecting to a JMS topic

P: 28
Hi ALL,
I am trying to connect to a JMS topic but getting an exception.To connect to that JMS topic username and password are required.I have provided the required username and the pwd but still getting this exception.
The exception is as follows:-
Expand|Select|Wrap|Line Numbers
  1. javax.naming.CommunicationException [Root exception is weblogic.socket.UnrecoverableConnectException: [Login failed for an unknown reason://sam03:8083/q~q~uq~???sr org.jnp.server.NamingServer_Stubxrjava.rmi.server.RemoteStub??????exrjava.rmi.server.RemoteObject?a??
  2.  
  3. a3xpw8
  4.  
  5.       UnicastRef2]]
  6.  
  7.         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:47)
  8.  
  9.         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:636)
  10.  
  11.         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:306)
  12.  
  13.         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:239)
  14.  
  15.         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
  16.  
  17.         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
  18.  
  19.         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
  20.  
  21.         at javax.naming.InitialContext.init(Unknown Source)
  22.  
  23.         at javax.naming.InitialContext.<init>(Unknown Source)
  24.  
  25.         at TopicReceive.getInitialContext(TopicReceive.java:175)
  26.  
  27.         at TopicReceive.main(TopicReceive.java:142)
  28.  
  29. Caused by: weblogic.socket.UnrecoverableConnectException: [Login failed for an unknown reason://sam03:8083/q~q~uq~???sr org.jnp.server.NamingServer_Stubxrjava.rmi.server.RemoteStub??????exrjava.rmi.server.RemoteObject?a??
  30.  

The JNDI connection code is:-
Expand|Select|Wrap|Line Numbers
  1. tconFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(
  2.                                                             ctx.lookup("DummyConnectionFactory"), TopicConnectionFactory.class);
  3.                                     tcon = tconFactory.createTopicConnection("xyz","xyz");
  4.                                     tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  5.                                     topic = (Topic) PortableRemoteObject.narrow(ctx.lookup(topicName),                                                            Topic.class);                                  
  6.   tsubscriber = tsession.createSubscriber(topic);
  7.                                     tsubscriber.setMessageListener(this);
  8.                                     tcon.start();
  9.  
Any help would be great.

-Hussain.
Jun 8 '07 #1
Share this Question
Share on Google+
1 Reply


P: 1
First of all you have not reached the line where you tying to get Topic. You failed on getting InitialContext. This error says that you must set login/password not for Topic or maybe Queue, but for InitialContext
Expand|Select|Wrap|Line Numbers
  1. environment.put(Context.SECURITY_PRINCIPAL, USER);
  2. environment.put(Context.SECURITY_CREDENTIALS, PASSWORD);
  3. environment.put(Context.SECURITY_AUTHENTICATION, "simple");
  4. jndiContext = new InitialContext(environment);
  5.  
That's maybe not the answer, but obvious logic according to your code lines. I also have pretty similar problem, but the error in my case is
Expand|Select|Wrap|Line Numbers
  1. javax.naming.CommunicationException [Root exception is weblogic.socket.UnrecoverableConnectException: [Login failed for an unknown reason: HTTP/1.0 501 Not Supported]]
  2.  
and first steps which a made was setting of the password/loging for context. But that doesn't helped)))) But maybe it gives some directions .. who knows ..
Sep 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.