JNDI + Tomcat + Oracle 9i Database
I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. Files in $CATALINA_HOME/common/lib [EMAIL PROTECTED]:/usr/local/jakarta-tomcat-4.1.18/common/lib > ls activation.jar commons-collections.jar commons-pool.jar jdbc2_0-stdext.jar mail.jarnaming-resources.jar ant.jar commons-dbcp.jar jasper-compiler.jar jndi.jar naming-common.jar ojdbc14.jar classes12.jar commons-logging-api.jar jasper-runtime.jar jta.jar naming-factory.jar servlet.jar The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml usernamesa password driverClassName org.hsql.jdbcDriver url jdbc:HypersonicSQL:database factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue mail.smtp.host localhost File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterior, recebo a seguinte mensagem de erro: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:[EMAIL PROTECTED]:1521:GED' Alguém tem alguma idéia do que pode estar acontecendo? Excuse me for the gigantic message. I thank in advance. Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
JNDI + Tomcat + Oracle 9i Database
I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. Files in $CATALINA_HOME/common/lib [EMAIL PROTECTED]:/usr/local/jakarta-tomcat-4.1.18/common/lib > ls activation.jar commons-collections.jar commons-pool.jar jdbc2_0-stdext.jar mail.jarnaming-resources.jar ant.jar commons-dbcp.jar jasper-compiler.jar jndi.jar naming-common.jar ojdbc14.jar classes12.jar commons-logging-api.jar jasper-runtime.jar jta.jar naming-factory.jar servlet.jar The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml usernamesa password driverClassName org.hsql.jdbcDriver url jdbc:HypersonicSQL:database factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue mail.smtp.host localhost File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterior, recebo a seguinte mensagem de erro: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:[EMAIL PROTECTED]:1521:GED' Alguém tem alguma idéia do que pode estar acontecendo? Excuse me for the gigantic message. I thank in advance. Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
JNDI + Tomcat + Oracle 9i Database
I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. Files in $CATALINA_HOME/common/lib [EMAIL PROTECTED]:/usr/local/jakarta-tomcat-4.1.18/common/lib > ls activation.jar commons-collections.jar commons-pool.jar jdbc2_0-stdext.jar mail.jarnaming-resources.jar ant.jar commons-dbcp.jar jasper-compiler.jar jndi.jar naming-common.jar ojdbc14.jar classes12.jar commons-logging-api.jar jasper-runtime.jar jta.jar naming-factory.jar servlet.jar The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml usernamesa password driverClassName org.hsql.jdbcDriver url jdbc:HypersonicSQL:database factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue mail.smtp.host localhost File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterior, recebo a seguinte mensagem de erro: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:[EMAIL PROTECTED]:1521:GED' Alguém tem alguma idéia do que pode estar acontecendo? Excuse me for the gigantic message. I thank in advance. Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
JNDI + Tomcat + Oracle 9i Database
I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml ... factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue ... File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterior, recebo a seguinte mensagem de erro: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL jdbc:oracle:[EMAIL PROTECTED]:1521:XXX Alguém tem alguma idéia do que pode estar acontecendo? Excuse me for the gigantic message. I thank in advance. Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
JNDI + Tomcat + Oracle 9i Database
I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml ... factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue ... File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterior, recebo a seguinte mensagem de erro: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL jdbc:oracle:[EMAIL PROTECTED]:1521:XXX Alguém tem alguma idéia do que pode estar acontecendo? Excuse me for the gigantic message. I thank in advance. Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
Re: JNDI + Tomcat + Oracle 9i Database
Hi [difficult name ommited], I had this problem a couple of weeks ago. try changing the url to capitals ! URL This fixed an identical problem for me. Thanks, Mehdi Nejad "Sebastião Carlos Santos" To: [EMAIL PROTECTED] <[EMAIL PROTECTED]cc: .com.br> Subject: JNDI + Tomcat + Oracle 9i Database 25/02/2003 15:02 Please respond to "Tomcat Users List" I am trying to configure JNDI to access Oracle 9i R1, according to JNDI Datasource HOW-TO, however I am not obtaining a lot of success when I go to establish the connection. In the end of this e-mail I will list some fragments of the configuration of server.xml, web.xml and of my class java that I am using to accomplish the connection test. The reference $CATALINA_HOME/common/lib/*. jar is in CLASSPATH of the system Fragment of configuration of server.xml ... factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:[EMAIL PROTECTED]:1521:XXX usernamescott passwordj maxActive20 maxIdle10 maxWait1 removeAbandonedtrue removeAbandonedTimeout60 logAbandonedtrue ... File /web/WEB-INF/web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Oracle Database Connection Pool jdbc/sged javax.sql.DataSource Container index.html index.jsp index.htm Method of the class java that makes the connection test public String obtem_dados() { Connection conn = null; Statement stmt = null; ResultSet rset = null; resultado = new StringBuffer(); try { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup ("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup ("jdbc/sged"); conn = ds.getConnection(); stmt = conn.createStatement(); rset = stmt.executeQuery("SELECT COUNT(*) FROM V$SESSION"); if (rset.next()) { resultado.append("Número de Conexões -> "); resultado.append(rset.getString(1)); resultado.append(""); } } catch (java.lang.Exception e) { resultado.append(e.getMessage()); resultado.append(""); } finally { if (conn != null) { try { conn.close(); } catch (java.lang.Exception ex) { resultado.append(ex.getMessage()); resultado.append(""); } } } return ((resultado.toString())); } Ao executar o método anterio
Re: JNDI + Tomcat + Oracle 9i Database
When I made the change of the url for URL I started to receive the following error message Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' it goes connect URL 'null' Going back to the configuration url Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' it goes connect URL 'jdbc:oracle:[EMAIL PROTECTED]:1521:GED' Taking advantage of the opportunity, which driver JDBC should use, ojdbc14.jar (for the jdk 1.4) or classes12.zip, that should have the name according to the documentation changed for classes12.jar Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI + Tomcat + Oracle 9i Database
Kris, I believe that I went badly interpreted or I wrote of less in the e-mail. I don't see him/it why of installing the customer of Oracle 9i in the application servant for the simple fact most of the time, after the installation routines we have to specify the files. zip and. jar copied in the installation for ORACLE_HOME in CLASSPATH of the system, which in other words it would be the same thing of using the drivers jdbc supplied separately. I didn't have the intention of contradicting the positioning for you put. Respectfully, Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED
RE: JNDI + Tomcat + Oracle 9i Database
This issue has been asked and answered again and again in the mailing list of tomcat, struts, and commons. Consider that Oracle is so populate, setup should be pretty straightforward. My advice is to make sure that you have read carefully the tomcat datasource documentation. My environment is J2sdk 1.4.1_01 <= 1.4 Tomcat 4.1.18 Apache 2.0.44 Tomcat Connector 2.0.3 Red Hat Linux 7.2 (prod) Windows 2000 (dev) Oracle 8.1.7 classes12.jar <= 1.2 1. Below is part of my context. Do not invent the resource type, driver, and factory. I saw someone use a different factory or driver think they are going to utilize Oracle's pooling. It is smart but it is wrong in this case. To prove it is wrong, read Tomcat source code. driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:thin:@oratest.int.abcd.com:1521:PROD 2. Also in my app's web.xml Oracle Datasource jdbc/abcd javax.sql.DataSource Container Do not put commons-dbcp and pooling jars in your app's WEB-INF/lib, use Tomcat's (in common/lib). 3. Initialize the connection pool and get connection: Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup("java:comp/env"); DataSource dataSource = (DataSource) envContext.lookup("jdbc/abcd"); dataSource.getConnection() Don't do anything other than point 3 to get the connection or driver. I have had two problems before: - null driver: renamed classes12.zip to classes12.jar and put it ONLY in commons/lib. - cannot connect: use a real url other than Microsoft's name, so oratest won't work on linux while oratest.mydomain.com works. - cast exception: use commons dbcp and pooling in commons/lib. Regards, PQ "This Guy Thinks He Knows Everything" "This Guy Thinks He Knows What He Is Doing" -Original Message- From: "Sebastião Carlos Santos" [mailto:[EMAIL PROTECTED] Sent: February 25, 2003 1:37 PM To: [EMAIL PROTECTED] Subject: Re: JNDI + Tomcat + Oracle 9i Database When I made the change of the url for URL I started to receive the following error message Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' it goes connect URL 'null' Going back to the configuration url Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' it goes connect URL 'jdbc:oracle:[EMAIL PROTECTED]:1521:GED' Taking advantage of the opportunity, which driver JDBC should use, ojdbc14.jar (for the jdk 1.4) or classes12.zip, that should have the name according to the documentation changed for classes12.jar Sebastião Carlos Santos Oracle Database Administrator Universidade Federal de Uberlândia - UFU Gratificação de Estímulo à Docência - GED - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]