JNDI question
Hi evryone I have a question about how JNDI works in Tomcat 4.0.1 How can i set up a JNDI naming repository in order to create a datasource??? In the server.xml i have this: Resource name=jdbc/FtcAppDb auth=CONTAINER type=javax.sql.DataSource/ ResourceParams name=jdbc/FtcAppDb parameternameuser/namevaluescott/value/parameter parameternamepassword/namevaluetiger/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@zagarron:1521:orcl/value/parameter /ResourceParams Inside de Context tag of my application. In the web.xml i have this: resource-ref res-ref-namejdbc/FtcAppDb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref i get the datasource object doing this :DataSource ds = (DataSource)ctx.lookup(jdbc/FtcAppDb); but when i try to create the connection object i get a Null Pointer exception error Could anyone help me i don't have a clue about what happen. Thanks for the time
Where can i set up my datasource?
Hi everyone; Could anyone tell me where i can set up a datasource I know I have some tags like resource and so on in the web.xml But Where i have to set up the connection stream (jdbc:oracle:thin:@zagarron:1521:orcl) the user and password to connect to the data base Thanks in advanced
JNDI doesn't work
Hi everyone; I need help! i´m trying to set up my Tomcat 4..0.1 in such a way than I can use a DataSource in my aplicaction called FtcApp. My piece of server.xml regard this is: Context path=/FtcApp docBase=FtcApp debug=0 reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_FtcApp_log. suffix=.txt timestamp=true/ Parameter name=context.param.name value=context.param.value override=false/ Resource name=jdbc/FtcAppDb auth=CONTAINER type=javax.sql.DataSource/ ResourceParams name=jdbc/FtcAppDb parameternameuser/namevaluescott/value/parameter parameternamepassword/namevaluetiger/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@zagarron:1521:orcl/value/parameter /ResourceParams /Context My web.xml is like this: resource-ref res-ref-namejdbc/FtpAppDb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref And my java code that i want it use this datasource is : Context ctx = null; DataSource cpds = null; //PooledConnection pool = null; try { ctx = new InitialContext(); cpds = (DataSource)ctx.lookup(/jdbc/FtcAppDb); } catch (NamingException e) { throw new JspException(e); } And when i trying this i get the following error: javax.servlet.jsp.JspException: Error:IOException mientras se insertaba en tablajavax.servlet.jsp.JspException: El nombre jdbc no este asociado a este contexto at tags.Insertar.doStartTag(Insertar.java:116) at org.apache.jsp.edificios_0005fadd_0005f2$jsp._jspService(edificios_0005fadd_0005f2$jsp.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106) at java.lang.Thread.run(Thread.java:484) Does anyone can help me ??? Thanks
datasource?
Hi everyone, Does anyone know if tomcat can manage ConnectionPoolDatasource If the answer is yes how can i register it in Tomcat I'm trying to create a connection pool and i think that i need a this interfaz to create a ConnectionPool object. If anyone knows how to create this object in a diferent way Could he/she explain me how Thanks in advanced.