Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 39893 invoked from network); 25 Jun 2002 15:15:12 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Jun 2002 15:15:12 -0000 Received: (qmail 27541 invoked by uid 97); 25 Jun 2002 15:14:47 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 27519 invoked by uid 97); 25 Jun 2002 15:14:46 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 27507 invoked by uid 98); 25 Jun 2002 15:14:45 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <502326F46B08D41191C400508B6D70C10337DEC2@NVISION01> From: Les Hughes To: 'Tomcat Users List' Subject: RE: javax.naming.NamingException: Cannot create resource instance Date: Tue, 25 Jun 2002 16:13:24 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N But if you're using dbcp then you're not using tyrex right? I'm using the "LE" version of TC 4 which doesn't ship with tyrex anyway (does the RPM?). And from my understanding tyrex doesn't pool (it provides a single connection). > -----Original Message----- > From: Manolo Ramirez [mailto:manolo@seafbo.com] > Sent: 25 June 2002 16:21 > To: Tomcat Users List > Subject: Re: javax.naming.NamingException: Cannot create resource > instance > > > I got the same problem with PostgreSQL, it was because the > RPM of Tomcat 4.0.3 > does not support Tyrex, I had to compile the source RPM and > install all the > requirements to work. > > To verify try loading this Classes: > > import tyrex.jdbc.ServerDataSource; > import tyrex.jdbc.xa.EnabledDataSource; > > if don't load you must to recompile Tomcat. > > > -- > Manolo G. Ramirez T. > Serinbol S.A. > > On Mar 25 Jun 2002 00:42, Vikramjit Singh wrote: > > hi, > > > > I am using tomcat 4.0.3 and the same problem i am facing > though i am using > > Oracle driver i.e. classes12.zip. I have tried the code in > the url you > > specified and i am also using tomcat 4.0.3 and jdk1.4. > > > > I get the error > > > > javax.naming.NamingException: Cannot create resource instance > > at > > > org.apache.naming.factory.ResourceFactory.getObjectInstance(Re > sourceFactory > >. java:167 > > > > here is what i have written in server.xml. > > > > > > > type="javax.sql.DataSource"/> > > > > > > factory > > > > org.apache.commons.dbcp.BasicDataSourceFactory > > > > > > username > > scott > > > > > > password > > tiger > > > > > > driverClassName > > oracle.jdbc.driver.OracleDriver > > > > > > driverName > > jdbc:oracle:thin:@eou3:1521:incub > > > > > > url > > jdbc:oracle:thin:@eou3:1521:incub > > > > > > > > Is the driverName correct. If someone is using > classes12.zip could someone > > tell whats the correct settings, if mine is wrong. > > in web.xml have written as told. > > > > the jsp has this > > > > <% > > try { > > Context ctx = new InitialContext(); > > if(ctx == null ) > > throw new Exception("Boom - No Context"); > > > > DataSource ds = (DataSource) > ctx.lookup("java:comp/env/jdbc/ora"); > > if (ds != null) { > > Connection conn = ds.getConnection(); > > > > if(conn != null) { > > String foo = "Got Connection "+conn.toString(); > > Statement stmt = conn.createStatement(); > > ResultSet rst = stmt.executeQuery("select > empno, ename from > > emp"); > > if(rst.next()) { > > foo=rst.getString(2); > > } > > conn.close(); > > } > > } > > } > > catch (SQLException E) { > > out.println("
unable to get connection on ora !"); > > out.println("
SQLException: " + E.getMessage()); > > out.println("
SQLState: " + E.getSQLState()); > > out.println("
VendorError: " + E.getErrorCode()); > > } > > %> > > > > Regards, > > Vikramjit Singh, > > Systems Engineer, > > GTL Ltd. > > Ph. 7612929-1031 > > > > > > -----Original Message----- > > From: Jacob Kjome [mailto:hoju@visi.com] > > Sent: Monday, June 24, 2002 8:04 AM > > To: Tomcat Users List > > Subject: Re: javax.naming.NamingException: Cannot create resource > > instance > > > > > > Hello Kumar, > > > > Try using the "username" parameter. > > > > Also, the solution that has worked flawlessly for me is here: > > > > http://marc.theaimsgroup.com/?l=tomcat-user&m=102225547106556&w=2 > > > > Note that this is with the new 4.1.x versions of Tomcat. If you are > > using 4.0.x versions, your mileage may vary. > > > > Jake > > > > Monday, June 24, 2002, 10:00:38 AM, you wrote: > > > > K> Hi, > > K> Can anyone help me how to configure JDBC DataSource > using IBM DB2 as > > the > > K> database.I had gone through the solution "Generic > DataSource Resource > > K> Factory Available. JDBC Data Sources." posted by > Mr.Anthony Dodd.But > > there > > K> the solution was explained using Oracle database.Has anyone tried > > K> configuring a DataSource using DB2? > > > > K> I'm using IBM DB2 7.1 (Driver - COM.ibm.db2.jdbc.app.DB2Driver) > > K> Tomcat 4.0.2 > > > > K> Here are the snippets for server.xml,web.xml and the JVM > stack trace: > > > > K> server.xml: > > > > K> reloadable="true"> > > K> type="COM.ibm.db2.jdbc.DB2DataSource" > > K> reloadable="true" auth="Container"/> > > K> > > K> > > K> factory > > K> org.apache.naming.factory.DataSourceFactory > > K> > > K> > > K> user > > K> db2admin > > K> > > K> > > K> password > > K> db2admin > > K> > > K> > > K> driverClassName > > K> COM.ibm.db2.jdbc.app.DB2Driver > > K> > > K> > > K> driverName > > K> jdbc:db2:sample > > K> > > K> > > > > K> > K> connectionName="db2admin" > > K> connectionPassword="db2admin" > > K> connectionURL="jdbc:db2:sample" > > K> digest="SHA" > > K> driverName="COM.ibm.db2.jdbc.app.DB2Driver" > > K> roleNameCol="role_name" > > K> userCredCol="password" > > K> userNameCol="user_name" > > K> userRoleTable="user_roles" > > K> userTable="users" /> > > K> > > > > K> web.xml: > > > > K> > > K> DS resource factory > > K> jdbc/myDS > > K> COM.ibm.db2.jdbc.DB2DataSource > > K> Container > > K> > > > > K> I get the following error when i try to lookup the > datasource in my JSP: > > K> ctx (java:comp/env) = org.apache.naming.NamingContext@42a80d > > K> obj = myDS: org.apache.naming.ResourceRef > > K> Error processing the request (doGet) : Cannot create > resource instance > > K> javax.naming.NamingException: Cannot create resource instance > > K> at > > > org.apache.naming.NamingContext.lookup(NamingContext.java:837) > K> > > at > org.apache.naming.NamingContext.lookup(NamingContext.java:181) > K> > > at > org.apache.naming.NamingContext.lookup(NamingContext.java:822) > K> > > at > org.apache.naming.NamingContext.lookup(NamingContext.java:194) K> > > at CheckDBServlet.doGet(CheckDBServlet.java:40) > > K> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:1125) > > K> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:1264) > > K> at > > K> > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt > er(Applicatio > >n K> FilterChain.java:247) > > K> at > > K> > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli > cationFilterC > >h K> ain.java:193) > > K> at > > K> > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW > rapperValve.j > >a K> va:243) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 66) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:472) > > K> at > > K> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > K> at > > K> > > > org.apache.catalina.core.StandardContextValve.invoke(StandardC > ontextValve.j > >a K> va:215) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 66) > > K> at > > K> > > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(Aut > henticatorBas > >e K> .java:472) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 64) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:472) > > K> at > > K> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > K> at > > K> > > > org.apache.catalina.core.StandardContext.invoke(StandardContex > t.java:2366) > > K> at > > K> > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHost > Valve.java:16 > >4 K> ) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 66) > > K> at > > K> > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValv > e.java:462) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 64) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:472) > > K> at > > K> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > K> at > > K> > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn > gineValve.jav > >a K> :163) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invokeNext(StandardP > ipeline.java: > >5 K> 66) > > K> at > > K> > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:472) > > K> at > > K> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) > > K> at > > K> > > > org.apache.catalina.connector.http.HttpProcessor.process(HttpP > rocessor.java > >: K> 1005) > > K> at > > K> > > > org.apache.catalina.connector.http.HttpProcessor.run(HttpProce > ssor.java:109 > >8 K> ) > > K> at java.lang.Thread.run(Thread.java:484) > > > > K> Thanks, > > K> Srinivas Kumar > > > > > > K> -- > > K> To unsubscribe, e-mail: > > > > K> For additional commands, e-mail: > > > > > -- > To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: