Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 14579 invoked from network); 22 Jun 2006 13:49:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2006 13:49:17 -0000 Received: (qmail 707 invoked by uid 500); 22 Jun 2006 13:49:16 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 685 invoked by uid 500); 22 Jun 2006 13:49:16 -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 657 invoked by uid 99); 22 Jun 2006 13:49:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 06:49:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [216.254.136.21] (HELO smtp-04.primus.ca) (216.254.136.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 06:49:15 -0700 Received: from [209.183.25.233] (helo=[192.168.1.63]) by smtp-04.primus.ca with esmtp (Exim 4.50) id 1FtPYD-0001Lb-Fh for torque-user@db.apache.org; Thu, 22 Jun 2006 09:48:53 -0400 Message-ID: <449A9FC5.3020501@idilia.com> Date: Thu, 22 Jun 2006 09:48:53 -0400 From: Eustache User-Agent: Mozilla Thunderbird 1.0.7-1.4.1.centos4 (X11/20051007) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: Torque using Tomcat References: <2008204565@web.de> In-Reply-To: <2008204565@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I think the problem can be with your: import org.apache.torque.Bank where Bank is a generated class by Torque, so I doubt it has been generated in the org.apache.torque package. Norbert Kunstek wrote: >Hello, > >I've tried to use Torque within the Servlet but I receive always a ClassNotFound-Exception. >Maybe somebody could solve the Problem: > >import java.io.*; >import javax.servlet.*; >import javax.servlet.http.*; > >import org.apache.commons.configuration.ConfigurationException; >import org.apache.commons.configuration.PropertiesConfiguration; >import org.apache.torque.Bank; >import org.apache.torque.Torque; >import org.apache.torque.TorqueException; > >//import org.apache.torque.Torque; > >//import persistence.Bank; > > >public class HelloServlet extends HttpServlet >{ > >public void init() throws ServletException, UnavailableException >{ >try >{ >ServletContext ct = getServletContext(); >PropertiesConfiguration config = new PropertiesConfiguration(); > >config.load(ct.getResourceAsStream("/WEB-INF/Torque.properties")); > > >Torque.init(config); >} >catch (ConfigurationException e) { >System.out.println("Configuration: Initialisierung fehlgeschlagen" + e); >} >catch (TorqueException e) { >System.out.println("Init: Initialisierung fehlgeschlagen" + e); >} >} > > > > > >public void doGet( HttpServletRequest requ, HttpServletResponse resp ) >throws ServletException, IOException >{ >try >{ >Bank sparkasse = new Bank(); >sparkasse.setBankId(111); >sparkasse.setName("Apache"); >sparkasse.setCity("Torque"); > >// CREATE >sparkasse.save(); > >} >catch (Exception e) >{ >System.out.println("initializing of Torque failed" + e); >} > >resp.setContentType( "text/html" ); >PrintWriter out = resp.getWriter(); >out.println( "" ); >out.println( "Servus," ); >out.println( "Torque!" ); >out.println( "" ); >out.close(); >} > > >} >______________________________________________________________ >Verschicken Sie romantische, coole und witzige Bilder per SMS! >Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >For additional commands, e-mail: torque-user-help@db.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org