Discussions

EJB programming & troubleshooting: javax.naming.NameNotFoundException:

  1. javax.naming.NameNotFoundException: (4 messages)

    I am working in JBoss 4.0.3 and oracle 9i. For connection to database i have cp-ds.xml file placed in JBOSS-HOME\server\default\deploy folder. My cp-ds.xml is like this: CPDS jdbc racle:thin:@3.103.110.19:1521 RCD oracle.jdbc.driver.OracleDriver dapp dapp 0 50 5000 15 <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> Oracle9i and i call up in java as: objDS = (DataSource)initCtxt.lookup("java:CPDS"); but it gives the following error. 19:52:08,884 INFO [STDOUT] javax.naming.NameNotFoundException: CPDS not bound 19:52:08,884 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming Server.java:514) 19:52:08,884 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming Server.java:522) 19:52:08,884 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingS erver.java:528) 19:52:08,884 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServ er.java:281) 19:52:08,884 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin gContext.java:610) 19:52:08,884 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin gContext.java:572) 19:52:08,884 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialCon text.java:347) 19:52:08,884 INFO [STDOUT] at com.ge.comfin.cp.common.dao.OracleDAOFactory. createConnection(Unknown Source) 19:52:08,884 INFO [STDOUT] at com.ge.comfin.cp.common.dao.DropdownValuesDAO .getCountry(DropdownValuesDAO.java:209) 19:52:08,884 INFO [STDOUT] at com.ge.comfin.cp.impl.UserSetupImpl.populateD ropDowns(UserSetupImpl.java:438) 19:52:08,884 INFO [STDOUT] at com.ge.comfin.cp.action.UserSetupAction.reque stAddSetUP(UserSetupAction.java:58) 19:52:08,884 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0( Native Method) 19:52:08,884 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(N ativeMethodAccessorImpl.java:39) 19:52:08,884 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invo ke(DelegatingMethodAccessorImpl.java:25) 19:52:08,884 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:3 24) 19:52:08,884 INFO [STDOUT] at org.apache.struts.actions.DispatchAction.disp atchMethod(DispatchAction.java:274) 19:52:08,884 INFO [STDOUT] at org.apache.struts.actions.DispatchAction.exec ute(DispatchAction.java:194) 19:52:08,884 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.pro cessActionPerform(RequestProcessor.java:419) 19:52:08,884 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.pro cess(RequestProcessor.java:224) 19:52:08,884 INFO [STDOUT] at org.apache.struts.action.ActionServlet.proces s(ActionServlet.java:1194) 19:52:08,884 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doPost (ActionServlet.java:432) 19:52:08,884 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpSe rvlet.java:717) 19:52:08,884 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpSe rvlet.java:810) 19:52:08,884 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha in.internalDoFilter(ApplicationFilterChain.java:252) 19:52:08,884 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha in.doFilter(ApplicationFilterChain.java:173) 19:52:08,884 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilte ********************************************************** Are any other setting required. Can anyone please help out.
  2. try your luck with java:/CPDS
  3. It doesnt work with java:/CPDS[ Go to top ]

    It doesnt work with it....i have tried CPDS,java:CPDS, java:/CPDS, but it doesnt work.
  4. Can you just see first the names bound to the naming service: Can u get something like status naming: Then you will be able to know which object and by which name are bound to naming service. You can get a list of names from the InitialContext. Don't you? cheers, http://www.javaicillusion.blogspot.com/
  5. initCtxt.lookup("java:comp/env/CPDS")