[jboss-user] [JNDI/Naming/Network] - Re: JDNI Lookup - Naming Not Found with JBOSS 4.2.2

senthilrajan.nitt do-not-reply at jboss.com
Mon Apr 21 10:24:55 EDT 2008


Hi,

My JMX Console output for JNDI Service :


java: Namespace
  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
  +- OracleDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
  +- comp (class: javax.naming.Context)
  +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
  +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  +- jaas (class: javax.naming.Context)
  |   +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
  |   +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
  |   +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
  +- comp.original (class: javax.namingMain.Context)
  +- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
  +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
  +- Mail (class: javax.mail.Session)
  +- comp.ejb3 (class: javax.naming.Context)
  |   NonContext: null
  +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)

I am looking for the object as follows,


  | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
  | 	throws ServletException, IOException { 
  | 		
  |         logger.info("SpringappController - returning hello view");
  |         
  |         String now = (new java.util.Date()).toString();
  |         logger.info("senthil:returning hello view with " + now);
  |         Connection con =null;
  |         try {
  | 
  | 			Context ctx = new InitialContext();
  | 			Object ds = ctx.lookup("java:OracleDS");
  | 			System.out.println("Got the object : "+ds);
  | 			
  | 			//System.out.println("got the data source :"+ds.getClass());
  | 			
  | 			// con = ds.getConnection();
  | 			
  | 			if(con!=null){
  | 				System.out.println("Connected to saba5");
  | 			}
  | 			
  | 		} catch (NamingException e) {
  | 			// TODO Auto-generated catch block
  | 			//e.printStackTrace();
  | 			System.out.println(e.getMessage());
  | 		}finally{
  | 			if(con!=null){
  | 				try {
  | 					con.close();
  | 				} catch (SQLException e) {
  | 					// TODO Auto-generated catch block
  | 					e.printStackTrace();
  | 				}
  | 			}
  | 		}
  | 
  |         Map myModel = new HashMap();
  |         myModel.put("now", now);
  |         myModel.put("products", getProductManager().getProducts());
  | 
  |         return new ModelAndView("hello", "model", myModel);
  | 	}
  | 

The error that i am getting 

19:36:34,031 ERROR [STDERR] javax.naming.NameNotFoundException: OracleDS not bound
19:36:34,031 ERROR [STDERR]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
19:36:34,031 ERROR [STDERR]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
19:36:34,031 ERROR [STDERR]     at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
19:36:34,031 ERROR [STDERR]     at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
19:36:34,031 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
19:36:34,031 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
19:36:34,046 ERROR [STDERR]     at javax.naming.InitialContext.lookup(InitialContext.java:351)
19:36:34,046 ERROR [STDERR]     at com.pk.controller.SpringappController.handleRequest(SpringappController.java:55)
19:36:34,046 ERROR [STDERR]     at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
19:36:34,046 ERROR [STDERR]     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
19:36:34,046 ERROR [STDERR]     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
19:36:34,046 ERROR [STDERR]     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
19:36:34,046 ERROR [STDERR]     at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:453)
19:36:34,046 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
19:36:34,046 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:36:34,046 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
19:36:34,046 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
19:36:34,046 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
19:36:34,046 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
19:36:34,046 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
19:36:34,046 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
19:36:34,046 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
19:36:34,046 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
19:36:34,046 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)


Please give your suggestions.
Thanks,
Senthil



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

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



More information about the jboss-user mailing list