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
- 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??
- a3xpw8
- UnicastRef2]]
- at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:47)
- at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:636)
- at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:306)
- at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:239)
- at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
- at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
- at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
- at javax.naming.InitialContext.init(Unknown Source)
- at javax.naming.InitialContext.<init>(Unknown Source)
- at TopicReceive.getInitialContext(TopicReceive.java:175)
- at TopicReceive.main(TopicReceive.java:142)
- 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??
The JNDI connection code is:-
Expand|Select|Wrap|Line Numbers
- tconFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(
- ctx.lookup("DummyConnectionFactory"), TopicConnectionFactory.class);
- tcon = tconFactory.createTopicConnection("xyz","xyz");
- tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- topic = (Topic) PortableRemoteObject.narrow(ctx.lookup(topicName), Topic.class);
- tsubscriber = tsession.createSubscriber(topic);
- tsubscriber.setMessageListener(this);
- tcon.start();
-Hussain.