Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 85596 invoked from network); 7 Dec 2006 18:45:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 18:45:12 -0000 Received: (qmail 25456 invoked by uid 500); 7 Dec 2006 18:45:19 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 25437 invoked by uid 500); 7 Dec 2006 18:45:19 -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 25419 invoked by uid 99); 7 Dec 2006 18:45:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 10:45:19 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Greg.Monroe@dukece.com designates 65.112.55.73 as permitted sender) Received: from [65.112.55.73] (HELO mail.dukece.com) (65.112.55.73) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 10:45:08 -0800 Received: from dukece-mail3.dukece.com ([192.168.1.222]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 7 Dec 2006 13:45:21 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: torque runtime and ibm db2 Date: Thu, 7 Dec 2006 13:44:46 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A39119020C6CE4@dukece-mail3.dukece.com> In-Reply-To: <87d364ab0612070858s27dec1dbx86f302c394150abd@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: torque runtime and ibm db2 Thread-Index: AccaIf/6P3mK95L2StqlxnoZAWL9iQAC9f5Q From: "Greg Monroe" To: "Apache Torque Users List" X-OriginalArrivalTime: 07 Dec 2006 18:45:21.0734 (UTC) FILETIME=[D9733660:01C71A2F] X-Virus-Checked: Checked by ClamAV on apache.org Hmm, we need some better docs / error handling here. This is because db2 is not a valid adaptor name because there are three flavors of DB2. These are: db2net : "used to connect via the NET-Driver" db2app : "used to connect via the Application-Driver" as400 : "for DB2/400 on the IBM AS400 platform" You need to use one of these adaptor names. Also, at a minimum, you will want to wrap your Torque.init(..) call with a check to see if Torque has been initialized. Eg. if ( ! Torque.isInit() ) { Torque.init(...) } FYI - A good way to initialize Torque to create a=20 ServletContextListener implimentation and use the=20 contextInitialized method to set up your webapp (including=20 initializing Torque). Add this as a in your web.xml=20 file and anytime the server is started (or context reloaded)=20 Torque will be initialized. > -----Original Message----- > From: Aljosa Mohorovic [mailto:aljosa.mohorovic@gmail.com]=20 > Sent: Thursday, December 07, 2006 11:58 AM > To: Apache Torque Users List > Subject: torque runtime and ibm db2 >=20 > generator works without problems using ant: > ant -f build-torque.xml > ant -f build-torque.xml create-db > ant -f build-torque.xml insert-sql > ant -f build-torque.xml jdbc >=20 > all targets end with "BUILD SUCCESSFUL" >=20 > but when using runtime in web application: > >>> > org.apache.jasper.JasperException: Exception in JSP: /index.jsp:26 >=20 > 23: <%@ page > import=3D"org.apache.commons.beanutils.*,org.apache.torque.*,tor > que.generated.*" > %> > 24: <% > 25: > 26: Torque.init("C:\\Projects\\db2.properties"); > 27: > 28: %> > <<< >=20 > db2.properties: > >>> > torque.database.default =3D torquetest > torque.database.torquetest.adapter =3D db2 >=20 > #Using commons-dbcp > torque.dsfactory.torquetest.factory =3D > org.apache.torque.dsfactory.SharedPoolDataSourceFactory > torque.dsfactory.torquetest.connection.driver =3D=20 > com.ibm.db2.jcc.DB2Driver=20 > torque.dsfactory.torquetest.connection.url =3D=20 > jdbc:db2://127.0.0.1:50000/torquetest > torque.dsfactory.torquetest.connection.user =3D aljosa=20 > torque.dsfactory.torquetest.connection.password =3D aljosa <<< >=20 > tomcat - root cause: > >>> > java.lang.NullPointerException > java.lang.Class.forName0(Native Method) > java.lang.Class.forName(Class.java:164) > org.apache.torque.adapter.DBFactory.create(DBFactory.java:165) > =09 > org.apache.torque.TorqueInstance.initAdapters(TorqueInstance.java:254) > =09 > org.apache.torque.TorqueInstance.initialize(TorqueInstance.java:157) > org.apache.torque.TorqueInstance.init(TorqueInstance.java:464) > org.apache.torque.TorqueInstance.init(TorqueInstance.java:444) > org.apache.torque.Torque.init(Torque.java:138) > org.apache.jsp.index_jsp._jspService(index_jsp.java:65) > =09 > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > =09 > org.apache.jasper.servlet.JspServletWrapper.service(JspServlet > Wrapper.java:332) > =09 > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet > .java:314) > =09 > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > =09 > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter > (MonitorFilter.java:368) > <<< >=20 > anyone here using ibm db2? any ideas why i have this problem? >=20 > -- > Aljosa Mohorovic >=20 > http://www.revolucija.hr > Ivana Lucica 5 > 10000 Zagreb, Croatia >=20 > +385 (0)1 616 8414 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org >=20 >=20 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