I'm haveing a bit of trouble with torque. I've got a fairly simple
project setup, modled after the tutorial.

I'm having a problem, and I don't know enough about torque to start
debugging it.

Here is the output of the code/error:

Starting CandidateTest
props read
instance created
values set
Exception in thread "main" java.lang.NullPointerException at
org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:424)
        at org.lougop.sql.BaseCandidate.save(BaseCandidate.java:499)
        at org.lougop.sql.BaseCandidate.save(BaseCandidate.java:478)
        at org.lougop.Test.main(Test.java:37)


Here is the actual code, omitting imports:

public class Test 
 {
     public static void main(String args[])
             throws Exception
                 {
                        System.out.println("Starting CandidateTest");
                        Torque.init("Torque.properties");
                        System.out.println("props read");
                        Candidate c = new Candidate();
                        System.out.println("instance created");
                        c.setOffice("President");
                        c.setName("Jacob Robert Wilkins");
                        c.setUrl("http://www.nplus1.net/";);
                        c.setEmail("[EMAIL PROTECTED]");
                        c.setBio("Some really Long text");
                        c.setImage("/path/to/image");
                        c.setActive(true);
                        System.out.println("values set");
                        c.save();
                        System.out.println("save called");


                        System.out.println("Finished CandidateTest");
                         
                 }
 } 


Here is my Torque.properties:

log4j.rootCategory = DEBUG, default
log4j.appender.default = org.apache.log4j.FileAppender
log4j.appender.default.file = ./torque.log
log4j.appender.default.layout = org.apache.log4j.SimpleLayout


torque.database.default=lougop
torque.database.lougop.driver=org.gjt.mm.mysql.Driver
torque.database.lougop.url=jdbc:mysql://127.0.0.1/lougop
torque.database.lougop.username=root
torque.database.lougop.password=


Oddly enough, I've created the schema for both postgres and mysql, and I
get the same error with both. That probably means I'm missing something
really obvious. I'd really appreicate any help I could get.

Where is all the good documentation for torque? Where is a good sample
application?

Thanks,
jrw

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to