db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rankin Johnson" <rjohn...@jwortham.com>
Subject BasePeer.MapBuilder: ClassNotFoundException under Tomcat 5.0
Date Tue, 10 Aug 2004 20:22:59 GMT
I manually cleared out the classes directory and rebuilt.  The org.apache....AddrtypesMapBuilder.class
stayed away.
Now I can instantiate an AddrtypesMapBuilder from within my jsp, but Torque can't.

the center of the jsp:

  System.out.println(me + ":Start");
  Context ctx = null;
  DataSource ds;
  try{
     Context iCtx = new InitialContext();
     log.info( "got an initial context!");
     ctx = (Context) iCtx.lookup("java:/comp/env");
     if(ctx == null )
          throw new Exception("Boom - No Environmental Context");
      else
          log.info("got an environmental context!");
      ds = (DataSource)ctx.lookup("jdbc/ConPool");
      if (ds != null) {
	log.info("got new DataSource");
        ((org.apache.commons.dbcp.BasicDataSource) ds).setUsername("SYSDBA");
	((org.apache.commons.dbcp.BasicDataSource)ds).setPassword("jlwcib");
        con = ds.getConnection();
        if(null != con) log.info(me+" got good connection");
        else log.info(me + " failed to get connection");
	stmt = con.createStatement();
	log.info(me+".get(): created Statement ");
	log.info(me+".get(): sql is " + query);
	rst = stmt.executeQuery(query);
	log.info(me+".get(): executed query ");
        if(rst.next()){
            log.info(me+": Sweet Success - got a row");
            na1  = rst.getString("NA_1"); 
            if(null == na1) na1 = "Null String";
        } else
	    log.info(me+"get(): first() failed.");
      }
      log.info(me +" about to try initializing Torque");
      Torque.init("/Torque.properties");
      log.info(me +" done with initializing Torque");
      Addrtypes office = new Addrtypes();
      log.info(me +" created an office");
      office.setId(1);
      log.info(me +" set office id");
      office.setAddrtype("office");
      log.info(me +" set office type");
      AddrtypesMapBuilder ab = new AddrtypesMapBuilder();
      log.info(me +" created a AddrtypesMapBuilder.");
      // now the problem child
      office.save();
      log.info(me +" saved office.");
    }catch(Exception e) {
	log.error("Error: " + e.getMessage());
        e.printStackTrace();
    } finally{
      try{con.close();} catch(Exception e2){}
   }

and the log:

INFO [http8080-Processor4] servlet.JspServlet (service:235) - 		 datacol = NA_3
INFO [http8080-Processor4] servlet.JspServlet (service:235) - 		 col-name = customer
INFO [http8080-Processor4] servlet.JspServlet (service:235) - 		 value = 068895
INFO [http8080-Processor4] servlet.JspServlet (service:235) - 		 table-name = customer
output.jsp:Start
INFO [http8080-Processor4] Trash (_jspService:115) - got an initial context!
INFO [http8080-Processor4] Trash (_jspService:120) - got an environmental context!
INFO [http8080-Processor4] Trash (_jspService:123) - got new DataSource
INFO [http8080-Processor4] Trash (_jspService:127) - output.jsp got good connection
INFO [http8080-Processor4] Trash (_jspService:130) - output.jsp.get(): created Statement 
INFO [http8080-Processor4] Trash (_jspService:131) - output.jsp.get(): sql is  select * from
CUSTOMER where CUSTOMER="003571" 
INFO [http8080-Processor4] Trash (_jspService:133) - output.jsp.get(): executed query 
INFO [http8080-Processor4] Trash (_jspService:135) - output.jsp: Sweet Success - got a row
INFO [http8080-Processor4] Trash (_jspService:141) - output.jsp about to try initializing
Torque
INFO [http8080-Processor4] Trash (_jspService:143) - output.jsp done with initializing Torque
INFO [http8080-Processor4] Trash (_jspService:145) - output.jsp created an office
INFO [http8080-Processor4] Trash (_jspService:147) - output.jsp set office id
INFO [http8080-Processor4] Trash (_jspService:149) - output.jsp set office type
INFO [http8080-Processor4] Trash (_jspService:151) - output.jsp created a AddrtypesMapBuilder.
ERROR [http8080-Processor4] util.BasePeer (getMapBuilder:2145) - BasePeer.MapBuilder failed
trying to instantiate: com.jwortham.ocip.map.AddrtypesMapBuilder
java.lang.ClassNotFoundException: com.jwortham.ocip.map.AddrtypesMapBuilder
	at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:891)
	at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
	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:2107)
	at com.jwortham.ocip.BaseAddrtypesPeer.getMapBuilder(BaseAddrtypesPeer.java:58)
	at com.jwortham.ocip.BaseAddrtypes.save(BaseAddrtypes.java:896)
	at org.apache.jsp.output_jsp._jspService(output_jsp.java:153)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:196)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:407)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:647)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:499)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:649)
	at java.lang.Thread.run(Thread.java:534)
ERROR [http8080-Processor4] Trash (_jspService:156) - Error: null
java.lang.NullPointerException
	at com.jwortham.ocip.BaseAddrtypes.save(BaseAddrtypes.java:896)
	at org.apache.jsp.output_jsp._jspService(output_jsp.java:153)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:256)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:210)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:196)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:175)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:407)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:974)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:207)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:647)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:499)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:649)
	at java.lang.Thread.run(Thread.java:534)


Any help or suggestions would be appreciated.  I assume there's something wrong with Torque.properties
 or my application's web.xml.

They are:
torque.applicationRoot = /usr/local/java/jwsdp/1.3/webapps/report/WEB-INF
log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = ${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.org.apache.torque.append = false
torque.defaults.pool.logInterval = 0
torque.defaults.pool.connectionWaitTimeout = 10
torque.defaults.pool.defaultMaxConnections = 2
torque.defaults.pool.maxExpiryTime = 3600
torque.defaults.connection.driver = interbase.interclient.Driver
torque.defaults.connection.url = jdbc:interbase://appserver//opt/interbase/jlwibase.gdb
torque.defaults.connection.user = popeye
torque.defaults.connection.password = oliveoil
torque.database.default = ocip
torque.database.ocip.adapter = interbase.interclient.Driver
torque.idbroker.cleverquantity=true
torque.manager.useCache = true
# have tried "useClasspath" both ways for runtime. it seems to have no effect
torque.useClasspath  = true

and
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
    "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
    <display-name>Certificates Sub-System</display-name>
    <description>
       My description
    </description>
   <resource-ref>
    <res-ref-name>jdbc/ConPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
 </web-app>



---------------------------------------------------------------------
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