You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Ben Litchfield <be...@csh.rit.edu> on 2002/12/06 16:07:15 UTC

[SOURCE] Issue #TRQS89 - NPE if referencing local column that does not exist

You can view the issue detail at the following URL:
<http://scarab.werken.com/scarab/issues/id/TRQS89>

Type :        Defect
Issue Id :    TRQS89
Reported by: Ben Litchfield
             ben@csh.rit.edu - (ben@csh.rit.edu)

Details:

Summary: NPE if referencing local column that does not exist
Description: When defining a foreign key I mistakenly used a local column that I did not define.  I got a NPE instead of an error message when running the torque-sql.  I looked at Database(line:444) and it looks like there is a check to see if the column is not defined but the check causes a NPE.  Using torque-rc2 release.

See the attached schema file

BUILD FAILED
file:D:/ben/java/kelut/bugspot/build.xml:85: Generation failed. For more informa
tion consult the velocity log, or invoke ant with the -debug flag.
        at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:579)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.torque.engine.database.model.Database.doFinalInitializatio
n(Database.java:444)
        at org.apache.torque.engine.database.model.AppData.doFinalInitialization
(AppData.java:305)
        at org.apache.torque.engine.database.model.AppData.getDatabase(AppData.j
ava:221)
        at org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueD
ataModelTask.java:351)
        at org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask
.java:204)
        at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 17 seconds
Status: New
Database: Postgresql
Operating system: Windows
Priority: Medium