You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by sbelt <sb...@zeroton.com> on 2002/01/02 21:46:17 UTC
Unable to execute Torque (outside of Turbine) test application
Might someone be able to help?
I am trying to create an application (called ndbTest) starting with Torque.
I have been able to create my database (named ndb_torque) using the scripts
created by Torque. Torque has also created my peer classes and compiled them
successfully. I am now trying to run a simple app to test what I have done
so far.
My problem is that when I reache the .save( ) command in my test app, I get:
java.lang.NullPointerException
at
org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
Any ideas on how I can begin to track down my issue(s)?
Background:
1) I am using the following information as my guide:
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
2) I have created a properties file named /developer/torque/ndb.properties
making slight modifications to use Postgresql instead of mysql - namely:
- I have modified the driver name to be org.postgresql.Driver,
- the URL to be jdbc://localhost:5432/ndb_test
- the username and password have also been set
- I have modified the log4j settings to create a file name
ndbTest.log
3) The schema.xml used the following to define the table I am trying to
uypdate:
<table name="t1" idMethod="native" javaName="Acl">
<column name="x1"
javaName="AclId"
primaryKey="true"
required="true"
autoIncrement="true"
type="BIGINT" <!-- db.props defines BIGINT to be int4 -->
</column>
<column name="x2"
javaName="ReadList"
primaryKey="false"
required="false"
autoIncrement="false"
size="1024"
type="VARCHAR" <!-- db.props defines BIGINT to be int4 -->
</column>
</table>
4) My code is as follows:
import com.zeroton.ndb.om.*;
import org.apache.torque.Torque;
import org.apache.torque.Torque;
public class ndbTest
{
public static void main(String[] args)
{
try
{
//Initialize torque
Torque.init("/developer/torque/ndb.properties");
//Create an ACL entry
Acl refAcl = new Acl();
//Set one of the fields
refAcl.setReadList("ALL");
//Save it
refAcl.save(); <!-- **** this is the line that
is giving the error -->
... catch exceptions then loop/print table contents ...
In the ndbTest.log file, the only Warning I see is the idBroker string
reporting that it is connected to a database that does not support
transactions. Since I am not using idBroker for my indexes, I did not think
this should concern me (?).
TIA,
Steve B.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to execute Torque (outside of Turbine) test application
Posted by sbelt <sb...@velos.com>.
Thanks, I'll give that a try.
Meanwhile, I got around it by cheating - I hardcoded my template by
commenting out (line-103):
tMap.setPrimaryKeyMethodInfo("$table.SequenceName");
and replaced it with:
tMap.setPrimaryKeyMethodInfo("${table.Name}_x1_seq");
I could get away with this because I named the first column in each table
x1!
I'm sure this will come back to haunt me...another of those
job-security-implementations perhaps ;) But at least I can now get on with
business. Bottom line is I now have code that will work with my Postgresql
database, and a likelihood to work with other databases as well.
Thanks to all who helped me over the past few days!
Steve B.
----- Original Message -----
From: "John McNally" <jm...@collab.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, January 03, 2002 3:45 PM
Subject: Re: Unable to execute Torque (outside of Turbine) test application
> you can give the sequence name. I think the tag is
> <id-method-parameter> within the <table> tag
>
> <id-method-parameter value="z1_x1_seq"/> should work.
>
> john mcnally
>
> sbelt wrote:
> >
> > Thanks, John. I believe I am now connection to the db.
> >
> > However, I am now getting an error that "Relation 'z1_seq' does not
> > exist..."
> >
> > The sequence name that postgresql acutally created for me was
'z1_x1_seq'
> > (because my tablename is "z1" and my column name is "x1") I have been
> > looking through the code (templates?) trying to find where torque
generates
> > the sequence names it expects - can you (or anyone) help?
> >
> > I feel like I am getting close! :)
> > TIA,
> >
> > Steve B.
> >
> > ----- Original Message -----
> > From: "John McNally" <jm...@collab.net>
> > To: "Turbine Users List" <tu...@jakarta.apache.org>
> > Sent: Wednesday, January 02, 2002 6:54 PM
> > Subject: Re: Unable to execute Torque (outside of Turbine) test
application
> >
> > > If you have named your db "ndb_test" then you need some database
> > > properties for that db.
> > >
> > > e.g.
> > >
> > >
services.DatabaseService.database.ndb_test.driver=org.postgresql.Driver
> > > ^
> > > john mcnally
> > >
> > > sbelt wrote:
> > > >
> > > > More info:
> > > >
> > > > By putting some System.out messages in the BasetAcl.java code, I
have
> > > > narrowed it down. I am gagging on the command:
> > > >
> > > > dbCon = BasePeer.beginTransaction(dbName);
> > > >
> > > > I have verified that the dbName parameter is correctly set to
> > "ndb_test". Is
> > > > the fact that this method is called beginTransaction and the log
message
> > ~
> > > > "connected to a database that does not support transactions"
indication
> > of
> > > > my problem? Postgres supports transactions, right? Does this mean I
have
> > > > incorrect connection parameters?
> > > >
> > > > I have:
> > > >
> > > > services.DatabaseService.database.default=default
> > > >
> > > >
services.DatabaseService.database.default.driver=org.postgresql.Driver
> > > >
> >
services.DatabaseService.database.default.url=jdbc:postgresql://localhost/nd
> > > > b_test
> > > > services.DatabaseService.database.default.username=username
> > > > # I have not yet set a password until I get things working
> > > > services.DatabaseService.database.default.password=
> > > >
> > > > then
> > > >
> > > > services.DatabaseService.database.adapter=DBPostgres
> > > >
> >
services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
> > > >
> > > > Is this not right? I'm afraid I am stuck at this point. :/
> > > >
> > > > Thanks for any assistance!
> > > >
> > > > Steve B.
> > > >
> > > > ----- Original Message -----
> > > > From: "sbelt" <sb...@zeroton.com>
> > > > To: <tu...@jakarta.apache.org>
> > > > Sent: Wednesday, January 02, 2002 12:46 PM
> > > > Subject: Unable to execute Torque (outside of Turbine) test
application
> > > >
> > > > > Might someone be able to help?
> > > > >
> > > > > I am trying to create an application (called ndbTest) starting
with
> > > > Torque.
> > > > > I have been able to create my database (named ndb_torque) using
the
> > > > scripts
> > > > > created by Torque. Torque has also created my peer classes and
> > compiled
> > > > them
> > > > > successfully. I am now trying to run a simple app to test what I
have
> > done
> > > > > so far.
> > > > >
> > > > > My problem is that when I reache the .save( ) command in my test
app,
> > I
> > > > get:
> > > > >
> > > > > java.lang.NullPointerException
> > > > > at
> > > > >
org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> > > > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> > > > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> > > > > at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
> > > > >
> > > > > Any ideas on how I can begin to track down my issue(s)?
> > > > >
> > > > > Background:
> > > > > 1) I am using the following information as my guide:
> > > > >
> > > > >
> >
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
> > > > >
> > > > > 2) I have created a properties file named
> > /developer/torque/ndb.properties
> > > > > making slight modifications to use Postgresql instead of
mysql -
> > > > namely:
> > > > > - I have modified the driver name to be
org.postgresql.Driver,
> > > > > - the URL to be jdbc://localhost:5432/ndb_test
> > > > > - the username and password have also been set
> > > > > - I have modified the log4j settings to create a file name
> > > > > ndbTest.log
> > > > >
> > > > > 3) The schema.xml used the following to define the table I am
trying
> > to
> > > > > uypdate:
> > > > > <table name="t1" idMethod="native" javaName="Acl">
> > > > > <column name="x1"
> > > > > javaName="AclId"
> > > > > primaryKey="true"
> > > > > required="true"
> > > > > autoIncrement="true"
> > > > > type="BIGINT" <!-- db.props defines BIGINT to be
int4 -->
> > > > > </column>
> > > > > <column name="x2"
> > > > > javaName="ReadList"
> > > > > primaryKey="false"
> > > > > required="false"
> > > > > autoIncrement="false"
> > > > > size="1024"
> > > > > type="VARCHAR" <!-- db.props defines BIGINT to be
> > int4 -->
> > > > > </column>
> > > > > </table>
> > > > >
> > > > > 4) My code is as follows:
> > > > >
> > > > > import com.zeroton.ndb.om.*;
> > > > > import org.apache.torque.Torque;
> > > > > import org.apache.torque.Torque;
> > > > >
> > > > > public class ndbTest
> > > > > {
> > > > > public static void main(String[] args)
> > > > > {
> > > > > try
> > > > > {
> > > > > //Initialize torque
> > > > > Torque.init("/developer/torque/ndb.properties");
> > > > >
> > > > > //Create an ACL entry
> > > > > Acl refAcl = new Acl();
> > > > > //Set one of the fields
> > > > > refAcl.setReadList("ALL");
> > > > > //Save it
> > > > > refAcl.save(); <!-- **** this is the
line
> > that
> > > > > is giving the error -->
> > > > >
> > > > > ... catch exceptions then loop/print table contents ...
> > > > >
> > > > > In the ndbTest.log file, the only Warning I see is the idBroker
string
> > > > > reporting that it is connected to a database that does not support
> > > > > transactions. Since I am not using idBroker for my indexes, I did
not
> > > > think
> > > > > this should concern me (?).
> > > > >
> > > > > TIA,
> > > > >
> > > > > Steve B.
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to execute Torque (outside of Turbine) test application
Posted by John McNally <jm...@collab.net>.
you can give the sequence name. I think the tag is
<id-method-parameter> within the <table> tag
<id-method-parameter value="z1_x1_seq"/> should work.
john mcnally
sbelt wrote:
>
> Thanks, John. I believe I am now connection to the db.
>
> However, I am now getting an error that "Relation 'z1_seq' does not
> exist..."
>
> The sequence name that postgresql acutally created for me was 'z1_x1_seq'
> (because my tablename is "z1" and my column name is "x1") I have been
> looking through the code (templates?) trying to find where torque generates
> the sequence names it expects - can you (or anyone) help?
>
> I feel like I am getting close! :)
> TIA,
>
> Steve B.
>
> ----- Original Message -----
> From: "John McNally" <jm...@collab.net>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> Sent: Wednesday, January 02, 2002 6:54 PM
> Subject: Re: Unable to execute Torque (outside of Turbine) test application
>
> > If you have named your db "ndb_test" then you need some database
> > properties for that db.
> >
> > e.g.
> >
> > services.DatabaseService.database.ndb_test.driver=org.postgresql.Driver
> > ^
> > john mcnally
> >
> > sbelt wrote:
> > >
> > > More info:
> > >
> > > By putting some System.out messages in the BasetAcl.java code, I have
> > > narrowed it down. I am gagging on the command:
> > >
> > > dbCon = BasePeer.beginTransaction(dbName);
> > >
> > > I have verified that the dbName parameter is correctly set to
> "ndb_test". Is
> > > the fact that this method is called beginTransaction and the log message
> ~
> > > "connected to a database that does not support transactions" indication
> of
> > > my problem? Postgres supports transactions, right? Does this mean I have
> > > incorrect connection parameters?
> > >
> > > I have:
> > >
> > > services.DatabaseService.database.default=default
> > >
> > > services.DatabaseService.database.default.driver=org.postgresql.Driver
> > >
> services.DatabaseService.database.default.url=jdbc:postgresql://localhost/nd
> > > b_test
> > > services.DatabaseService.database.default.username=username
> > > # I have not yet set a password until I get things working
> > > services.DatabaseService.database.default.password=
> > >
> > > then
> > >
> > > services.DatabaseService.database.adapter=DBPostgres
> > >
> services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
> > >
> > > Is this not right? I'm afraid I am stuck at this point. :/
> > >
> > > Thanks for any assistance!
> > >
> > > Steve B.
> > >
> > > ----- Original Message -----
> > > From: "sbelt" <sb...@zeroton.com>
> > > To: <tu...@jakarta.apache.org>
> > > Sent: Wednesday, January 02, 2002 12:46 PM
> > > Subject: Unable to execute Torque (outside of Turbine) test application
> > >
> > > > Might someone be able to help?
> > > >
> > > > I am trying to create an application (called ndbTest) starting with
> > > Torque.
> > > > I have been able to create my database (named ndb_torque) using the
> > > scripts
> > > > created by Torque. Torque has also created my peer classes and
> compiled
> > > them
> > > > successfully. I am now trying to run a simple app to test what I have
> done
> > > > so far.
> > > >
> > > > My problem is that when I reache the .save( ) command in my test app,
> I
> > > get:
> > > >
> > > > java.lang.NullPointerException
> > > > at
> > > > org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> > > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> > > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> > > > at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
> > > >
> > > > Any ideas on how I can begin to track down my issue(s)?
> > > >
> > > > Background:
> > > > 1) I am using the following information as my guide:
> > > >
> > > >
> http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
> > > >
> > > > 2) I have created a properties file named
> /developer/torque/ndb.properties
> > > > making slight modifications to use Postgresql instead of mysql -
> > > namely:
> > > > - I have modified the driver name to be org.postgresql.Driver,
> > > > - the URL to be jdbc://localhost:5432/ndb_test
> > > > - the username and password have also been set
> > > > - I have modified the log4j settings to create a file name
> > > > ndbTest.log
> > > >
> > > > 3) The schema.xml used the following to define the table I am trying
> to
> > > > uypdate:
> > > > <table name="t1" idMethod="native" javaName="Acl">
> > > > <column name="x1"
> > > > javaName="AclId"
> > > > primaryKey="true"
> > > > required="true"
> > > > autoIncrement="true"
> > > > type="BIGINT" <!-- db.props defines BIGINT to be int4 -->
> > > > </column>
> > > > <column name="x2"
> > > > javaName="ReadList"
> > > > primaryKey="false"
> > > > required="false"
> > > > autoIncrement="false"
> > > > size="1024"
> > > > type="VARCHAR" <!-- db.props defines BIGINT to be
> int4 -->
> > > > </column>
> > > > </table>
> > > >
> > > > 4) My code is as follows:
> > > >
> > > > import com.zeroton.ndb.om.*;
> > > > import org.apache.torque.Torque;
> > > > import org.apache.torque.Torque;
> > > >
> > > > public class ndbTest
> > > > {
> > > > public static void main(String[] args)
> > > > {
> > > > try
> > > > {
> > > > //Initialize torque
> > > > Torque.init("/developer/torque/ndb.properties");
> > > >
> > > > //Create an ACL entry
> > > > Acl refAcl = new Acl();
> > > > //Set one of the fields
> > > > refAcl.setReadList("ALL");
> > > > //Save it
> > > > refAcl.save(); <!-- **** this is the line
> that
> > > > is giving the error -->
> > > >
> > > > ... catch exceptions then loop/print table contents ...
> > > >
> > > > In the ndbTest.log file, the only Warning I see is the idBroker string
> > > > reporting that it is connected to a database that does not support
> > > > transactions. Since I am not using idBroker for my indexes, I did not
> > > think
> > > > this should concern me (?).
> > > >
> > > > TIA,
> > > >
> > > > Steve B.
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
More info - Re: Some newbie Turbine questions
Posted by Jack Axaopoulos <ja...@cisco.com>.
So as not to confuse you anymore...
I'm also using my own session validator which
doesnt require any kind of login.
public boolean requiresNewSession(org.apache.turbine.util.RunData data) {
return false;
}
Thanks...
J
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Some newbie Turbine questions
Posted by Jack Axaopoulos <ja...@cisco.com>.
I'm currently learning to use Turbine & Velocity, and have
a fewof questions.
What is the easiest way to get your application
to serve up a default page, layout, navigation and screen as
the starting point to your web app?
Suppose your URL looks like this <non-tomcat servlet engine path
stuff>/turbine
What I did to accomplish this is to set the following in my
turbine properties file:
page.default = CCFDefaultPage
services.VelocityService.default.page = VelocityPage
services.VelocityService.default.layout = VelocityOnlyLayout
services.VelocityService.default.navigation=VelocityNavigation
services.VelocityService.default.error.screen = VelocityErrorScreen
services.VelocityService.default.layout.template = /CCFSampleLayout.vm
In the Class CCFDefaultPage I coded the following:
------------------------------------------------------------------------------------------------
public void doBuild(org.apache.turbine.util.RunData data) throws Exception {
data.setScreen("CCFDefaultScreen");
data.setLayout("VelocityOnlyLayout");
super.doBuild(data);
}
------------------------------------------------------------------------------------------------
This setup works for getting the layout, navigation and screen shown
as the initial page which I want.
But I SUSPECT there is a much easier way to do this.
Is there anyway I can set a default template .vm file to show up
without having to write the CCFDefaultPage class which explicitly
calls setScreen() ???
Also...if I don't execute "data.setLayout("VelocityOnlyLayout");" in the
doBuild method
I get built in DefaultTopNavigation and DefaultBottomNavigation classes
executing instead of the CCFSampleLayout.vm.
template being used. Is this right?
Thanks...
More questions later.
J
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to execute Torque (outside of Turbine) test application
Posted by sbelt <sb...@velos.com>.
Thanks, John. I believe I am now connection to the db.
However, I am now getting an error that "Relation 'z1_seq' does not
exist..."
The sequence name that postgresql acutally created for me was 'z1_x1_seq'
(because my tablename is "z1" and my column name is "x1") I have been
looking through the code (templates?) trying to find where torque generates
the sequence names it expects - can you (or anyone) help?
I feel like I am getting close! :)
TIA,
Steve B.
----- Original Message -----
From: "John McNally" <jm...@collab.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, January 02, 2002 6:54 PM
Subject: Re: Unable to execute Torque (outside of Turbine) test application
> If you have named your db "ndb_test" then you need some database
> properties for that db.
>
> e.g.
>
> services.DatabaseService.database.ndb_test.driver=org.postgresql.Driver
> ^
> john mcnally
>
> sbelt wrote:
> >
> > More info:
> >
> > By putting some System.out messages in the BasetAcl.java code, I have
> > narrowed it down. I am gagging on the command:
> >
> > dbCon = BasePeer.beginTransaction(dbName);
> >
> > I have verified that the dbName parameter is correctly set to
"ndb_test". Is
> > the fact that this method is called beginTransaction and the log message
~
> > "connected to a database that does not support transactions" indication
of
> > my problem? Postgres supports transactions, right? Does this mean I have
> > incorrect connection parameters?
> >
> > I have:
> >
> > services.DatabaseService.database.default=default
> >
> > services.DatabaseService.database.default.driver=org.postgresql.Driver
> >
services.DatabaseService.database.default.url=jdbc:postgresql://localhost/nd
> > b_test
> > services.DatabaseService.database.default.username=username
> > # I have not yet set a password until I get things working
> > services.DatabaseService.database.default.password=
> >
> > then
> >
> > services.DatabaseService.database.adapter=DBPostgres
> >
services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
> >
> > Is this not right? I'm afraid I am stuck at this point. :/
> >
> > Thanks for any assistance!
> >
> > Steve B.
> >
> > ----- Original Message -----
> > From: "sbelt" <sb...@zeroton.com>
> > To: <tu...@jakarta.apache.org>
> > Sent: Wednesday, January 02, 2002 12:46 PM
> > Subject: Unable to execute Torque (outside of Turbine) test application
> >
> > > Might someone be able to help?
> > >
> > > I am trying to create an application (called ndbTest) starting with
> > Torque.
> > > I have been able to create my database (named ndb_torque) using the
> > scripts
> > > created by Torque. Torque has also created my peer classes and
compiled
> > them
> > > successfully. I am now trying to run a simple app to test what I have
done
> > > so far.
> > >
> > > My problem is that when I reache the .save( ) command in my test app,
I
> > get:
> > >
> > > java.lang.NullPointerException
> > > at
> > > org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> > > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> > > at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
> > >
> > > Any ideas on how I can begin to track down my issue(s)?
> > >
> > > Background:
> > > 1) I am using the following information as my guide:
> > >
> > >
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
> > >
> > > 2) I have created a properties file named
/developer/torque/ndb.properties
> > > making slight modifications to use Postgresql instead of mysql -
> > namely:
> > > - I have modified the driver name to be org.postgresql.Driver,
> > > - the URL to be jdbc://localhost:5432/ndb_test
> > > - the username and password have also been set
> > > - I have modified the log4j settings to create a file name
> > > ndbTest.log
> > >
> > > 3) The schema.xml used the following to define the table I am trying
to
> > > uypdate:
> > > <table name="t1" idMethod="native" javaName="Acl">
> > > <column name="x1"
> > > javaName="AclId"
> > > primaryKey="true"
> > > required="true"
> > > autoIncrement="true"
> > > type="BIGINT" <!-- db.props defines BIGINT to be int4 -->
> > > </column>
> > > <column name="x2"
> > > javaName="ReadList"
> > > primaryKey="false"
> > > required="false"
> > > autoIncrement="false"
> > > size="1024"
> > > type="VARCHAR" <!-- db.props defines BIGINT to be
int4 -->
> > > </column>
> > > </table>
> > >
> > > 4) My code is as follows:
> > >
> > > import com.zeroton.ndb.om.*;
> > > import org.apache.torque.Torque;
> > > import org.apache.torque.Torque;
> > >
> > > public class ndbTest
> > > {
> > > public static void main(String[] args)
> > > {
> > > try
> > > {
> > > //Initialize torque
> > > Torque.init("/developer/torque/ndb.properties");
> > >
> > > //Create an ACL entry
> > > Acl refAcl = new Acl();
> > > //Set one of the fields
> > > refAcl.setReadList("ALL");
> > > //Save it
> > > refAcl.save(); <!-- **** this is the line
that
> > > is giving the error -->
> > >
> > > ... catch exceptions then loop/print table contents ...
> > >
> > > In the ndbTest.log file, the only Warning I see is the idBroker string
> > > reporting that it is connected to a database that does not support
> > > transactions. Since I am not using idBroker for my indexes, I did not
> > think
> > > this should concern me (?).
> > >
> > > TIA,
> > >
> > > Steve B.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to execute Torque (outside of Turbine) test application
Posted by John McNally <jm...@collab.net>.
If you have named your db "ndb_test" then you need some database
properties for that db.
e.g.
services.DatabaseService.database.ndb_test.driver=org.postgresql.Driver
^
john mcnally
sbelt wrote:
>
> More info:
>
> By putting some System.out messages in the BasetAcl.java code, I have
> narrowed it down. I am gagging on the command:
>
> dbCon = BasePeer.beginTransaction(dbName);
>
> I have verified that the dbName parameter is correctly set to "ndb_test". Is
> the fact that this method is called beginTransaction and the log message ~
> "connected to a database that does not support transactions" indication of
> my problem? Postgres supports transactions, right? Does this mean I have
> incorrect connection parameters?
>
> I have:
>
> services.DatabaseService.database.default=default
>
> services.DatabaseService.database.default.driver=org.postgresql.Driver
> services.DatabaseService.database.default.url=jdbc:postgresql://localhost/nd
> b_test
> services.DatabaseService.database.default.username=username
> # I have not yet set a password until I get things working
> services.DatabaseService.database.default.password=
>
> then
>
> services.DatabaseService.database.adapter=DBPostgres
> services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
>
> Is this not right? I'm afraid I am stuck at this point. :/
>
> Thanks for any assistance!
>
> Steve B.
>
> ----- Original Message -----
> From: "sbelt" <sb...@zeroton.com>
> To: <tu...@jakarta.apache.org>
> Sent: Wednesday, January 02, 2002 12:46 PM
> Subject: Unable to execute Torque (outside of Turbine) test application
>
> > Might someone be able to help?
> >
> > I am trying to create an application (called ndbTest) starting with
> Torque.
> > I have been able to create my database (named ndb_torque) using the
> scripts
> > created by Torque. Torque has also created my peer classes and compiled
> them
> > successfully. I am now trying to run a simple app to test what I have done
> > so far.
> >
> > My problem is that when I reache the .save( ) command in my test app, I
> get:
> >
> > java.lang.NullPointerException
> > at
> > org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> > at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> > at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
> >
> > Any ideas on how I can begin to track down my issue(s)?
> >
> > Background:
> > 1) I am using the following information as my guide:
> >
> > http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
> >
> > 2) I have created a properties file named /developer/torque/ndb.properties
> > making slight modifications to use Postgresql instead of mysql -
> namely:
> > - I have modified the driver name to be org.postgresql.Driver,
> > - the URL to be jdbc://localhost:5432/ndb_test
> > - the username and password have also been set
> > - I have modified the log4j settings to create a file name
> > ndbTest.log
> >
> > 3) The schema.xml used the following to define the table I am trying to
> > uypdate:
> > <table name="t1" idMethod="native" javaName="Acl">
> > <column name="x1"
> > javaName="AclId"
> > primaryKey="true"
> > required="true"
> > autoIncrement="true"
> > type="BIGINT" <!-- db.props defines BIGINT to be int4 -->
> > </column>
> > <column name="x2"
> > javaName="ReadList"
> > primaryKey="false"
> > required="false"
> > autoIncrement="false"
> > size="1024"
> > type="VARCHAR" <!-- db.props defines BIGINT to be int4 -->
> > </column>
> > </table>
> >
> > 4) My code is as follows:
> >
> > import com.zeroton.ndb.om.*;
> > import org.apache.torque.Torque;
> > import org.apache.torque.Torque;
> >
> > public class ndbTest
> > {
> > public static void main(String[] args)
> > {
> > try
> > {
> > //Initialize torque
> > Torque.init("/developer/torque/ndb.properties");
> >
> > //Create an ACL entry
> > Acl refAcl = new Acl();
> > //Set one of the fields
> > refAcl.setReadList("ALL");
> > //Save it
> > refAcl.save(); <!-- **** this is the line that
> > is giving the error -->
> >
> > ... catch exceptions then loop/print table contents ...
> >
> > In the ndbTest.log file, the only Warning I see is the idBroker string
> > reporting that it is connected to a database that does not support
> > transactions. Since I am not using idBroker for my indexes, I did not
> think
> > this should concern me (?).
> >
> > TIA,
> >
> > Steve B.
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Unable to execute Torque (outside of Turbine) test application
Posted by sbelt <sb...@velos.com>.
More info:
By putting some System.out messages in the BasetAcl.java code, I have
narrowed it down. I am gagging on the command:
dbCon = BasePeer.beginTransaction(dbName);
I have verified that the dbName parameter is correctly set to "ndb_test". Is
the fact that this method is called beginTransaction and the log message ~
"connected to a database that does not support transactions" indication of
my problem? Postgres supports transactions, right? Does this mean I have
incorrect connection parameters?
I have:
services.DatabaseService.database.default=default
services.DatabaseService.database.default.driver=org.postgresql.Driver
services.DatabaseService.database.default.url=jdbc:postgresql://localhost/nd
b_test
services.DatabaseService.database.default.username=username
# I have not yet set a password until I get things working
services.DatabaseService.database.default.password=
then
services.DatabaseService.database.adapter=DBPostgres
services.DatabaseService.database.adapter.DBPostgres=org.postgresql.Driver
Is this not right? I'm afraid I am stuck at this point. :/
Thanks for any assistance!
Steve B.
----- Original Message -----
From: "sbelt" <sb...@zeroton.com>
To: <tu...@jakarta.apache.org>
Sent: Wednesday, January 02, 2002 12:46 PM
Subject: Unable to execute Torque (outside of Turbine) test application
> Might someone be able to help?
>
> I am trying to create an application (called ndbTest) starting with
Torque.
> I have been able to create my database (named ndb_torque) using the
scripts
> created by Torque. Torque has also created my peer classes and compiled
them
> successfully. I am now trying to run a simple app to test what I have done
> so far.
>
> My problem is that when I reache the .save( ) command in my test app, I
get:
>
> java.lang.NullPointerException
> at
> org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
>
> Any ideas on how I can begin to track down my issue(s)?
>
> Background:
> 1) I am using the following information as my guide:
>
> http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg03639.html
>
> 2) I have created a properties file named /developer/torque/ndb.properties
> making slight modifications to use Postgresql instead of mysql -
namely:
> - I have modified the driver name to be org.postgresql.Driver,
> - the URL to be jdbc://localhost:5432/ndb_test
> - the username and password have also been set
> - I have modified the log4j settings to create a file name
> ndbTest.log
>
> 3) The schema.xml used the following to define the table I am trying to
> uypdate:
> <table name="t1" idMethod="native" javaName="Acl">
> <column name="x1"
> javaName="AclId"
> primaryKey="true"
> required="true"
> autoIncrement="true"
> type="BIGINT" <!-- db.props defines BIGINT to be int4 -->
> </column>
> <column name="x2"
> javaName="ReadList"
> primaryKey="false"
> required="false"
> autoIncrement="false"
> size="1024"
> type="VARCHAR" <!-- db.props defines BIGINT to be int4 -->
> </column>
> </table>
>
> 4) My code is as follows:
>
> import com.zeroton.ndb.om.*;
> import org.apache.torque.Torque;
> import org.apache.torque.Torque;
>
> public class ndbTest
> {
> public static void main(String[] args)
> {
> try
> {
> //Initialize torque
> Torque.init("/developer/torque/ndb.properties");
>
> //Create an ACL entry
> Acl refAcl = new Acl();
> //Set one of the fields
> refAcl.setReadList("ALL");
> //Save it
> refAcl.save(); <!-- **** this is the line that
> is giving the error -->
>
> ... catch exceptions then loop/print table contents ...
>
> In the ndbTest.log file, the only Warning I see is the idBroker string
> reporting that it is connected to a database that does not support
> transactions. Since I am not using idBroker for my indexes, I did not
think
> this should concern me (?).
>
> TIA,
>
> Steve B.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>