JNDI Lookup Issue java:/queue/test
aslamcl Feb 16, 2012 8:36 AMOn server startup I get following message in console.
15:01:55,312 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-1) trying to deploy queue jms.queue.testQueue 15:01:55,328 INFO [org.jboss.as.messaging] (MSC service thread 1-1) JBAS011601: Bound messaging object to jndi name java:/queue/test
I have tried to lookup "java:/queue/test" using following jndi code. But I get exception.
Properties props = new Properties(); | |||
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); | |||
props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099"); | |||
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); | |||
InitialContext ctx = new InitialContext() | |||
; |
ctx.lookup("java:/queue/test");
javax.naming.NameNotFoundException: jboss/datasources/ExampleDS at org.jboss.ha.jndi.HAJNDI.lookupRemotely(HAJNDI.java:265) at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.ha.framework.server.HARMIServerImpl.invoke(HARMIServerImpl.java:209) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source) at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source) at sun.rmi.server.UnicastRef.invoke(Unknown Source) at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source) at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:225) at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:327) at $Proxy0.lookup(Unknown Source) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686) at javax.naming.InitialContext.lookup(Unknown Source) at com.pcs.obix.Main.getConnectionFactory(Main.java:27) at com.pcs.obix.Main.main(Main.java:14) |
Note: I tried to look up other things aswell, but for everything I get the above error message. Please help;