Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 50186 invoked from network); 1 Sep 2009 17:11:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Sep 2009 17:11:06 -0000 Received: (qmail 86561 invoked by uid 500); 1 Sep 2009 17:11:02 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 86515 invoked by uid 500); 1 Sep 2009 17:11:02 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 86504 invoked by uid 99); 1 Sep 2009 17:11:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 17:11:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jamez556@gmail.com designates 209.85.222.194 as permitted sender) Received: from [209.85.222.194] (HELO mail-pz0-f194.google.com) (209.85.222.194) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 17:10:52 +0000 Received: by pzk32 with SMTP id 32so133744pzk.33 for ; Tue, 01 Sep 2009 10:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mBVRbxKjuXa19lNqkLKQyHzUrNGL+xUF/FFfCyBw/f0=; b=Oua+kA2qGl4jXi7OxrJSsG4EoD+8ULKyDlDYCjC0Qlvk5GShaQBXxYALDG/XJs+rM7 CNNjFoE6l/PldxaGVoGpOEALZs4zrtlPm1Ru33NsvcHnXsO8VytKyWE2rUk4e4/+xn4B y747LrzUAXV520CZQt8V792i0+geViaMfWbjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MXLdaqfrdxB/uVsK1Ngg7Tb3p+STAYpz7qNiMjAeTiDstdaDFcC404FCISd34QtW7D DgQd659XX/xYLJLsdeElv5aPmsPyKyK1roEY0pWbOUJ5lVHToXAJFiKuMUd5JKB9FiyO fEeI0qW/3cbSxkAqpe0JMDbzey+vmqfAFHgVY= MIME-Version: 1.0 Received: by 10.140.136.9 with SMTP id j9mr1749016rvd.136.1251825032235; Tue, 01 Sep 2009 10:10:32 -0700 (PDT) In-Reply-To: <4A9D3D27.2070309@christopherschultz.net> References: <317f309c0908302040red2f53dv1b0af640e8a8f2c5@mail.gmail.com> <4A9BE078.8080807@christopherschultz.net> <317f309c0908311927i5aea6cbcq57c3e2b368029a92@mail.gmail.com> <4A9D3D27.2070309@christopherschultz.net> Date: Wed, 2 Sep 2009 01:10:32 +0800 Message-ID: <317f309c0909011010g7e3f3a4eve9ef1d0ab5020b57@mail.gmail.com> Subject: Re: tomcat 4.1.31 problem From: jamez smith To: Tomcat Users List Content-Type: multipart/alternative; boundary=000e0cd2908a5e0c440472873a09 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd2908a5e0c440472873a09 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 1, 2009 at 11:26 PM, Christopher Schultz < chris@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jamez, > > On 8/31/2009 10:27 PM, jamez smith wrote: > > >>Really? When you run startup.bat from the command-line, is EXITS > >>CMD.EXE? That is very surprising. > Sorry I didn't make this clear. The DOS Window where I type "startup.bat" is not closed and showed below, but the DOS Window it opened is closed itself. C:\Tomcat 4.1\bin>startup.bat Using CATALINA_BASE: .. Using CATALINA_HOME: .. Using CATALINA_TMPDIR: ..\temp Using JAVA_HOME: C:\j2sdk1.4.2_15 > > > >>Try looking in the file logs/procurement_log.[datestamp].txt > After I run both "startup.bat" or "catalina run", the procurement_log.txt showed the exception: (in the server.xml, myApp = procurement, I used myApp to represent the real project name, hope it won't confuse you.) 2009-09-02 00:25:51 StandardContext[/procurement]: Starting 2009-09-02 00:25:51 StandardContext[/procurement]: Processing start(), current available=false 2009-09-02 00:25:51 StandardContext[/procurement]: Configuring default Resources 2009-09-02 00:25:51 StandardContext[/procurement]: Resources start failed: java.lang.IllegalArgumentException: Document base ..\webapps\procurement does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:146) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3285) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3415) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardHost.start(StandardHost.java:707) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143) at org.apache.catalina.startup.Catalina.start(Catalina.java:463) at org.apache.catalina.startup.Catalina.execute(Catalina.java:350) at org.apache.catalina.startup.Catalina.process(Catalina.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156) 2009-09-02 00:25:51 StandardContext[/procurement]: Configuring non-privileged default Loader 2009-09-02 00:25:51 StandardContext[/procurement]: Configuring default Manager 2009-09-02 00:25:51 StandardContext[/procurement]: Processing standard container startup 2009-09-02 00:25:51 StandardContext[/procurement]: Context startup failed due to previous errors 2009-09-02 00:25:51 StandardContext[/procurement]: Exception during cleanup after start failed LifecycleException: Container StandardContext[/procurement] has not been started at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3600) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3573) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardHost.start(StandardHost.java:707) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143) at org.apache.catalina.startup.Catalina.start(Catalina.java:463) at org.apache.catalina.startup.Catalina.execute(Catalina.java:350) at org.apache.catalina.startup.Catalina.process(Catalina.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156) > > > org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of > > class '' for connect URL 'null', cause: > > java.lang.NullPointerException > > at COM.ibm.db2.jdbc.app.DB2Driver.acceptsURL(Unknown Source) > > at java.sql.DriverManager.getDriver(DriverManager.java:232) > > at > > > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743) > > >>Amusingly enough, there's a thread occurring concurrently with this one > >>on the list on this exact issue. Basically: check and re-check all your > >> parameters, make sure your datasource name is consistent, and > >>only put your MySQL driver JAR file in one place: in the server's > >>library directory (common/lib on TC 4.1 IIRC). > I am rechecking and rechecking......I found in common/lib directory there are one db2java.jar and one COM folder, basically it is the unzipped version of that db2java.jar. Not sure why the COM folder is there. But I try to remove the COM folder, the error is still there. >>It wouldn't hurt to turn up debug to something like "99". I've never > >>seen good documentation on what that attribute is supposed to do, > >>unfortunately. > I am not sure what debug tag is for? I have never used this tag before. > > > > type="javax.sql.DataSource"/> > > > > > > > > driverClassName > > COM.ibm.db2.jdbc.app.DB2Driver > > > > > > > > > > url > > jdbc:db2:oscahe > > > > > > > >>The two above parameters are the ones you ought to double- and > >>triple-check: does the IBM driver really start with COM all in caps? I > >>suspect that it should be "com.ibm.db2.jabc.app.DB2Driver" instead of > >>that you have. Case does matter. Also, is the URL you have above the > >>correct URL for DB2? Does anything need to be set up in a separate file > >>to resolve "oscahe" (and is that spelled right? "oscache", maybe?)? I > >>remember Oracle's non-type-IV JDBC drivers needed a separate file to > >>configure the driver. > Yes, IBM driver really starts with COM all in caps. I have unzipped the db2java.jar and can confirm it is correct. The path "COM\ibm\db2\jdbc\app\DB2Driver.class" is also correct. "oscahe" is correct. I have DB2 universal server installed on my local machine. When I import a profile, I can have different databases to connect to. I am able to connect to the oscahe database using Toad. I just so confused why I set docBase as local, Tomcat is working? > > >>The last thing I'd ask about your webapp is what the code looks like > >>that is trying to grab a connection from the connection pool. Is it your > >>own code? If so, post that. If you are using something like Hibernate, > >>an O-R mapper, or some other DB framework, post the configuration for > >>/that/ so we can see what the expected DataSource JNDI name is. > This application is not using Hibernate or any other OR mapper. Just the simple JDBC. This is the code: private void init() { /* Initialize the connection manager based upon the interface type */ //OscLogger.debug("Initializing connection pool"); Context ctx = null; // create parameter list to access naming system try { boolean isTomcatServer = config.getBoolean("isTomcatServer",false); //OscLogger.debug("ConnectionPool : " + "inside init() isTomcatServer : " + isTomcatServer); if(isTomcatServer==true){ ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(config.getString("dbLookUp","java:comp/env/jdbc/test_DS")); this.setDs(ds); } else {// else it is a websphere server Properties parms = new java.util.Properties(); parms.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); // access naming system ctx = new InitialContext(parms); //OscLogger.debug("ConnectionPool : " + "inside init() poolName is : " + poolName); // get DataSource factory object from naming system this.setDs((DataSource) ctx.lookup("java:comp/env/"+this.poolName)); } OscLogger.debug("Datasource : "+ds.toString()); OscLogger.debug("New DB connection pool "+poolName+" created."); } catch (Exception ne) { OscLogger.error(new LogRecord(ErrorCode.UNEXPECTED, BaseModule.DATABASE), new OscException("Unable to initialize connection pool - "+this.poolName,ne)); }finally { try { if(ctx!=null) { ctx.close(); } } catch (Exception e) { // Handle Exception OscLogger.error(new LogRecord(ErrorCode.UNEXPECTED, BaseModule.DATABASE), new OscException("Error occured while closing the initial context ",e)); } } } > > >>Finally, I wonder if upgrading to a newer level of Tomcat is an option. > >>I see it's a legacy application, but the servlet API hasn't changed that > >>dramatically over the years (other than adding features and > >>tightening-down the specification of older ones). You might find that > >>your webapp runs perfectly fine on Tomcat 6.0, and will receive better > >>support from just about everyone. TC 4.1 just got its last update ever, > >>and it's basically dead. > This application has to run on JDK 1.4. My colleague told me we have to use Tomcat 4, as Tomcat 5 requires JDK 1.5. Is that true? I am more than happy to switch to higher version of Tomcat. Basically I only use Tomcat on local for development, and we are using Websphere application server in production. Thanks so much Chris! Jamez. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkqdPScACgkQ9CaO5/Lv0PDSqgCeL5A1lOEn1+MQtxwz1kXYfrzl > IfEAn2Aq9tS22XgOgvxqiwkRujlWXnn8 > =X00F > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --000e0cd2908a5e0c440472873a09--