From torque-user-return-5092-apmail-db-torque-user-archive=db.apache.org@db.apache.org Tue Aug 03 15:40:30 2004 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 25739 invoked from network); 3 Aug 2004 15:40:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Aug 2004 15:40:30 -0000 Received: (qmail 38944 invoked by uid 500); 3 Aug 2004 15:40:04 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 38781 invoked by uid 500); 3 Aug 2004 15:40:02 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 38764 invoked by uid 99); 3 Aug 2004 15:40:01 -0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,RCVD_IN_SORBS_WEB X-Spam-Check-By: apache.org Received: from [193.17.41.41] (HELO poczta.o2.pl) (193.17.41.41) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 03 Aug 2004 08:40:01 -0700 Received: from artek (aao86.neoplus.adsl.tpnet.pl [83.25.14.86]) by poczta.o2.pl (Postfix) with ESMTP id AB317137666 for ; Tue, 3 Aug 2004 17:39:57 +0200 (CEST) Message-ID: <000d01c47970$39e00fe0$0601a8c0@artek> Reply-To: "Artur Z" From: "Artur Z" To: "Apache Torque Users List" References: Subject: Re: Problems with order by in citerias Date: Tue, 3 Aug 2004 17:40:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N look into FAQ: 17. Why addAscendingOrderByColumn launch a NullPointerException ? Answer: Torque has not been correctly initialized for the database. The properties file need the key torque.database.db.adapter=mysql where db is the database name and mysql the database adapter used by torque for accessing the base. -- Alexandre Gouze Answer: Another error may be at the OM generation. The database name was not specifed in then XML schema file. -- Jorge Ortega ----- Original Message ----- From: "Ströhm, Thomas" To: Sent: Tuesday, August 03, 2004 2:11 PM Subject: Problems with order by in citerias Hello ! I've got the following problem: I tried to put an orderColumn with addAscendingOrderByColumn(ColumnName) to an Criteria. This even works. But when i try to execut this Query with XXXPeer.doSelect(crit) I get the following error: -->> org.apache.torque.TorqueException: java.lang.NullPointerException at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:190) at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1328) at com.ndsatcom.skyarcs.easymonitor.database.BaseRcstPeer.doSelectVillageRecord s(BaseRcstPeer.java:537) at com.ndsatcom.skyarcs.easymonitor.database.BaseRcstPeer.doSelectVillageRecord s(BaseRcstPeer.java:505) at com.ndsatcom.skyarcs.easymonitor.database.BaseRcstPeer.doSelect(BaseRcstPeer .java:474) at org.apache.jsp.defaultRoot.terminals_jsp._jspService(terminals_jsp.java:108) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 11) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:204) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter .java:305) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:233) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:257) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:732) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:688) at java.lang.Thread.run(Thread.java:534) Caused by: java.lang.NullPointerException at org.apache.torque.util.BasePeer.createQuery(BasePeer.java:1231) at org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:938) at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1345) at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1322) ... 37 more <<-- Here are my torque properties: # ------------------------------------------------------------------- # $Id: Torque.properties,v 1.11 2003/08/19 19:09:44 mpoeschl Exp $ # # This is the configuration file for Torque. # # Note that strings containing "," (comma) characters must backslash # escape the comma (i.e. '\,') # # ------------------------------------------------------------------- torque.applicationRoot = . # ------------------------------------------------------------------- # # L O G G I N G # # ------------------------------------------------------------------- # We use Log4J for all Torque logging and we embed the log4j # properties within our application configuration. # ------------------------------------------------------------------- # This first category is required and the category # must be named 'default'. This is used for all logging # where an explicit category is not specified. 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 # ------------------------------------------------------------------- # # D E F A U L T S # # ------------------------------------------------------------------- # # These values kick in, if you don't explicitly override them in your # various database settings. At the moment they're only used if you # configure the TorqueDataSourceFactory of the Jdbc2PoolDataSourceFactory # as your data source provider. It does not work with JNDI. # # The example is shown for TorqueDataSource. # # ------------------------------------------------------------------- # If > 0, then a monitoring thread is started for every pool to # display the number of created, available and checked out connections # The interval is in seconds. torque.defaults.pool.logInterval = 0 # Time to wait for a connection to the databas in Seconds. torque.defaults.pool.connectionWaitTimeout = 10 # Maximum number of connections cached in a database definition. Note # that, if you have multiple database definitions which access the # same database URL, they don't share the connections but you have # multiple pools and each has this maximum number. So if you have a # connection licensed database engine, you must multiply this number by # the number of times you use a specific database URL. torque.defaults.pool.defaultMaxConnections = 80 # Lifetime of a connection in the pool. Defaults to one hour torque.defaults.pool.maxExpiryTime = 3600 # Sets the driver for the data sources. torque.defaults.connection.driver = orcale.jdbc.driver.OracleDriver # Sets the URL for the datasources torque.defaults.connection.url = jdbc:oracle:thin:@pc1027:1521:skyarcs # Sets login and password for the data sources. torque.defaults.connection.user = xxxx torque.defaults.connection.password = xxxx # ------------------------------------------------------------------- # # T O R Q U E P R O P E R T I E S # # ------------------------------------------------------------------- # These are your database settings. Look in the # org.apache.torque.pool.* packages for more information. # # The parameters to connect to the default database. You MUST # configure these properly. # ------------------------------------------------------------------- torque.database.default=skyarcs torque.database.skyarcs.adapter=oracle ## Using torque's old pool ## this implementation is deprecated and has some known bugs!!!! ## you should use commons-dbcp #torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.TorqueDataSo urceFactory #torque.dsfactory.bookstore.pool.defaultMaxConnections=10 #torque.dsfactory.bookstore.pool.maxExpiryTime=3600 #torque.dsfactory.bookstore.pool.connectionWaitTimeout=10 #torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver #torque.dsfactory.bookstore.connection.url = jdbc:mysql://localhost:3306/torque #torque.dsfactory.bookstore.connection.user = user #torque.dsfactory.bookstore.connection.password = password ## Using commons-dbcp torque.dsfactory.skyarcs.factory=org.apache.torque.dsfactory.SharedPoolDataS ourceFactory torque.dsfactory.skyarcs.pool.defaultMaxActive=10 torque.dsfactory.skyarcs.pool.testOnBorrow=true torque.dsfactory.skyarcs.pool.validationQuery=SELECT 1 torque.dsfactory.skyarcs.connection.driver = oracle.jdbc.driver.OracleDriver torque.dsfactory.skyarcs.connection.url = jdbc:oracle:thin:@pc1027:1521:skyarcs torque.dsfactory.skyarcs.connection.user = xxxxx torque.dsfactory.skyarcs.connection.password = nmdxxxxxb ## Using jndi #torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.JndiDataSour ceFactory #torque.dsfactory.bookstore.jndi.path=jdbc/bookstore #torque.dsfactory.bookstore.jndi.java.naming.factory.initial = org.apache.naming.java.javaURLContextFactory #torque.dsfactory.bookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming #torque.dsfactory.bookstore.datasource.classname=org.apache.torque.pool.Torq ueClassicDataSource #torque.dsfactory.bookstore.datasource.dataSourceName=jdbc/DBbookstore #torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.i nitial = org.apache.naming.java.javaURLContextFactory #torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.u rl.pkgs = org.apache.naming #torque.dsfactory.bookstore.datasource.defaultMaxConnections=10 ## ConnectionPoolDataSource #torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.JndiDataSour ceFactory #torque.dsfactory.bookstore.jndi.path=jdbc/DBbookstore #torque.dsfactory.bookstore.jndi.java.naming.factory.initial = org.apache.naming.java.javaURLContextFactory #torque.dsfactory.bookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming #torque.dsfactory.bookstore.datasource.classname=org.apache.commons.dbcp.cpd sadapter.DriverAdapterCPDS #torque.dsfactory.bookstore.datasource.driver = org.gjt.mm.mysql.Driver #torque.dsfactory.bookstore.datasource.url = jdbc:mysql://localhost:3306/torque #torque.dsfactory.bookstore.datasource.user = user #torque.dsfactory.bookstore.datasource.password = password # Determines if the quantity column of the IDBroker's id_table should # be increased automatically if requests for ids reaches a high # volume. torque.idbroker.cleverquantity=true # Determines whether the managers cache instances of the business objects. # And also whether the MethodResultCache will really cache results. torque.manager.useCache = true Can anybody hel me ?? -- Thomas Ströhm --------------------------------------------------------------------- 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