You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Hristo Kosev <hk...@yahoo.com> on 2001/08/28 14:01:48 UTC

NullPointerException when doInsert

hi
I receive a NullPointerException when I do doInsert or
save.
(I use MySQL, Turbine 2.1)
e.g. I have table MYTABLE + MytablePeer, Mytable
classes
MYTABLE columns -> ID(int autoincrement), NAME(string)
when I do:
DBConnection db = TurbineDB.getConnection();

Mytable mt = new MyTable();
mt.setName("Hello");
mt.save(db); // or MytablePeer.doInsert(mt, db);

The most strange is that the row is inserted into the
DB but I get the NullPointerException.

In MytableMapBuilder class the ID Broker is set to:
tMap.setPrimaryKeyMethod(TableMap.AUTOINCREMENT);

Here's the most important section of the exception
stacktrace:
java.lang.NullPointerException
        at
java.lang.StringBuffer.<init>(StringBuffer.java:130)
        at
com.workingdogs.village.QueryDataSet.<init>(QueryDataSet.java:110)
        at
org.apache.turbine.util.db.AutoIncrementIdGenerator.getIdAsVillageValue(AutoIncrementIdGenerator.java:198)
        at
org.apache.turbine.util.db.AutoIncrementIdGenerator.getIdAsBigDecimal(AutoIncrementIdGenerator.java:130)
        at
org.apache.turbine.om.peer.BasePeer.doInsert(BasePeer.java:777)
        at
sp.r2r.om.BaseMytablePeer.doInsert(BaseMytablePeer.java:138)
        at
sp.r2r.om.BaseMytablePeer.doInsert(BaseMytablePeer.java:374)
        at
sp.r2r.om.BaseMytable.save(BaseMytable.java:622)
        at
..........
.........

thanks in advance for any help.

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org