db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prescott R. Balch <presc...@prescottbalch.org>
Subject Re: addAscendingOrderBy problem
Date Mon, 16 Dec 2002 20:32:10 GMT

code snippet:

     vRuntypes = new ArrayList();
     crit = new Criteria();
     crit.add(RuntypePeer.RUNNERID,myRunner.getRunnerid());
     crit.addAscendingOrderByColumn(RuntypePeer.RUNTYPE);
     crit.addAscendingOrderByColumn(RuntypePeer.RUNTYPEID);
     cat.debug("order by columns: " +
     crit.getOrderByColumns().toString());
     cat.debug("order by size: " + crit.getOrderByColumns().size());
     cat.debug("crit: " + crit.toString());
     try {
         vRuntypes = (ArrayList)RuntypePeer.doSelect(crit);
	 } catch (TorqueException te) {
	     vRuntypes = null;
	         cat.error("Could not select runtypes: " +
     te.toString());
         te.printStackTrace();
	 }


stack trace:

2002-12-16 14:24:15,952 [AWT-EventQueue-0] DEBUG
org.yarl.swing.RunnerListFrame - creating RunHistoryFrame
2002-12-16 14:24:15,982 [AWT-EventQueue-0] DEBUG
org.yarl.swing.YarlFrame - imageIcon = images/icon_runner.gif
2002-12-16 14:24:15,982 [AWT-EventQueue-0] DEBUG
org.yarl.swing.RunHistoryFrame -
java.awt.Dimension[width=750,height=500]
2002-12-16 14:24:15,992 [AWT-EventQueue-0] DEBUG
org.yarl.swing.RunHistoryFrame - order by columns: RunType.RUNTYPE
ASCRunType.RUNTYPEID ASC
2002-12-16 14:24:15,992 [AWT-EventQueue-0] DEBUG
org.yarl.swing.RunHistoryFrame - order by size: 2
2002-12-16 14:24:15,992 [AWT-EventQueue-0] DEBUG
org.yarl.swing.RunHistoryFrame - crit: Criteria::
RunType.RUNNERID<=>RunType.RUNNERID=1000:  
Current Query SQL (may not be complete or applicable): 
2002-12-16 14:24:16,022 [AWT-EventQueue-0] ERROR
org.yarl.swing.RunHistoryFrame - Could not select runtypes:
org.apache.torque.TorqueException
java.lang.NullPointerException
	at
org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:1168)
	at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1260)
	at org.yarl.om.BaseRuntypePeer.doSelectVillageRecords(Unknown
Source)
	at org.yarl.om.BaseRuntypePeer.doSelectVillageRecords(Unknown
Source)
	at org.yarl.om.BaseRuntypePeer.doSelect(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.addButtons(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.initializeMe(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.<init>(Unknown Source)
	at org.yarl.swing.RunnerListFrame.addRunHistoryFrame(Unknown
Source)
	at org.yarl.swing.RunnerListFrame.access$300(Unknown Source)
	at org.yarl.swing.RunnerListFrame$4.actionPerformed(Unknown
Source)
	at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
	at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
	at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
	at java.awt.Component.processMouseEvent(Component.java:5021)
	at java.awt.Component.processEvent(Component.java:4818)
	at java.awt.Container.processEvent(Container.java:1380)
	at java.awt.Component.dispatchEventImpl(Component.java:3526)
	at java.awt.Container.dispatchEventImpl(Container.java:1437)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
	at java.awt.Container.dispatchEventImpl(Container.java:1423)
	at java.awt.Window.dispatchEventImpl(Window.java:1566)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
rethrown as org.apache.torque.TorqueException
	 at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1273)
	at org.yarl.om.BaseRuntypePeer.doSelectVillageRecords(Unknown
Source)
	at org.yarl.om.BaseRuntypePeer.doSelectVillageRecords(Unknown
Source)
	at org.yarl.om.BaseRuntypePeer.doSelect(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.addButtons(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.initializeMe(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.<init>(Unknown Source)
	at org.yarl.swing.RunnerListFrame.addRunHistoryFrame(Unknown
Source)
	at org.yarl.swing.RunnerListFrame.access$300(Unknown Source)
	at org.yarl.swing.RunnerListFrame$4.actionPerformed(Unknown
Source)
	at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
	at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
	at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
	at java.awt.Component.processMouseEvent(Component.java:5021)
	at java.awt.Component.processEvent(Component.java:4818)
	at java.awt.Container.processEvent(Container.java:1380)
	at java.awt.Component.dispatchEventImpl(Component.java:3526)
	at java.awt.Container.dispatchEventImpl(Container.java:1437)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
	at java.awt.Container.dispatchEventImpl(Container.java:1423)
	at java.awt.Window.dispatchEventImpl(Window.java:1566)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Caused by: java.lang.NullPointerException
       at
org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:1168)
	at
org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1260)
	... 32 more
java.lang.NullPointerException
	at org.yarl.swing.RunHistoryFrame.addButtons(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.initializeMe(Unknown Source)
	at org.yarl.swing.RunHistoryFrame.<init>(Unknown Source)
	at org.yarl.swing.RunnerListFrame.addRunHistoryFrame(Unknown
Source)
	at org.yarl.swing.RunnerListFrame.access$300(Unknown Source)
	at org.yarl.swing.RunnerListFrame$4.actionPerformed(Unknown
Source)
	at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
	at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
	at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
	at java.awt.Component.processMouseEvent(Component.java:5021)
	at java.awt.Component.processEvent(Component.java:4818)
	at java.awt.Container.processEvent(Container.java:1380)
	at java.awt.Component.dispatchEventImpl(Component.java:3526)
	at java.awt.Container.dispatchEventImpl(Container.java:1437)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
	at java.awt.Container.dispatchEventImpl(Container.java:1423)
	at java.awt.Window.dispatchEventImpl(Window.java:1566)
	at java.awt.Component.dispatchEvent(Component.java:3367)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:98)


environment info:

torque 3.0
ant 1.5.1
jdk 1.3.0_02
mysql 3.23
win2k (tried it on Linux with same results)

> 
> Would you send the stack trace and some info on your setup?
> 
> For example, I'm using
> TDK 2.2 RC2
> PostgreSQL 7.2
> Ant 1.5.1
> Maven 1.0-beta-7
> Java SDK 1.4.0_01
> Linux
> 
> Eric
> 
> On Mon, 2002-12-16 at 14:28, Prescott R. Balch wrote:
> > 
> > No it is not.  And the SQL query never hits the database.  I turned on
> > log4j debugging in the torque classes and in the database (mysql) and
> > the code never gets far enough to hit the db.
> > 
> > > Is that column null in any of the rows that you select?
> > > 
> > > Eric
> > > 
> > > On Sun, 2002-12-15 at 20:30, Prescott R. Balch wrote:
> > > > 
> > > > I am using torque-3.0 and having a problem with addAscendingOrderBy on
> > > > varchar columns.  When I use an integer column, it works fine, but
> > > > when I use a varchar column it gives me nullPointerException building
> > > > the query string in BasePeer.  The line number from the stack trace
> > > > implies that it occurs, as expected, in the code that is building the
> > > > orderBy statement.
> > > > 
> > > > Any help is appreciated.
> > > > 
> > > > prescott balch
> > > > 
> > > > --
> > > > To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> > > -- 
> > > Eric Emminger
> > > eric@ericemminger.com
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> > > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> -- 
> Eric Emminger
> eric@ericemminger.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> 

Mime
View raw message