Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 48620 invoked from network); 12 Sep 2006 13:35:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Sep 2006 13:35:26 -0000 Received: (qmail 44246 invoked by uid 500); 12 Sep 2006 13:35:24 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 44195 invoked by uid 500); 12 Sep 2006 13:35:24 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 44139 invoked by uid 99); 12 Sep 2006 13:35:24 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2006 06:35:24 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=alvarocoronel67@yahoo.com; spf=permerror Authentication-Results: idunn.apache.osuosl.org header.from=alvarocoronel67@yahoo.com; domainkeys=good X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,FROM_ENDS_IN_NUMS,HTML_10_20,HTML_MESSAGE Received-SPF: error (idunn.apache.osuosl.org: domain yahoo.com from 206.190.39.120 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from ([206.190.39.120:29460] helo=web50814.mail.yahoo.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id E9/00-02623-3A7B6054 for ; Tue, 12 Sep 2006 06:35:32 -0700 Received: (qmail 71045 invoked by uid 60001); 12 Sep 2006 13:35:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=jiZkGXFBTu0EeKyuFoX7GGFR9Tqp14/7OFudMcOMC/BqU7QpUno0x00a0J316ByKHRP+ADPDRHxxR8izp8DMrITIZJg27/ypKDWSLh6q1tSYewACo7wJzS8F/311oQuKsJj89Cq7BTcXjTe66hSZB7UwL8UuWoznRxLVljwrRO4= ; Message-ID: <20060912133515.71043.qmail@web50814.mail.yahoo.com> Received: from [190.64.123.35] by web50814.mail.yahoo.com via HTTP; Tue, 12 Sep 2006 06:35:15 PDT Date: Tue, 12 Sep 2006 06:35:15 -0700 (PDT) From: Alvaro Coronel Subject: Re: Torque connection problem To: Apache Torque Users List In-Reply-To: <20060912040520.58474.qmail@web81903.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1642708444-1158068115=:69479" Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-1642708444-1158068115=:69479 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I once saw this kind of weird problem (nosuchmethod when you _know_ the class and method are there. It was due to a repeated .jar file in different folders. They were the same version, but the JVM got utterly confused. Removing the unnecessary one solved the problem. It wasn't anything related to Torque though... Have you checked Tomcat's other lib folders? Regards, �lvaro Coronel. Frank Nguyen wrote: Thanks, Tim. I am still debugging the problem :( I am running Jarkata 3.1.1a, Torque 3.1 on Windows 2000. The irony of this problem is that I am running 2 webapps; mine and stocktrack (sample app from Struts book) Both are connecting to the same mysql, different databses, though. I also used the same setting for another old app using Struts. My old app and stocktrack worked, but not the new one (error attached). I tried to mimic as much as possible from the other 2 apps in term of config but no luck. The only major different b/w those 2 apps and new one is that old ones, I used Struts, but new one is just simple servlet. My %ant -f build-torque.xml sql/insert-sql/load-sql worked fine with MySQL. So, it must be the jarkata setting. Here is what I did. Please see if I've missed anything: - webapps/myproject/WEB-INF/web.xml to include a Torque init servlet, reading Torque.properties (below) at boot time and init. I checked jarkata log file. It started. (attached) - webapps/myproject/WEB-INF/classes/Torque.properties (attached) - webapps/myproject/WEB-INF/classes/com/myproject/core/TorqueInit.class (to start at boot time). But when I run my POST servlet to run a simple insert, I got the error (error file attached): It appeared that the servlet executed but failed in Torque, getConnection. What does it mean NoSuchMethodError org.apache.torque.Torque.getConnection? I checked WEB-INF/lib and it has all the libs for Torque 3.1 there (I used the same set of libs in torque 3.1 gen I built for my app. What could be the problem ? Did I miss anything to set up the jarkata server ? THanks, Error: 500 Location: /myproject/servlet/com.myproject.core.AddClub Internal Servlet Error: java.lang.NoSuchMethodError: org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection; at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118) at org.apache.torque.util.Transaction.begin(Transaction.java:100) at com.myproject.torque.BaseClub.save(BaseClub.java:1319) at com.myproject.torque.BaseClub.save(BaseClub.java:1300) at com.myproject.core.AddClub.doPost(AddClub.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567) at org.apache.tomcat.core.Handler.invoke(Handler.java:322) at org.apache.tomcat.core.Handler.service(Handler.java:235) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516) at java.lang.Thread.run(Thread.java:536) Jim Caserta wrote: Frank, I have run into a similar situation. If you are sure you have the correct jar files, and no older versions, make sure your classLoader policy is "Multiple" in your server configuration. If it is set to "Single", you can be holding onto older classes. When I changed muine to Multipe, it corrected the issue. Jim --- Frank Nguyen wrote: > Hi, > > I have a nasty connection prob b/w my app and > MySQL and couldn'f figure out after 2 days. It > worked with a diff app before but not the latest > one. I have a simple servlet app trying to insert a > row into a table. I did have a Torque init servlet > and set it in WEB-INF/web.xml to start at boot time > (from the tom cat log file, it appeared that it > never started !!) but it wasn't sure if that is the > problem. I did have WEB-INF/classes/Torque.xml setup > correctly (cloned from a working stocktrack app from > Struts) w/ right user name and password. > > Based on the following error, what else could it be > the problem that I need to check ? > > Thanks in advance, > > > > > > java.lang.NoSuchMethodError: > org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection; > at > org.apache.torque.util.Transaction.beginOptional(Transaction.java:118) > at > org.apache.torque.util.Transaction.begin(Transaction.java:100) > at > com.youcaddy.torque.BaseClub.save(BaseClub.java:1319) > at > com.youcaddy.torque.BaseClub.save(BaseClub.java:1300) > at > com.youcaddy.core.AddClub.doPost(AddClub.java:102) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at > org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513) > > at > org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567) > at > org.apache.tomcat.core.Handler.invoke(Handler.java:322) > > at > org.apache.tomcat.core.Handler.service(Handler.java:235) > at > org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485) > at > > org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917) > at > org.apache.tomcat.core.ContextManager.service(ContextManager.java:833) > at > org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176) > at > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516) > > at java.lang.Thread.run(Thread.java:536) > > > > > Frank Nguyen > (408) 836-6235 (Cell) __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org Frank Nguyen (408) 836-6235 (Cell) torque-init com.myproject.core.TorqueInit torque-init-file WEB-INF/classes/Torque.properties 1 package com.myproject.core; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; import java.io.IOException; import org.apache.torque.Torque; import com.myproject.torque.*; public class TorqueInit extends HttpServlet { boolean initted = false; public void init() { System.out.println("TorqueInit.init() executed"); String prefix = getServletContext().getRealPath("/"); System.out.println("TorqueInit.init(): prefix=" + prefix); String file = getInitParameter("torque-init-file"); System.out.println("TorqueInit.init(): file=" + file); if (initted == false) { try { Torque.init(prefix+file); System.out.println("TorqueInit.init() completed"); } catch (Exception ex) { System.out.println("TorqueInit.init() failed"); System.out.println(ex); } } initted = true; } } Error: 500 Location: /myproject/servlet/com.myproject.core.AddClub Internal Servlet Error: java.lang.NoSuchMethodError: org.apache.torque.Torque.getConnection(Ljava/lang/String;)Ljava/sql/Connection; at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118) at org.apache.torque.util.Transaction.begin(Transaction.java:100) at com.myproject.torque.BaseClub.save(BaseClub.java:1319) at com.myproject.torque.BaseClub.save(BaseClub.java:1300) at com.myproject.core.AddClub.doPost(AddClub.java:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.facade.ServletHandler.doSTMService(ServletHandler.java:513) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:567) at org.apache.tomcat.core.Handler.invoke(Handler.java:322) at org.apache.tomcat.core.Handler.service(Handler.java:235) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516) at java.lang.Thread.run(Thread.java:536) --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------- How low will we go? Check out Yahoo! Messenger�s low PC-to-Phone call rates. --0-1642708444-1158068115=:69479--