[jboss-user] [Beginners Corner] - Re: javax.naming.NameNotFoundException: queue not bound

bidhudas do-not-reply at jboss.com
Wed Dec 19 02:51:53 EST 2007


See the code I am using for getting queue

private static InitialContext getInitialContext() throws NamingException {
		if(iniCtx == null) {
				try {
				InputStream stream = MessageQueue.class.getClassLoader().getResourceAsStream("jndi.properties");
				Properties prop = new Properties();
				prop.load(stream);
				iniCtx = new InitialContext(prop);
				System.out.println("JNDI " + iniCtx.getEnvironment().toString());
				} catch (IOException e) {
				iniCtx = new InitialContext();
			}
		}
		
		return iniCtx;
	}
	
	private void createQueue(String queueName) throws NamingException, JMSException
	{
		queue = (Queue) getInitialContext().lookup(queueName);
		
	}
	


and JNDI properties as below

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://127.0.0.1:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


See the stack trace below 


javax.naming.NameNotFoundException: queue not bound 
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) 
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) 
at org.jnp.server.NamingServer.getObject(NamingServer.java:543) 
at org.jnp.server.NamingServer.lookup(NamingServer.java:267) 
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) 
at sun.rmi.transport.Transport$1.run(Unknown Source) 
at java.security.AccessController.doPrivileged(Native Method) 
	at sun.rmi.transport.Transport.serviceCall(Unknown Source) 
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) 
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) 
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
ERROR 2007-12-19 08:30:05,156 STDERR: 	at java.lang.Thread.run(Unknown Source) 
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.jnp.server.NamingServer_Stub.lookup(Unknown Source) 
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) 
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589) 
at javax.naming.InitialContext.lookup(Unknown Source) 
	at org.wipo.das.messaging.MessageQueue.createQueue(MessageQueue.java:123) 
at org.wipo.das.messaging.MessageQueue.(MessageQueue.java:43) 
at org.wipo.das.messaging.MessageQueue.get(MessageQueue.java:59) 
	at org.wipo.das.message.user.BusinessResponse.init(BusinessResponse.java:126) 
at javax.servlet.GenericServlet.init(GenericServlet.java:212) 
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) 
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) 
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) 
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) 
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) 
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) 
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
 	at java.lang.Thread.run(Unknown Source)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114094#4114094

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114094



More information about the jboss-user mailing list