Am Donnerstag, den 08.09.2011, 14:49 -0400 schrieb Anjib Mulepati: > yes after changing to > ds = (DataSource) envCtx.lookup("jdbc/dummy_value"); > > i am getting > > javax.naming.NameNotFoundException: Name dummy_value is not bound in this > Context > org.apache.naming.NamingContext.lookup(NamingContext.java:770) > org.apache.naming.NamingContext.lookup(NamingContext.java:140) > org.apache.naming.NamingContext.lookup(NamingContext.java:781) > org.apache.naming.NamingContext.lookup(NamingContext.java:153) > com.anjib.factory.DynICFactory.<init>(DynICFactory.java:41) > com.anjib.actions.CommonAction.execute(CommonAction.java:42) > > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Ok, strange...
Do you have any other error messages, you are not showing us? :) Where have you put your jdbc-driver for oracle? Bye Felix > > > On 9/8/2011 2:43 PM, Felix Schumacher wrote: > > Am Mittwoch, den 07.09.2011, 10:22 -0500 schrieb Anjib Mulepati: > >> Yes I am positive > > So, your error message changes, if you change your factory code? > > > > Say, if you change your code like this > > > > ds = (DataSource) envCtx.lookup("jdbc/no_such_name"); > > > > Do you see a message like "NameNotFoundException: Name no_such_name is > > not bound..."? > > > > Felix > >> > >> Anjib Man Mulepati > >> > >> 409-225-6216 > >> > >> > >> > >> > >>> Subject: Re: JNDI configuration with 6.0.29<Reformatted> > >>> From: felix.schumac...@internetallee.de > >>> Date: Wed, 7 Sep 2011 17:17:21 +0200 > >>> To: users@tomcat.apache.org > >>> > >>> > >>> > >>> Anjib Mulepati<anji...@hotmail.com> schrieb: > >>> > >>>> Hi All, > >>>> > >>>> I am trying to setup JNDI mapping for oracle JDBC Connection Pooling > >>>> with Tomcat 6.0.29. This is giving me following error > >>>> > >>>> javax.naming.NameNotFoundException: Name dynic is not bound in this > >>> From your code and configuration I would have expected jdbc/dynic > >>> instead of just dynic. Are you sure that you are using the code you > >>> showed us? > >>> > >>> Bye > >>> Felix > >>>> Context > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:140) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:781) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153) > >>>> > >>>> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97) > >>>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:793) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:140) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:781) > >>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153) > >>>> com.anjib.factory.DynICFactory.<init>(DynICFactory.java:41) > >>>> com.anjib.actions.CommonAction.execute(CommonAction.java:42) > >>>> > >>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) > >>>> > >>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) > >>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) > >>>> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > >>>> > >>>> I ran same program with Tomcat 7.0.12 and it works fine. > >>>> > >>>> Here are my configurations: > >>>> > >>>> 1. In META-INF/context.xml > >>>> > >>>> <Context antiJARLocking="true" path="/ClientDAOTest"> > >>>> <Resource name="jdbc/dynic" > >>>> auth="Container" > >>>> type="oracle.jdbc.pool.OracleDataSource" > >>>> driverClassName="oracle.jdbc.driver.OracleDriver" > >>>> factory="oracle.jdbc.pool.OracleDataSourceFactory" > >>>> url="jdbc:oracle:thin:@//localhost:4001/SAIDIT" > >>>> user="sfed_schema" > >>>> password="sfed_schema" > >>>> maxActive="20" > >>>> maxIdle="10" > >>>> maxWait="-1" /> > >>>> </Context> > >>>> > >>>> 2. In WEB-INF/web.xml > >>>> > >>>> <resource-ref> > >>>> <res-ref-name>jdbc/dynic</res-ref-name> > >>>> <res-type>javax.sql.DataSource</res-type> > >>>> <res-auth>Container</res-auth> > >>>> <res-sharing-scope>Shareable</res-sharing-scope> > >>>> </resource-ref> > >>>> > >>>> 3. In factory class I have > >>>> > >>>> public class DynICFactory implements JNDIInterface{ > >>>> > >>>> private DataSource dataSource; > >>>> > >>>> @Override public DataSource getDataSource() { return > >>>> dataSource; } > >>>> > >>>> @Override public AgencyInterface createAgencyManager() { > >>>> AgencyImpl manager = new AgencyImpl(); > >>>> manager.setDataSource(dataSource); > >>>> return manager; > >>>> } > >>>> > >>>> public DynICFactory() throws DAOException { > >>>> DataSource ds = null; > >>>> try { > >>>> Context initCtx = new InitialContext(); > >>>> Context envCtx = (Context) > >>>> initCtx.lookup("java:comp/env"); > >>>> > >>>> } catch (NamingException e) { > >>>> throw new DAOException("Tomcat JNDI setup > >>>> failed", e); > >>>> } > >>>> this.dataSource = ds; > >>>> } > >>>> } > >>>> > >>>> > >>>> On 9/6/2011 4:11 PM, Anjib Mulepati wrote: > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> Hi All, > >>>>> I am trying to setup JNDI mapping for oracle JDBC Connection Pooling > >>>> with Tomcat 6.0.29. This is giving me following error > >>>>> javax.naming.NameNotFoundException: Name dynic is not bound in this > >>>> Context > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:770) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:140) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:781) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153) > >>>>> > >>>> > >>>> org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97) > >>>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:793) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:140) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:781) > >>>>> org.apache.naming.NamingContext.lookup(NamingContext.java:153) > >>>>> com.anjib.factory.DynICFactory.<init>(DynICFactory.java:41) > >>>>> com.anjib.actions.CommonAction.execute(CommonAction.java:42) > >>>>> > >>>> > >>>> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) > >>>> > >>>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) > >>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) > >>>>> > >>>>> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) > >>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > >>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)I > >>>>> ran > >>>> same program with Tomcat 7.0.12 and it works fine. Here are my > >>>> configurations:1. In META-INF/context.xml<Context antiJARLocking="true" > >>>> path="/ClientDAOTest"> <Resource name="jdbc/dynic" > >>>> auth="Container" type="oracle.jdbc.pool.OracleDataSource" > >>>> driverClassName="oracle.jdbc.driver.OracleDriver" > >>>> factory="oracle.jdbc.pool.OracleDataSourceFactory" > >>>> url="jdbc:oracle:thin:@//localhost:4001/SAIDIT" > >>>> user="sfed_schema" password="sfed_schema" > >>>> maxActive="20" maxIdle="10" maxWait="-1" /> > >>>> </Context>2. In WEB-INF/web.xml<resource-ref> > >>>> <res-ref-name>jdbc/dynic</res-ref-name> > >>>> <res-type>javax.sql.DataSource</res-type> > >>>> <res-auth>Container</res-auth> > >>>> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> > >>>>> 2. In factory class I havepublic class DynICFactory implements > >>>> JNDIInterface{ private DataSource dataSource; @Override > >>>> public DataSource getDataSource() { return dataSource; } > >>>>> @Override public AgencyInterface createAgencyManager() { > >>>> AgencyImpl manager = new AgencyImpl(); > >>>> manager.setDataSource(dataSource); return manager; } > >>>>> public DynICFactory() throws DAOException { DataSource ds > >>>> = null; try { Context initCtx = new InitialContext(); > >>>> Context envCtx = (Context) initCtx.lookup("java:comp/env"); > >>>> ds = (DataSource) envCtx.lookup("jdbc/dynic"); } > >>>> catch (NamingException e) { throw new DAOException("Tomcat > >>>> JNDI setup failed", e); } this.dataSource = ds; } > >>>> } > >>>>> > >>>>> > >>>>> Anjib Man Mulepati > >>>>> > >>>>> 409-225-6216 > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >>>> For additional commands, e-mail: users-h...@tomcat.apache.org > >>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >>> For additional commands, e-mail: users-h...@tomcat.apache.org > >>> > >> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org