What you got is InvocationTargetException. It means your data object throws a NullPointerException. It's obviously not Castor problem. You should add a try catch block in your LingneDeCommande.setQuantite method and print the stack trace. -----Original Message----- >From: gilles dodinet [mailto:[EMAIL PROTECTED]] >Sent: Friday, July 27, 2001 7:12 AM >To: [EMAIL PROTECTED] >Subject: Re: [castor-dev] JDO : Problem with ResultsQuery.hasMore() > >well i just see that scheme below is not correct : the relationship >ProduitPromo/Produit is bi-directionnal ([PromoProduit]---[Produit] not >[PromoProduit]<>---[Produit]) but no matter.. i cant find what im doing >wrong.. > >thx.. > > > >>From: "gilles dodinet" <[EMAIL PROTECTED]> >>Reply-To: [EMAIL PROTECTED] >>To: [EMAIL PROTECTED] >>Subject: [castor-dev] JDO : Problem with ResultsQuery.hasMore() >>Date: Fri, 27 Jul 2001 13:58:28 +0000 >> >>hi, >> >>im trying to implement a composite-like schema using castor (without >>abstract classes and with n-n component/composite relationships) >>i got also with some troubles. just create a client is no problem. add a >>basic produit is no problem either. so here the problems (got two) : >>when i insert a command, first time no problem but the second time i got >>this exception : >> >>java.lang.reflect.InvocationTargetException: java.lang.NullPointerException >> at estore.LigneDeCommande.setQuantite(LigneDeCommande.java:47) >> at java.lang.reflect.Method.invoke(Native Method) >> at org.exolab.castor.persist.FieldMolder.setValue(FieldMolder.java:307) >> at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:672) >> at org.exolab.castor.persist.LockEngine.load(LockEngine.java:361) >> at >>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java: 545) >> at >>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java: 479) >> at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:742) >> at org.exolab.castor.persist.LockEngine.load(LockEngine.java:361) >> at >>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java: 545) >> at >>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java: 479) >> at org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:742) >> at org.exolab.castor.persist.LockEngine.load(LockEngine.java:361) >> at >>org.exolab.castor.persist.TransactionContext.load(TransactionContext.java: 545) >> at org.exolab.castor.persist.QueryResults.fetch(QueryResults.java:229) >> at >>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryI mpl.java:573) >> at >>org.exolab.castor.jdo.engine.OQLQueryImpl$OQLEnumeration.hasMore(OQLQueryI mpl.java:556) >> at estore.EstoreMain.populateCmds(EstoreMain.java:50) >> at estore.EstoreMain.goGoGo(EstoreMain.java:30) >> at estore.EstoreMain.main(EstoreMain.java:170) >> >>This exception occurs on ResultsQuery.hasMore() (OQLQuery string is a >>simplistic one : "select c from estore.Client c") >> >>Second problem with ProduitPromo : >>im not able anymore to insert although i have already succeded with it. >>yet >>i got a exception that i find not relevant at all (from jdbc driver) : >> >>java.sql.SQLException: Cannot convert class java.util.ArrayList to SQL type >>requested >> at >>org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:930) >> at >>org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:936) >> at org.exolab.castor.jdo.engine.SQLTypes.setObject(SQLTypes.java:388) >> at org.exolab.castor.jdo.engine.SQLEngine.create(SQLEngine.java:596) >> at org.exolab.castor.persist.ClassMolder.create(ClassMolder.java:866) >> at org.exolab.castor.persist.LockEngine.create(LockEngine.java:474) >> at >>org.exolab.castor.persist.TransactionContext.create(TransactionContext.jav a:705) >> at org.exolab.castor.jdo.engine.DatabaseImpl.create(DatabaseImpl.java:337) >> at estore.EstoreMain.populateProduits(EstoreMain.java:126) >> at estore.EstoreMain.goGoGo(EstoreMain.java:28) >> at estore.EstoreMain.main(EstoreMain.java:170) >> >>althought i dont use ArrayList at least but rather Vector (as in examples). >>this exception occurs on Database.create(ProduitPromotionnel pp) >> >> >> +-------+ >> |Client | >> +-------+ >> |1 >> | >> |* >>+---------+ +-----------------+ >>|Commande |1 <>--- * | LigneDeCommande | >>+---------+ +-----------------+ >> | >> | >> | >> +---------+ * >> | Produit |<>--------------| >> +---------+ | >> ^ | >> | | >> ________|________ | >> | | | >> | | | >> +--------------+ +--------------+ ___| * >> | BasicProduit | | ProduitPromo | >> +--------------+ +--------------+ >> >> >>I cant even imagine what is the problem... Could someone help me?? >>thanks for all (i realize thats a very long msg).. ( i join src code and >>xml >>mapping descriptors in zipped file if needed) >>another precision : i use mysql 3.23, jdbc driver is from gjt - version >>2.0.4, jdk version is 1.3, castor version is 0.9.3 >> >> >>Gilles Dodinet >>(Rhill as Well) >> >> >> >>_________________________________________________________________ >>T�l�chargez MSN Explorer gratuitement � l'adresse >>http://explorer.msn.fr/intl.asp >><< src.zip >> > > >_________________________________________________________________ >T�l�chargez MSN Explorer gratuitement � l'adresse >http://explorer.msn.fr/intl.asp > >----------------------------------------------------------- >If you wish to unsubscribe from this mailing, send mail to >[EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
