db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: Torque using Tomcat
Date Fri, 23 Jun 2006 16:03:48 GMT
Hmm, the full error message indicates that something is
really strange in your Generated Torque classes.  Your Bank 
class looks like it was generated in the persistance package
but it's trying to call org.apache.torque.map.BankMapBuilder.

The BankMapBuilder class is a generated class that should be 
under the persistance package (default would be persistance.map)

In a previous message, it seemed like you generated your classes
into the org.apache.torque package.  Do you still have code
from this bad package choice hanging around?

I suggest you go back the Torque class generation step; clear 
out all the generated java files in the org.apache.torque and
persistent directories (and sub directories); make sure your
schema file has a new date on it; and regenerate/re-compile
everything.  Then use ALL the classes / packages under the
persistance directory in your web app. 

> -----Original Message-----
> From: Norbert Kunstek [mailto:norbertkunstek@web.de] 
> Sent: Friday, June 23, 2006 11:32 AM
> To: Apache Torque Users List
> Subject: RE: Torque using Tomcat
> 
> 
> 23.06.2006 17:24:03 org.apache.torque.util.BasePeer getMapBuilder
> SCHWERWIEGEND: BasePeer.MapBuilder failed trying to 
> instantiate: org.apache.torque.map.BankMapBuilder
> java.lang.ClassNotFoundException: org.apache.torque.map.BankMapBuilder
> 	at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.java:1340)
> 	at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.java:1189)
> 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:141)
> 	at 
> org.apache.torque.util.BasePeer.getMapBuilder(BasePeer.java:1355)
> 	at persistence.BaseBankPeer.<clinit>(BaseBankPeer.java:78)
> 	at persistence.BaseBank.<clinit>(BaseBank.java:40)
> 	at HelloServlet.doGet(HelloServlet.java:42)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:252)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:173)
> 	at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:214)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(S
> tandardContextValve.java:198)
> 	at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:152)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:137)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:118)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:102)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:109)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> java:160)
> 	at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:799)
> 	at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
r.processConnection(Http11Protocol.java:705)
> 	at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:577)
> 	at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> 	at java.lang.Thread.run(Thread.java:534)
> 23.06.2006 17:24:03 persistence.BaseBankPeer <clinit>
> SCHWERWIEGEND: Could not initialize Peer
> org.apache.torque.TorqueException: 
> java.lang.ClassNotFoundException: org.apache.torque.map.BankMapBuilder
> 	at 
> org.apache.torque.util.BasePeer.getMapBuilder(BasePeer.java:1389)
> 	at persistence.BaseBankPeer.<clinit>(BaseBankPeer.java:78)
> 	at persistence.BaseBank.<clinit>(BaseBank.java:40)
> 	at HelloServlet.doGet(HelloServlet.java:42)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:252)
> 	at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:173)
> 	at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:214)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardContextValve.invokeInternal(S
> tandardContextValve.java:198)
> 	at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:152)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:137)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:118)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:102)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:109)
> 	at 
> org.apache.catalina.core.StandardValveContext.invokeNext(Stand
> ardValveContext.java:104)
> 	at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:520)
> 	at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at 
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.
> java:160)
> 	at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:799)
> 	at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
r.processConnection(Http11Protocol.java:705)
> 	at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:577)
> 	at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> 	at java.lang.Thread.run(Thread.java:534)
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.torque.map.BankMapBuilder
> 	at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.java:1340)
> 	at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.java:1189)
> 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:141)
> 	at 
> org.apache.torque.util.BasePeer.getMapBuilder(BasePeer.java:1355)
> 	... 29 more
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: "Apache Torque Users List" <torque-user@db.apache.org>
> > Gesendet: 23.06.06 15:53:46
> > An: "Apache Torque Users List" <torque-user@db.apache.org>
> > Betreff: RE: Torque using Tomcat
> 
> 
> > Ok, lets start back at the beginning.  You say you're getting a 
> > ClassNotFound Exception.  Exactly what is the text of the error you 
> > are getting, including all the Stacktrace info?  It's most 
> likely in 
> > one of the Tomcat logs.
> > 
> > Do you have ALL the Torque Runtime required jar files (not just
> > torque*.jar) in a Tomcat library?  E.g., in the WEB-INF/lib or 
> > shared/lib directories?
> > 
> > Another possible "class not found" cause is that your JDBC driver 
> > class name is mistyped in the Torque.properties or that 
> it's jar file 
> > is not in one of the Tomcat libraries.
> > 
> > > -----Original Message-----
> > > From: Norbert Kunstek [mailto:norbertkunstek@web.de]
> > > 
> > > 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
> > > 
> > > 
> > 
> > Duke CE Privacy Statement
> > Please be advised that this e-mail and any files 
> transmitted with it are confidential communication or may 
> otherwise be privileged or confidential and are intended 
> solely for the individual or entity to whom they are 
> addressed.  If you are not the intended recipient you may not 
> rely on the contents of this email or any attachments, and we 
> ask that you  please not read, copy or retransmit this 
> communication, but reply to the sender and destroy the email, 
> its contents, and all copies thereof immediately.  Any 
> unauthorized dissemination, distribution or copying of this 
> communication is strictly prohibited.
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> > 
> 
> 
> ______________________________________________________________________
> XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im 
> WEB.DE Club!		
> Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message