I (after a very long time) realized the classpath issue..  I had just added
in a reference to my maven lib.repo, and thus was getting the old ones...

So, now I have all the code creating the correct templates, and am
successfully compiling my app with the new OM objects.  I then tried to fire
up my JUnit testcase that exercizes Torque, and Bamn!  The world crashed on
me!

Do I need some sort of commons-jdbc jar in my path?

Eric



The output (and very frightening output it is):

do-run-singletest:
     [echo]       Running a single JUnit test
     [echo]
    [junit] Running com.upstate.services.TorqueTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 40.619 sec
    [junit] Testsuite: com.upstate.services.TorqueTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 40.619 sec
    [junit] ------------- Standard Error -----------------
    [junit] java.io.FileNotFoundException:
C:\kinaseprofiler\config\security.pro
perties (The system cannot find the path specified)
    [junit]     at java.io.FileInputStream.open(Native Method)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:64)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:95)
    [junit]     at
com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility
.java:42)
    [junit]     at
com.sun.enterprise.iiop.POAEJBORB.<clinit>(POAEJBORB.java:78)

    [junit]     at java.lang.Class.forName0(Native Method)
    [junit]     at java.lang.Class.forName(Class.java:195)
    [junit]     at org.omg.CORBA.ORB.create_impl(ORB.java:284)
    [junit]     at org.omg.CORBA.ORB.init(ORB.java:328)
    [junit]     at
com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:
138)
    [junit]     at
com.sun.enterprise.util.ORBManager.init(ORBManager.java:65)
    [junit]     at
com.sun.enterprise.naming.SerialInitContextFactory.<init>(Ser
ialInitContextFactory.java:31)
    [junit]     at java.lang.Class.newInstance0(Native Method)
    [junit]     at java.lang.Class.newInstance(Class.java:237)
    [junit]     at
javax.naming.spi.NamingManager.getInitialContext(NamingManage
r.java:652)
    [junit]     at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
java:246)
    [junit]     at javax.naming.InitialContext.init(InitialContext.java:222)
    [junit]     at
javax.naming.InitialContext.<init>(InitialContext.java:178)
    [junit]     at
org.apache.torque.util.BasePeer.getInitialContext(BasePeer.ja
va:142)
    [junit]     at
org.apache.torque.util.BasePeer.<clinit>(BasePeer.java:135)
    [junit]     at
com.upstate.services.TorqueTest.testIt(TorqueTest.java:49)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java)
    [junit]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java)
    [junit]     at org.apache.tools.ant.Project.executeTargets(Project.java)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java)
    [junit]     at org.apache.tools.ant.Main.start(Main.java)
    [junit]     at org.apache.tools.ant.Main.main(Main.java)
    [junit] java.io.FileNotFoundException:
C:\kinaseprofiler\config\ejb.properti
es (The system cannot find the path specified)
    [junit]     at java.io.FileInputStream.open(Native Method)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:64)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:95)
    [junit]     at
com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility
.java:42)
    [junit]     at
com.sun.enterprise.iiop.J2EEInitializer.<init>(J2EEInitialize
r.java:54)
    [junit]     at java.lang.Class.newInstance0(Native Method)
    [junit]     at java.lang.Class.newInstance(Class.java:237)
    [junit]     at
com.sun.corba.ee.internal.Interceptors.PIORB.registerORBIniti
alizers(PIORB.java:377)
    [junit]     at
com.sun.corba.ee.internal.Interceptors.PIORB.parseProperties(
PIORB.java:347)
    [junit]     at
com.sun.corba.ee.internal.TxPOA.TxPIORB.parseProperties(TxPIO
RB.java:116)
    [junit]     at
com.sun.corba.ee.internal.corba.ORB.set_parameters(ORB.java:4
61)
    [junit]     at
com.sun.corba.ee.internal.POA.POAORB.set_parameters(POAORB.ja
va:156)
    [junit]     at
com.sun.corba.ee.internal.Interceptors.PIORB.set_parameters(P
IORB.java:336)
    [junit]     at org.omg.CORBA.ORB.init(ORB.java:329)
    [junit]     at
com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:
138)
    [junit]     at
com.sun.enterprise.util.ORBManager.init(ORBManager.java:65)
    [junit]     at
com.sun.enterprise.naming.SerialInitContextFactory.<init>(Ser
ialInitContextFactory.java:31)
    [junit]     at java.lang.Class.newInstance0(Native Method)
    [junit]     at java.lang.Class.newInstance(Class.java:237)
    [junit]     at
javax.naming.spi.NamingManager.getInitialContext(NamingManage
r.java:652)
    [junit]     at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
java:246)
    [junit]     at javax.naming.InitialContext.init(InitialContext.java:222)
    [junit]     at
javax.naming.InitialContext.<init>(InitialContext.java:178)
    [junit]     at
org.apache.torque.util.BasePeer.getInitialContext(BasePeer.ja
va:142)
    [junit]     at
org.apache.torque.util.BasePeer.<clinit>(BasePeer.java:135)
    [junit]     at
com.upstate.services.TorqueTest.testIt(TorqueTest.java:49)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java)
    [junit]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java)
    [junit]     at org.apache.tools.ant.Project.executeTargets(Project.java)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java)
    [junit]     at org.apache.tools.ant.Main.start(Main.java)
    [junit]     at org.apache.tools.ant.Main.main(Main.java)

    [junit] Warning: unable to read transaction.interoperability config
property


-----Original Message-----
From: Stephen Haberman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 3:52 PM
To: 'Turbine Torque Users List'
Subject: RE: Trying to create OM with new torque jar, and creating bad
method..


Yeah, torque-3.0-b3-dev got ride of the org.apache.torque.pool stuff and
moved it to commons-jdbc2pool. However, the templates are in sync with
whatever jar they are in.

If you're using the -classpath target, make sure that only
torque-3.0-b3-dev is in your classpath, as also having torque-3.0-b2
would cause it to use the old templates (I ran into this because the
Torque build file uses the nifty three-lines of Ant code to include any
and all jars in your lib dir, which I had set to maven.repo).

- Stephen

> -----Original Message-----
> From: Eric Pugh [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 20, 2002 9:11 AM
> To: 'Turbine Torque Users List'
> Subject: RE: Trying to create OM with new torque jar, and creating bad
method..
>
> Okay, making progress..  I am now past the bad method calls, and
running up
> against these errors:
>
> javac.compile:
>     [javac] Compiling 39 source files to
C:\kinaseprofiler\target\classes
>     [javac]
> C:\kinaseprofiler\src\java\com\upstate\kinaseprofiler\torque\db\om\B
> aseAudit.java:11: cannot resolve symbol
>     [javac] symbol  : class DBConnection
>     [javac] location: package pool
>     [javac] import org.apache.torque.pool.DBConnection;
>     [javac]                               ^
>     [javac]
> C:\kinaseprofiler\src\java\com\upstate\kinaseprofiler\torque\db\om\B
> aseAudit.java:517: cannot resolve symbol
>     [javac] symbol  : class DBConnection
>     [javac] location: class
> com.upstate.kinaseprofiler.torque.db.om.BaseAudit
>     [javac]     public void save(DBConnection dbCon) throws
TorqueException
>     [javac]                      ^
>
> Now, I went and looked, and yes, the whole directory pool has been
removed.
> I believe this is because of some of the working going on with moving
to
> using DBCP? However, it means that the templates aren't keeping up...
Am I
> too much on the bleeding edge here?
>
> Not sure about tacking rewriting these templates..  I don't use the
> DBConnection stuff externally, so the various save(DBConnection) don't
> really matter to me....
>
> Eric
>
> -----Original Message-----
> From: Stephen Haberman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 20, 2002 2:34 PM
> To: 'Turbine Torque Users List'
> Subject: RE: Trying to create OM with new torque jar, and creating bad
> method..
>
>
> Are you using Village 1.5.3?
>
> - Stephen
>
> > -----Original Message-----
> > From: Eric Pugh [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 20, 2002 6:42 AM
> > To: 'Turbine Torque Users List'
> > Subject: Trying to create OM with new torque jar, and creating bad
> method..
> >
> > Hi all,
> >
> > I am trying to integrate creating my OM with torque-3.0-b2-dev.jar
> using the
> > project-om-classpath target so that I don't need to unzip the Torque
> jar.
> > However, I am noticing a difference between my old base*peer objects
> and
> > the new ones..
> > The new ones where the column is a boolean creates the java code:
> >
> > obj.setControlF(row.getValue(offset+7).asBooleanObj());
> >
> > However, asBooleanObj is not a method provide by Village's Value
> class, so
> > it fails...  Now, the template has changed between torque-3.0-b2.jar
> and
> > torque-3.0-b2-dev.jar:
> >
> > torque-3.0-b2.jar:
> >  public static void populateObject (Record row,
> >                                        int offset,
> >                                        $table.JavaName obj )
> >         throws TorqueException
> >     {
> >         try
> >         {
> >         #set ( $n=0 )
> >         #set ( $boolean = "boolean" )
> >         #foreach ($col in $table.Columns)
> >             #if ($col.isBooleanChar())
> >             $boolean b =
> > "Y".equals(row.getValue(offset+$n).$col.VillageMethod);
> >             #set ( $boolean = "" )
> >                 #if ($col.isUsePrimitive())
> >             obj.set${col.JavaName}(b);
> >                 #else
> >             obj.set${col.JavaName}(b ? Boolean.TRUE :
Boolean.FALSE);
> >                 #end
> >             #elseif ($col.isBooleanInt())
> >             $boolean b = (row.getValue(offset+$n).$col.VillageMethod
> == 1);
> >                 #set ( $boolean = "" )
> >                 #if ($col.isUsePrimitive())
> >             obj.set${col.JavaName}(b);
> >                 #else
> >             obj.set${col.JavaName}(b ? Boolean.TRUE :
Boolean.FALSE);
> >                 #end
> >             #else
> >                 #if ($col.isPrimaryKey() || $col.isForeignKey() )
> >             obj.set${col.JavaName}(
> >                 new
> > ${col.JavaNative}(row.getValue(offset+$n).$col.VillageMethod));
> >                 #else
> >
> > obj.set${col.JavaName}(row.getValue(offset+$n).$col.VillageMethod);
> >                 #end
> >             #end
> >                 #set ( $n = $n + 1 )
> >         #end
> >         }
> >         catch (DataSetException e)
> >         {
> >             throw new TorqueException(e);
> >         }
> >     }
> >
> >
> > torque-3.0-b2-dev.jar:
> >
> >   /**
> >      * Populates an object from a resultset row starting
> >      * from a specified offset.  This is done so that you can select
> >      * other rows than just those needed for this object.  You may
> >      * for example want to create two objects from the same row.
> >      */
> >     public static void populateObject(Record row,
> >                                       int offset,
> >                                       $table.JavaName obj)
> >         throws TorqueException
> >     {
> >         try
> >         {
> >         #set ( $n=0 )
> >         #set ( $boolean = "boolean" )
> >         #foreach ($col in $table.Columns)
> >             #if ($col.isBooleanChar())
> >             $boolean b = "Y".equals(row.getValue(offset +
> > $n).$col.VillageMethod);
> >             #set ( $boolean = "" )
> >                 #if ($col.isUsePrimitive())
> >             obj.set${col.JavaName}(b);
> >                 #else
> >             obj.set${col.JavaName}(b ? Boolean.TRUE :
Boolean.FALSE);
> >                 #end
> >             #elseif ($col.isBooleanInt())
> >             $boolean b = (row.getValue(offset +
$n).$col.VillageMethod
> ==
> > 1);
> >                 #set ( $boolean = "" )
> >                 #if ($col.isUsePrimitive())
> >             obj.set${col.JavaName}(b);
> >                 #else
> >             obj.set${col.JavaName}(b ? Boolean.TRUE :
Boolean.FALSE);
> >                 #end
> >             #else
> >                 #if ($col.isPrimaryKey() || $col.isForeignKey() )
> >             ## The field should always be an Object type but make
sure
> so we
> >             ## are sure we can set it to null.
> >             if ( row.getValue(offset+$n).$col.VillageMethod
instanceof
> > Object )
> >             {
> >                ## If the database value is a null value then set the
> Key
> >                ## value to null so comparisons with
ObjectUtils.equals
> > really work.
> >                if ( null ==
row.getValue(offset+$n).$col.VillageMethod
> )
> >                {
> >                   obj.set${col.JavaName}( (${col.JavaNative}) null
);
> >                }
> >                else
> >                ## Do what we normally do
> >                {
> >                   obj.set${col.JavaName}(
> >                       new
> > ${col.JavaNative}(row.getValue(offset+$n).$col.VillageMethod));
> >                }
> >             }
> >                 #else
> >             obj.set${col.JavaName}(row.getValue(offset +
> > $n).$col.VillageMethod);
> >                 #end
> >             #end
> >                 #set ( $n = $n + 1 )
> >         #end
> >         }
> >         catch (DataSetException e)
> >         {
> >             throw new TorqueException(e);
> >         }
> >     }
> >
> >
> > Do I need to upgrade to the newest version of Torque in CVS?  I
can't
> seem
> > to get the newest version to build with maven right now however...
> >
> > Eric
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-torque-user-
> > [EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:turbine-torque-user-
> > [EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>




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


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

Reply via email to