Re: createPrototypeCache NullPointerException
Hi Martin, Looks like your REST initialization is occurring before EOF is completely initialized. Some things to check: 1) Does your Application constructor call super()? (I remember we talked about this at WOWODC) 2) Does your application manipulate EOF in the main method or before the REST initialization? Could you try to delay the REST initialization? Like moving the initRest method call to the didFinishLaunching method. Does it work? Cheers, Henrique On 29/07/2013, at 16:20, Martin B wrote: > Hi everybody, > > I have a few Wonder applications that were deployed with Maven recently which > seem to be crashing randomly. Some are of these applications are completely > new, but others have been running for years (deployed with ANT) without such > problem. The stacktrace looks like this: > > 21951 [main] WARN NSLog - A fatal exception occurred: null > [2013-7-29 14:59:28 EDT] java.lang.NullPointerException > at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631) > at > com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699) > at > com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315) > at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367) > at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816) > at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789) > at > com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315) > at > er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33) > at > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542) > at > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519) > at com.oaciq.pfco.serveur.Application.initREST(Application.java:34) > at com.oaciq.pfco.serveur.Application.(Application.java:26) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:355) > at java.lang.Class.newInstance(Class.java:308) > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821) > at com.oaciq.pfco.serveur.Application.main(Application.java:21) > > I have tried many different things but I cannot find a solution. This is > driving me NUTS! Hints anyone? > > Thank you. > > Martin > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com > > This email sent to hpra...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
RE: createPrototypeCache NullPointerException
Thanks Fabian, I'm currently looking at both files, trying to compare them. The thing is that the Maven configuration file includes a lot more jars in the classpath that our previous configuration (like JavaWOJSPServlet and stuff like that) so I guess I will try to exclude a few things I don't need and see if it changes anything. Martin > Subject: Re: createPrototypeCache NullPointerException > From: lists.fab...@e-lumo.com > Date: Mon, 29 Jul 2013 22:00:55 +0200 > CC: syrinx2...@msn.com > To: webobjects-dev@lists.apple.com > > Hi Martin, > > Have you compared the classpath files of the ant- vs maven-built apps? If > you're deploying on unix: "YourApp.woa/Contents/UNIX/UNIXClassPath.txt" > > Fabian > > Am 29.07.2013 um 21:20 schrieb Martin B: > > > Hi everybody, > > > > I have a few Wonder applications that were deployed with Maven recently > > which seem to be crashing randomly. Some are of these applications are > > completely new, but others have been running for years (deployed with ANT) > > without such problem. The stacktrace looks like this: > > > > 21951 [main] WARN NSLog - A fatal exception occurred: null > > [2013-7-29 14:59:28 EDT] java.lang.NullPointerException > > at > > com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631) > > at > > com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699) > > at > > com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315) > > at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367) > > at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816) > > at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789) > > at > > com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315) > > at > > er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33) > > at > > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542) > > at > > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519) > > at com.oaciq.pfco.serveur.Application.initREST(Application.java:34) > > at com.oaciq.pfco.serveur.Application.(Application.java:26) > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > > at > > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > > at > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > > at java.lang.Class.newInstance0(Class.java:355) > > at java.lang.Class.newInstance(Class.java:308) > > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) > > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821) > > at com.oaciq.pfco.serveur.Application.main(Application.java:21) > > > > I have tried many different things but I cannot find a solution. This is > > driving me NUTS! Hints anyone? > > > > Thank you. > > > > Martin > > > > ___ > > Do not post admin requests to the list. They will be ignored. > > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > > Help/Unsubscribe/Update your Subscription: > > https://lists.apple.com/mailman/options/webobjects-dev/lists.fabian%40e-lumo.com > > > > This email sent to lists.fab...@e-lumo.com > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: createPrototypeCache NullPointerException
Hi Martin, Have you compared the classpath files of the ant- vs maven-built apps? If you're deploying on unix: "YourApp.woa/Contents/UNIX/UNIXClassPath.txt" Fabian Am 29.07.2013 um 21:20 schrieb Martin B: > Hi everybody, > > I have a few Wonder applications that were deployed with Maven recently which > seem to be crashing randomly. Some are of these applications are completely > new, but others have been running for years (deployed with ANT) without such > problem. The stacktrace looks like this: > > 21951 [main] WARN NSLog - A fatal exception occurred: null > [2013-7-29 14:59:28 EDT] java.lang.NullPointerException > at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631) > at > com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699) > at > com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315) > at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367) > at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816) > at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789) > at > com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315) > at > er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33) > at > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542) > at > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519) > at com.oaciq.pfco.serveur.Application.initREST(Application.java:34) > at com.oaciq.pfco.serveur.Application.(Application.java:26) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:355) > at java.lang.Class.newInstance(Class.java:308) > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821) > at com.oaciq.pfco.serveur.Application.main(Application.java:21) > > I have tried many different things but I cannot find a solution. This is > driving me NUTS! Hints anyone? > > Thank you. > > Martin > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/lists.fabian%40e-lumo.com > > This email sent to lists.fab...@e-lumo.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
createPrototypeCache NullPointerException
Hi everybody, I have a few Wonder applications that were deployed with Maven recently which seem to be crashing randomly. Some are of these applications are completely new, but others have been running for years (deployed with ANT) without such problem. The stacktrace looks like this: 21951 [main] WARN NSLog - A fatal exception occurred: null [2013-7-29 14:59:28 EDT] java.lang.NullPointerException at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631) at com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699) at com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315) at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367) at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816) at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789) at com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315) at er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33) at er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542) at er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519) at com.oaciq.pfco.serveur.Application.initREST(Application.java:34) at com.oaciq.pfco.serveur.Application.(Application.java:26) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821) at com.oaciq.pfco.serveur.Application.main(Application.java:21) I have tried many different things but I cannot find a solution. This is driving me NUTS! Hints anyone? Thank you. Martin ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException while using ERPersistentSessionStorage
Dear Ramsey, thx for your helpful suggestions. I followed them and many bugs disappeared. But at the end, there are still some showstoppers of type "The Fun™" - see stacktrace below. It happens, if I'm trying to save something back into the DB. It seems that deserialization of the persistent session always fails, if the session has to deal with one of my PMSUsers objects. My model is basically PMSUser.school() -> PMSSchool, PMSScholl.students() -> PMSUser I don't thinks, that this is a model t complicated. But I'm not sure. I am afraid that fixing this is beyond my WO knowledge. But if there are any hints I would try to dig into that. C.U.CW -- Christoph Wick - Diplom Informatiker, Managing Director i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany T +49 2 28 28 62 97 93 M +49 1 51 22 65 78 90 F +49 2 28 28 62 97 99 M c...@i4innovation.de W www.i4innovation.de Geschäftsführer: Thomas Heep, Christoph Wick Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: DE276502600 Jul 29 20:06:16 PMS[65432] WARN er.persistentsessionstorage.model.ERSessionInfo - Failed to deserialize session NullPointerException at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer.setObjectForIndex(_EOMutableKnownKeyDictionary.java:499) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_GenericRecordBinding.setValueInObject(_EOMutableKnownKeyDictionary.java:594) at er.extensions.eof.ERXGenericRecord$TouchingBinding.setValueInObject(ERXGenericRecord.java:220) at com.webobjects.eocontrol.EOCustomObject.takeStoredValueForKey(EOCustomObject.java:998) at er.extensions.eof.ERXGenericRecord.takeStoredValueForKey(ERXGenericRecord.java:1261) at de.i4innovation.bwinfpms.eo.PMSGenericRecord.takeStoredValueForKey(PMSGenericRecord.java:64) at com.webobjects.eocontrol.EOEditingContext._mergeValueForKey(EOEditingContext.java:663) at com.webobjects.eocontrol.EOEditingContext._mergeObjectWithChanges(EOEditingContext.java:3457) at com.webobjects.eocontrol.EOEditingContext.readObject(EOEditingContext.java:5367) ... skipped 4 stack elements at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.access$300(ObjectInputStream.java:205) at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2126) at java.io.ObjectInputStream.readFields(ObjectInputStream.java:537) at com.webobjects.eocontrol.EOCustomObject.readObject(EOCustomObject.java:1132) ... skipped 3 stack elements at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1685) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1341) at java.io.ObjectInputStream.access$300(ObjectInputStream.java:205) at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2126) at java.io.ObjectInputStream.readFields(ObjectInputStream.java:537) at com.webobjects.foundation.NSDictionary.readObject(NSDictionary.java:599) ... skipped 3 stack elements at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:498) at com.webobjects.appserver.WOSession.readObject(WOSession.java:538) ... skipped 4 stack elements at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1866) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at er.persistentsessionstorage.model.ERSessionInfo.sessionFromArchivedData(ERSessionInfo.java:86) at er.persistentsessionstorage.model.ERSessionInfo.session(ERSessionInfo.java:51) at er.persistentsessionstorage.ERPersistentSessionStore.restoreSessionWithID(ERPersistentSessionStore.java:32) at com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:182) at com.webobjects.appserver.WOApplication.restoreS
Re: NullPointerException while using ERPersistentSessionStorage
This is the result of some general bugginess in EOCustomObject and EOGenericRecord classes. Their serialization is intertwined in such a way as to cause null pointer exceptions. When you add the persistent session storage framework to your build path, make sure the framework is at the very top of your classpath just under ERExtensions. If it is listed below the EOControl framework, it will not work properly. It might work long enough to appear to be working properly, but you'll definitely get the NPEs at some point :-) If you still get NPEs after correctly ordering your build path, you may find there is still some bugginess in those two classes. I fixed them so that they work in all the cases I use them, but I have bumped into a couple of cases where the NPE rears its ugly head. Usually I just slightly change the way I'm doing something and it will disappear. For instance, in this case, you may try storing your user in your session.objectStore instead of on an iVar. If you hit a real blocker, or just feel like working on it, those two classes may still need a couple of tweaks to make serialization of EOs bulletproof. By the time I got to reimplementing them for persistent sessions, I was becoming bored with it :-) Fixing serialization bugs is The Fun™ Ramsey On Jul 29, 2013, at 5:57 AM, Christoph Wick wrote: > Hi List, > > I was trying to use ERPersistentSessionStorage (looks otherwise very > promising, thx Ramsey). > > I'm getting a silly NullPointerException (stacktrace below) in an application > that was working perfectly before without using ERPersistantSessionStorage. I > have no idea how to debug this to get more information. > > The problem may come from storing an EO object called PMSUser in the session > (basically a user object with name, login, passwd ... PMS=prefix for the > project's classes). The code is: > > public class Session extends ERXSession { > > private PMSUser currentUser = null; > > public PMSUser currentUser() { > return currentUser; > } > > public void setCurrentUser(PMSUser currentUser) { > this.currentUser = currentUser; > } > ... > } > > The page where the error occurs is the one where the user can change his/her > personal data using a form like > > >"$session.currentUser.firstName" /> > ... > > > > but NOT AFTER saving, but directly before rendering the page with the form. > > Any ideas? Thanks in advance, > C.U.CW > -- > > Christoph Wick - Diplom Informatiker, Managing Director > i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany > > T +49 2 28 28 62 97 93 > M +49 1 51 22 65 78 90 > F +49 2 28 28 62 97 99 > M c...@i4innovation.de > W www.i4innovation.de > > Geschäftsführer: Thomas Heep, Christoph Wick > Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: > DE276502600 > > > Jul 29 14:41:01 PMS[65432] WARN NSLog - > : Exception occurred > while handling request: > java.lang.NullPointerException > [2013-7-29 14:41:1 MESZ] java.lang.NullPointerException > at > com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:834) > at > er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:380) > at > com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) > at > er.extensions.eof.ERXGenericRecord$TouchingBinding.valueInObject(ERXGenericRecord.java:209) > at > com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:990) > at > com.webobjects.eocontrol.EOEditingContext._valuesForObject(EOEditingContext.java:790) > at > com.webobjects.eocontrol.EOCustomObject.writeObject(EOCustomObject.java:1125) > at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) > at > java.io.ObjectOutpu
NullPointerException while using ERPersistentSessionStorage
Hi List, I was trying to use ERPersistentSessionStorage (looks otherwise very promising, thx Ramsey). I'm getting a silly NullPointerException (stacktrace below) in an application that was working perfectly before without using ERPersistantSessionStorage. I have no idea how to debug this to get more information. The problem may come from storing an EO object called PMSUser in the session (basically a user object with name, login, passwd ... PMS=prefix for the project's classes). The code is: public class Session extends ERXSession { private PMSUser currentUser = null; public PMSUser currentUser() { return currentUser; } public void setCurrentUser(PMSUser currentUser) { this.currentUser = currentUser; } ... } The page where the error occurs is the one where the user can change his/her personal data using a form like ... but NOT AFTER saving, but directly before rendering the page with the form. Any ideas? Thanks in advance, C.U.CW -- Christoph Wick - Diplom Informatiker, Managing Director i4innovation GmbH, Professor-Neu-Allee 39, 53225 Bonn, Germany T +49 2 28 28 62 97 93 M +49 1 51 22 65 78 90 F +49 2 28 28 62 97 99 M c...@i4innovation.de W www.i4innovation.de Geschäftsführer: Thomas Heep, Christoph Wick Sitz der Gesellschaft: Bonn | Amtsgericht Bonn HRB 18548 | USt-IdNr.: DE276502600 Jul 29 14:41:01 PMS[65432] WARN NSLog - : Exception occurred while handling request: java.lang.NullPointerException [2013-7-29 14:41:1 MESZ] java.lang.NullPointerException at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:834) at er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:380) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) at er.extensions.eof.ERXGenericRecord$TouchingBinding.valueInObject(ERXGenericRecord.java:209) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:990) at com.webobjects.eocontrol.EOEditingContext._valuesForObject(EOEditingContext.java:790) at com.webobjects.eocontrol.EOCustomObject.writeObject(EOCustomObject.java:1125) at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170) at java.io.ObjectOutputStream.access$300(ObjectOutputStream.java:161) at java.io.ObjectOutputStream$PutFieldImpl.writeFields(ObjectOutputStream.java:1687) at java.io.ObjectOutputStream.writeFields(ObjectOutputStream.java:478) at com.webobjects.foundation.NSDictionary.writeObject(NSDictionary.java:594) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) at com.webobjects.appserver.WOComponent.writeObject(WOComponent.java:314) at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) at java.io.ObjectOutputStream.writeOrdi
Re: NullPointerException on non-null attribute
On 2012-11-14, at 11:49 AM, Maik Musall wrote: > Am 14.11.2012 um 17:57 schrieb Jesse Tayler : >> you got some backtrace on that funky action? > > Happens also when a method using that attribute is directly invoked by a wod > binding, in a component using autolocking. Any chance something in your bindings is setting these to null? I've seen that happen, especially if you are doing manual sync. > Am 14.11.2012 um 18:21 schrieb Chuck Hill : >> Also the EOModel checks are only enforced when saveChanges() runs. So it is >> possible that a bug in your code is setting these to null before you try to >> use them. > > Like I said, happens on *fetched* EOs, not on newly created ones. And as the > database has a NOT NULL constraint on the column, I don't see how that > attribute can end up being null in the fetched EO, except through a bug in > EOF. Just because it was not null when you fetched it, does not mean it is still not null when you try to use it. :-) Something could have happened in-between. In fact, I think that something MUST have happened. If this is at all reproducible, you can just throw a runtime exception in the set... method if the value is null. That should give you the stack track to track it down. Null relationships could mean that you are working with an EO that has been deleted. That would not explain null attributes. Chuck > > >> On 2012-11-14, at 9:16 AM, Ramsey Gurley wrote: >>> I have seen that in apps that violate the commandments: >>> >>> http://wiki.wocommunity.org/pages/viewpage.action?pageId=1050329 > > I have done my best to follow those, although it's a large application so I > can't rule out anything. Going through them just now, however I spotted two > awakeFromInsertion() that didn't call super, although not in the classes I > experienced those nasty NPE in. > > >>> If relationships are going missing and you are using nested ECs you may >>> want to try >>> >>> ec.setRetainsRegisteredObjects(true) >>> >>> There's a known bug where EOs can be GCed which can result in nulls coming >>> from required relationships. Nobody has managed to fix it in wonder yet. > > I know, I already have that set in every editingcontext, and it eliminated a > whole bunch of exceptions I frequently got before. > > > Maik > -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException on non-null attribute
Am 14.11.2012 um 17:57 schrieb Jesse Tayler : > you got some backtrace on that funky action? Happens also when a method using that attribute is directly invoked by a wod binding, in a component using autolocking. Am 14.11.2012 um 18:21 schrieb Chuck Hill : > Also the EOModel checks are only enforced when saveChanges() runs. So it is > possible that a bug in your code is setting these to null before you try to > use them. Like I said, happens on *fetched* EOs, not on newly created ones. And as the database has a NOT NULL constraint on the column, I don't see how that attribute can end up being null in the fetched EO, except through a bug in EOF. > On 2012-11-14, at 9:16 AM, Ramsey Gurley wrote: >> I have seen that in apps that violate the commandments: >> >> http://wiki.wocommunity.org/pages/viewpage.action?pageId=1050329 I have done my best to follow those, although it's a large application so I can't rule out anything. Going through them just now, however I spotted two awakeFromInsertion() that didn't call super, although not in the classes I experienced those nasty NPE in. >> If relationships are going missing and you are using nested ECs you may want >> to try >> >> ec.setRetainsRegisteredObjects(true) >> >> There's a known bug where EOs can be GCed which can result in nulls coming >> from required relationships. Nobody has managed to fix it in wonder yet. I know, I already have that set in every editingcontext, and it eliminated a whole bunch of exceptions I frequently got before. Maik ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException on non-null attribute
Also the EOModel checks are only enforced when saveChanges() runs. So it is possible that a bug in your code is setting these to null before you try to use them. Chuck On 2012-11-14, at 9:16 AM, Ramsey Gurley wrote: > > On Nov 14, 2012, at 8:54 AM, Maik Musall wrote: > >> Hi, >> >> occasionally I get a NullPointerException on an attribute of a fetched EO >> that is >> * set to not nullable in EOModel >> * guarded to be not null by a NOT NULL constraint in the database >> * and actually has a value there. >> >> This happens with both simple values like BigDecimals, as well as with >> relationships. >> >> Any idea what could cause that or what I could do to nail it down? >> >> Thanks >> Maik > > I have seen that in apps that violate the commandments: > > http://wiki.wocommunity.org/pages/viewpage.action?pageId=1050329 > > If relationships are going missing and you are using nested ECs you may want > to try > > ec.setRetainsRegisteredObjects(true) > > There's a known bug where EOs can be GCed which can result in nulls coming > from required relationships. Nobody has managed to fix it in wonder yet. > > Ramsey > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjects Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException on non-null attribute
On Nov 14, 2012, at 8:54 AM, Maik Musall wrote: > Hi, > > occasionally I get a NullPointerException on an attribute of a fetched EO > that is > * set to not nullable in EOModel > * guarded to be not null by a NOT NULL constraint in the database > * and actually has a value there. > > This happens with both simple values like BigDecimals, as well as with > relationships. > > Any idea what could cause that or what I could do to nail it down? > > Thanks > Maik I have seen that in apps that violate the commandments: http://wiki.wocommunity.org/pages/viewpage.action?pageId=1050329 If relationships are going missing and you are using nested ECs you may want to try ec.setRetainsRegisteredObjects(true) There's a known bug where EOs can be GCed which can result in nulls coming from required relationships. Nobody has managed to fix it in wonder yet. Ramsey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException on non-null attribute
you got some backtrace on that funky action? On Nov 14, 2012, at 10:54 AM, Maik Musall wrote: > Hi, > > occasionally I get a NullPointerException on an attribute of a fetched EO > that is > * set to not nullable in EOModel > * guarded to be not null by a NOT NULL constraint in the database > * and actually has a value there. > > This happens with both simple values like BigDecimals, as well as with > relationships. > > Any idea what could cause that or what I could do to nail it down? > > Thanks > Maik > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com > > This email sent to jtay...@oeinc.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NullPointerException on non-null attribute
Hi, occasionally I get a NullPointerException on an attribute of a fetched EO that is * set to not nullable in EOModel * guarded to be not null by a NOT NULL constraint in the database * and actually has a value there. This happens with both simple values like BigDecimals, as well as with relationships. Any idea what could cause that or what I could do to nail it down? Thanks Maik ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in EODatabaseContext java
I supposed that the component ec should be created within the component itself. So that any invalid objects will not affect other ec. - Original Message - From: Raghavender Bokka To: Cheong Hee (Gmail) Cc: Development WebObjects Sent: Friday, June 01, 2012 7:16 PM Subject: Re: NullPointerException in EODatabaseContext java Hi Cheong Hee, I am using the localEditingContext() method of GenericComponent class which internally creates the ERXEC.newEditingContext(). Please advise if this not the component-based ec. Regards, Raghu. On 01-Jun-2012, at 4:35 PM, Cheong Hee (Gmail) wrote: Hi Raghu May be you really need to look at how the object model design. Usually, once the invalidate all objects, the ec will fetch again new objects and theirs object graph. May be some code will be helpful. Also, pls remember to have component-based ec. Cheers Cheong Hee - Original Message - From: "Raghavender Bokka" To: "Cheong Hee (Gmail)" Cc: "Development WebObjects" Sent: Friday, June 01, 2012 2:17 PM Subject: Re: NullPointerException in EODatabaseContext java Hi Cheong Hee, I tried invalidating the objects in ec, then we are able to view the details of this eo object, but the other similar objects in the wodisplaygroup list is behaving weirdly when they are selected. Regards, Raghu. On 01-Jun-2012, at 11:41 AM, Cheong Hee (Gmail) wrote: i guessed one quick way is to invalidate the objects in ec and force it to refetch from db. - Original Message - From: "Raghavender Bokka" To: "Development WebObjects" Sent: Thursday, May 31, 2012 9:04 PM Subject: NullPointerException in EODatabaseContext java Hi Team, I have created an enterprise object with one-to-many relationship objects associating. Then in the search page searched for these enterprise objects (that has WODisplayGroup), I am able to view the newly created object, but when I try to select that object to view the details it is generating the following exception. If I restart the application then I am able to view the details of the newly created object without any error, or If we try accessing the newly created object after sometime (around half an hour later) then without error able to view the object details. Otherwise the enterprise object is getting null. This enterprise object's super class has the database table, and this object does not has the database table, it points to the same database table of the super class. And the to-many relationship is existing with this enterprise object (sub-class), not the super class. Any help would be appreciated. EXCEPTION-- [2012-5-31 8:25:4 EDT] java.lang.NullPointerException at com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) at com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) at com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at StoredTestListPage.printTestSession(StoredTestListPage.java:276) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Re: NullPointerException in EODatabaseContext java
Hi Cheong Hee, I am using the localEditingContext() method of GenericComponent class which internally creates the ERXEC.newEditingContext(). Please advise if this not the component-based ec. Regards, Raghu. On 01-Jun-2012, at 4:35 PM, Cheong Hee (Gmail) wrote: > Hi Raghu > > May be you really need to look at how the object model design. Usually, once > the invalidate all objects, the ec will fetch again new objects and theirs > object graph. May be some code will be helpful. Also, pls remember to have > component-based ec. > > Cheers > > Cheong Hee > > - Original Message - From: "Raghavender Bokka" > > To: "Cheong Hee (Gmail)" > Cc: "Development WebObjects" > Sent: Friday, June 01, 2012 2:17 PM > Subject: Re: NullPointerException in EODatabaseContext java > > > Hi Cheong Hee, > > I tried invalidating the objects in ec, then we are able to view the details > of this eo object, but the other similar objects in the wodisplaygroup list > is behaving weirdly when they are selected. > > Regards, > Raghu. > > On 01-Jun-2012, at 11:41 AM, Cheong Hee (Gmail) wrote: > >> i guessed one quick way is to invalidate the objects in ec and force it to >> refetch from db. >> >> - Original Message - From: "Raghavender Bokka" >> >> To: "Development WebObjects" >> Sent: Thursday, May 31, 2012 9:04 PM >> Subject: NullPointerException in EODatabaseContext java >> >> >>> Hi Team, >>> >>> I have created an enterprise object with one-to-many relationship objects >>> associating. Then in the search page searched for these enterprise objects >>> (that has WODisplayGroup), I am able to view the newly created object, but >>> when I try to select that object to view the details it is generating the >>> following exception. If I restart the application then I am able to view >>> the details of the newly created object without any error, or If we try >>> accessing the newly created object after sometime (around half an hour >>> later) then without error able to view the object details. Otherwise the >>> enterprise object is getting null. >>> >>> This enterprise object's super class has the database table, and this >>> object does not has the database table, it points to the same database >>> table of the super class. And the to-many relationship is existing with >>> this enterprise object (sub-class), not the super class. >>> >>> Any help would be appreciated. >>> >>> EXCEPTION-- >>> [2012-5-31 8:25:4 EDT] java.lang.NullPointerException >>> at >>> com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) >>> at >>> com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) >>> at >>> com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) >>> at >>> com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) >>> at >>> com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) >>> at >>> com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) >>> at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>> at java.lang.reflect.Method.invoke(Method.java:597) >>> at >>> KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) >>> at >>> com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) >>> at >>> com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) >>> at >>> com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) >>> at >>> com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) >>> at java.lang.String.valueOf(String.java:2826) >>> at java.la
Re: NullPointerException in EODatabaseContext java
Hi Raghu May be you really need to look at how the object model design. Usually, once the invalidate all objects, the ec will fetch again new objects and theirs object graph. May be some code will be helpful. Also, pls remember to have component-based ec. Cheers Cheong Hee - Original Message - From: "Raghavender Bokka" To: "Cheong Hee (Gmail)" Cc: "Development WebObjects" Sent: Friday, June 01, 2012 2:17 PM Subject: Re: NullPointerException in EODatabaseContext java Hi Cheong Hee, I tried invalidating the objects in ec, then we are able to view the details of this eo object, but the other similar objects in the wodisplaygroup list is behaving weirdly when they are selected. Regards, Raghu. On 01-Jun-2012, at 11:41 AM, Cheong Hee (Gmail) wrote: i guessed one quick way is to invalidate the objects in ec and force it to refetch from db. - Original Message - From: "Raghavender Bokka" To: "Development WebObjects" Sent: Thursday, May 31, 2012 9:04 PM Subject: NullPointerException in EODatabaseContext java Hi Team, I have created an enterprise object with one-to-many relationship objects associating. Then in the search page searched for these enterprise objects (that has WODisplayGroup), I am able to view the newly created object, but when I try to select that object to view the details it is generating the following exception. If I restart the application then I am able to view the details of the newly created object without any error, or If we try accessing the newly created object after sometime (around half an hour later) then without error able to view the object details. Otherwise the enterprise object is getting null. This enterprise object's super class has the database table, and this object does not has the database table, it points to the same database table of the super class. And the to-many relationship is existing with this enterprise object (sub-class), not the super class. Any help would be appreciated. EXCEPTION-- [2012-5-31 8:25:4 EDT] java.lang.NullPointerException at com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) at com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) at com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at StoredTestListPage.printTestSession(StoredTestListPage.java:276) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WO
Re: NullPointerException in EODatabaseContext java
Hi Cheong Hee, I tried invalidating the objects in ec, then we are able to view the details of this eo object, but the other similar objects in the wodisplaygroup list is behaving weirdly when they are selected. Regards, Raghu. On 01-Jun-2012, at 11:41 AM, Cheong Hee (Gmail) wrote: > i guessed one quick way is to invalidate the objects in ec and force it to > refetch from db. > > - Original Message - From: "Raghavender Bokka" > > To: "Development WebObjects" > Sent: Thursday, May 31, 2012 9:04 PM > Subject: NullPointerException in EODatabaseContext java > > >> Hi Team, >> >> I have created an enterprise object with one-to-many relationship objects >> associating. Then in the search page searched for these enterprise objects >> (that has WODisplayGroup), I am able to view the newly created object, but >> when I try to select that object to view the details it is generating the >> following exception. If I restart the application then I am able to view >> the details of the newly created object without any error, or If we try >> accessing the newly created object after sometime (around half an hour >> later) then without error able to view the object details. Otherwise the >> enterprise object is getting null. >> >> This enterprise object's super class has the database table, and this object >> does not has the database table, it points to the same database table of the >> super class. And the to-many relationship is existing with this enterprise >> object (sub-class), not the super class. >> >> Any help would be appreciated. >> >> EXCEPTION-- >> [2012-5-31 8:25:4 EDT] java.lang.NullPointerException >> at >> com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) >> at >> com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) >> at >> com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) >> at >> com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) >> at >> com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) >> at >> com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) >> at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) >> at >> com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) >> at >> com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) >> at >> com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) >> at >> com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) >> at java.lang.String.valueOf(String.java:2826) >> at java.lang.StringBuilder.append(StringBuilder.java:115) >> at StoredTestListPage.printTestSession(StoredTestListPage.java:276) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) >> at >> com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) >> at >> com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) >> at >> com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) >> at >> com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) >> at >> com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImp
Re: NullPointerException in EODatabaseContext java
i guessed one quick way is to invalidate the objects in ec and force it to refetch from db. - Original Message - From: "Raghavender Bokka" To: "Development WebObjects" Sent: Thursday, May 31, 2012 9:04 PM Subject: NullPointerException in EODatabaseContext java Hi Team, I have created an enterprise object with one-to-many relationship objects associating. Then in the search page searched for these enterprise objects (that has WODisplayGroup), I am able to view the newly created object, but when I try to select that object to view the details it is generating the following exception. If I restart the application then I am able to view the details of the newly created object without any error, or If we try accessing the newly created object after sometime (around half an hour later) then without error able to view the object details. Otherwise the enterprise object is getting null. This enterprise object's super class has the database table, and this object does not has the database table, it points to the same database table of the super class. And the to-many relationship is existing with this enterprise object (sub-class), not the super class. Any help would be appreciated. EXCEPTION-- [2012-5-31 8:25:4 EDT] java.lang.NullPointerException at com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) at com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) at com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at StoredTestListPage.printTestSession(StoredTestListPage.java:276) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804) at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50) at com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:98) at er.extensions.components._private.ERXHyperlink.invokeAction(ERXHyperlink.java:66) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamic
Re: NullPointerException in EODatabaseContext java
Something is wrong with your model or how you are creating this new object. Are you setting the relationship both ways? On 2012-05-31, at 6:04 AM, Raghavender Bokka wrote: > Hi Team, > > I have created an enterprise object with one-to-many relationship objects > associating. Then in the search page searched for these enterprise objects > (that has WODisplayGroup), I am able to view the newly created object, but > when I try to select that object to view the details it is generating the > following exception. If I restart the application then I am able to view > the details of the newly created object without any error, or If we try > accessing the newly created object after sometime (around half an hour later) > then without error able to view the object details. Otherwise the enterprise > object is getting null. > > This enterprise object's super class has the database table, and this object > does not has the database table, it points to the same database table of the > super class. And the to-many relationship is existing with this enterprise > object (sub-class), not the super class. > > Any help would be appreciated. > > EXCEPTION-- > [2012-5-31 8:25:4 EDT] java.lang.NullPointerException >at > com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) >at > com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) >at > com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) >at > com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) >at > com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) >at > com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) >at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >at java.lang.reflect.Method.invoke(Method.java:597) >at > KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) >at > com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) >at > com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) >at > com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) >at > com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) >at java.lang.String.valueOf(String.java:2826) >at java.lang.StringBuilder.append(StringBuilder.java:115) >at StoredTestListPage.printTestSession(StoredTestListPage.java:276) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >at java.lang.reflect.Method.invoke(Method.java:597) >at > KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) >at > com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) >at > com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) >at > com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) >at > com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) >at > com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) >at > com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804) >at > com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50) >at > com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:98) >at > er.extensions.components._private.ERXHyperlink.invokeAction(ERXHyperlink.java:66) >at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >at > er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) >at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >at > com.webobjects.appserver._
NullPointerException in EODatabaseContext java
Hi Team, I have created an enterprise object with one-to-many relationship objects associating. Then in the search page searched for these enterprise objects (that has WODisplayGroup), I am able to view the newly created object, but when I try to select that object to view the details it is generating the following exception. If I restart the application then I am able to view the details of the newly created object without any error, or If we try accessing the newly created object after sometime (around half an hour later) then without error able to view the object details. Otherwise the enterprise object is getting null. This enterprise object's super class has the database table, and this object does not has the database table, it points to the same database table of the super class. And the to-many relationship is existing with this enterprise object (sub-class), not the super class. Any help would be appreciated. EXCEPTION-- [2012-5-31 8:25:4 EDT] java.lang.NullPointerException at com.webobjects.eoaccess.EODatabaseContext.arrayFaultWithSourceGlobalID(EODatabaseContext.java:3510) at com.webobjects.eoaccess.EODatabaseContext._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2377) at com.webobjects.eoaccess.EOAccessDeferredFaultHandler.createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614) at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at _StoredDistrictTest.storedTestItems(_StoredDistrictTest.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1498) at com.webobjects.eocontrol.EOCustomObject.eoDescription(EOCustomObject.java:793) at com.webobjects.eocontrol.EOCustomObject.toString(EOCustomObject.java:299) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at StoredTestListPage.printTestSession(StoredTestListPage.java:276) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:60) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804) at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50) at com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:98) at er.extensions.components._private.ERXHyperlink.invokeAction(ERXHyperlink.java:66) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver._private.WOConditional.invokeAction(WOConditional.java:86) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynam
Re: NullPointerException
Hi Ken, Also we should not call toString() method on e.getCause() because it's not always necessary you get a cause if the exception is already at it's origin. Here is a sample code to test this: Farrukh public class ExceptionTest { public static void printCause(Throwable t) { System.err.println(t.toString()); printCause(t.getCause()); } public static void main(String[] args) { try { throw new Exception("Testing"); } catch(Exception e) { printCause(e); } } } Farrukhs-MacBook-Pro:TopCoder fijaz$ java ExceptionTest java.lang.Exception: Testing Exception in thread "main" java.lang.NullPointerException at ExceptionTest.printCause(ExceptionTest.java:4) at ExceptionTest.printCause(ExceptionTest.java:5) at ExceptionTest.main(ExceptionTest.java:12) On 2012-04-12, at 9:08 PM, Ken Anderson wrote: > 94try{ > 95System.out.println(editingContext.toString()); > 96me.editingContext().saveChanges(); > 97 } catch (Exception e){ > 98System.out.println(me._primaryKey); > 99 > System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); > 100 System.out.println(e.getCause().toString()); ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException
Yep! It was a concurrency issue in the utility. All I needed to do was add that PrintStackTrace to the catch block to point me in the right direction. Thanks as always! Ken Anderson k...@watermarkstudios.com On Apr 12, 2012, at 10:46 AM, Chuck Hill wrote: > Keep following the trace, what is on > at com.digitalesdesign.pup.util.WorkerQueue.addTask(WorkerQueue.java:53) > > And what is calling that on >> at >> com.digitalesdesign.pup.dataobjects.Address.willUpdate(Address.java:160) > > > Chuck > > On 2012-04-12, at 10:43 AM, Ken Anderson wrote: > >> This is not my code. I'm still figuring it out myself, but the ec's all >> match up by id. I did the printstacktrace: >> >> java.lang.NullPointerException >> at com.digitalesdesign.pup.util.WorkerQueue.addTask(WorkerQueue.java:53) >> at >> com.digitalesdesign.pup.dataobjects.Address.willUpdate(Address.java:160) >> at >> er.extensions.eof.ERXEnterpriseObject$4.perform(ERXEnterpriseObject.java:196) >> at >> er.extensions.eof.ERXEnterpriseObject$Processor.perform(ERXEnterpriseObject.java:163) >> at >> er.extensions.eof.ERXEnterpriseObject$Observer.editingContextWillSaveChanges(ERXEnterpriseObject.java:74) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) >> at >> com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) >> at >> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) >> at >> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) >> at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1014) >> at >> com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:96) >> at >> com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:122) >> at >> com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) >> at com.digitalesdesign.pup.Application.(Application.java:34) >> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >> at >> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >> at >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >> at java.lang.Class.newInstance0(Class.java:355) >> at java.lang.Class.newInstance(Class.java:308) >> at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) >> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) >> at com.digitalesdesign.pup.Application.main(Application.java:26) >> >> Ken Anderson >> k...@watermarkstudios.com >> >> >> >> On Apr 12, 2012, at 10:37 AM, Chuck Hill wrote: >> >>> >>> On 2012-04-12, at 10:25 AM, Ken Anderson wrote: >>> >>>> The editing context is passed in as a parameter and checked between lines >>>> 68-73. >>>> >>>> This is line 68-73: >>>> >>>>68 Address me = this; >>>>69 >>>>70 if (editingContext() != editingContext) { >>>>71System.out.println("ec not matched"); >>>>72 me = this.localInstanceIn(editingContext); >>> >>> That seems confusing. You are using editingContext, editingContext(), and >>> me.editingContext(). >>> >>> >>>>73 } >>>> >>>> And this is line 94-101: >>>> >>>>94 try{ >>>>95System.out.println(editingContext.toString()); >>>>96me.editingContext().saveChanges(); >>>>97 } catch (Exception e){ >>>>98System.out.println(me._primaryKey); >>>>99 >>>> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); >>>>100 System.out.println(e.getCause().toString()); >>> >>> So
Re: NullPointerException
Keep following the trace, what is on at com.digitalesdesign.pup.util.WorkerQueue.addTask(WorkerQueue.java:53) And what is calling that on > at > com.digitalesdesign.pup.dataobjects.Address.willUpdate(Address.java:160) Chuck On 2012-04-12, at 10:43 AM, Ken Anderson wrote: > This is not my code. I'm still figuring it out myself, but the ec's all match > up by id. I did the printstacktrace: > > java.lang.NullPointerException > at com.digitalesdesign.pup.util.WorkerQueue.addTask(WorkerQueue.java:53) > at > com.digitalesdesign.pup.dataobjects.Address.willUpdate(Address.java:160) > at > er.extensions.eof.ERXEnterpriseObject$4.perform(ERXEnterpriseObject.java:196) > at > er.extensions.eof.ERXEnterpriseObject$Processor.perform(ERXEnterpriseObject.java:163) > at > er.extensions.eof.ERXEnterpriseObject$Observer.editingContextWillSaveChanges(ERXEnterpriseObject.java:74) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) > at > com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) > at > com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) > at > com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) > at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1014) > at > com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:96) > at > com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:122) > at > com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) > at com.digitalesdesign.pup.Application.(Application.java:34) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:355) > at java.lang.Class.newInstance(Class.java:308) > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) > at com.digitalesdesign.pup.Application.main(Application.java:26) > > Ken Anderson > k...@watermarkstudios.com > > > > On Apr 12, 2012, at 10:37 AM, Chuck Hill wrote: > >> >> On 2012-04-12, at 10:25 AM, Ken Anderson wrote: >> >>> The editing context is passed in as a parameter and checked between lines >>> 68-73. >>> >>> This is line 68-73: >>> >>> 68 Address me = this; >>> 69 >>> 70 if (editingContext() != editingContext) { >>> 71System.out.println("ec not matched"); >>> 72 me = this.localInstanceIn(editingContext); >> >> That seems confusing. You are using editingContext, editingContext(), and >> me.editingContext(). >> >> >>> 73 } >>> >>> And this is line 94-101: >>> >>> 94 try{ >>> 95System.out.println(editingContext.toString()); >>> 96me.editingContext().saveChanges(); >>> 97 } catch (Exception e){ >>> 98System.out.println(me._primaryKey); >>> 99 >>> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); >>> 100 System.out.println(e.getCause().toString()); >> >> So if the exception is happening on line 100, then e.getCause() is null, no? >> Try e.printStackTrace(); >> >> >> Chuck >> >>> 101 } >>> >>> Ken Anderson >>> k...@watermarkstudios.com >>> >>> >>> >>> On Apr 12, 2012, at 10:14 AM, Chuck Hill wrote: >>> >>>> Which is line 100? My first guess is that editingContext != >>>> me.editingContext() and further that me has been deleted or is otherwise >>>> no longer in an valid editing
Re: NullPointerException
This is not my code. I'm still figuring it out myself, but the ec's all match up by id. I did the printstacktrace: java.lang.NullPointerException at com.digitalesdesign.pup.util.WorkerQueue.addTask(WorkerQueue.java:53) at com.digitalesdesign.pup.dataobjects.Address.willUpdate(Address.java:160) at er.extensions.eof.ERXEnterpriseObject$4.perform(ERXEnterpriseObject.java:196) at er.extensions.eof.ERXEnterpriseObject$Processor.perform(ERXEnterpriseObject.java:163) at er.extensions.eof.ERXEnterpriseObject$Observer.editingContextWillSaveChanges(ERXEnterpriseObject.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) at com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1014) at com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:96) at com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:122) at com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) at com.digitalesdesign.pup.Application.(Application.java:34) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) at com.digitalesdesign.pup.Application.main(Application.java:26) Ken Anderson k...@watermarkstudios.com On Apr 12, 2012, at 10:37 AM, Chuck Hill wrote: > > On 2012-04-12, at 10:25 AM, Ken Anderson wrote: > >> The editing context is passed in as a parameter and checked between lines >> 68-73. >> >> This is line 68-73: >> >> 68 Address me = this; >> 69 >> 70 if (editingContext() != editingContext) { >> 71System.out.println("ec not matched"); >> 72 me = this.localInstanceIn(editingContext); > > That seems confusing. You are using editingContext, editingContext(), and > me.editingContext(). > > >> 73 } >> >> And this is line 94-101: >> >> 94 try{ >> 95System.out.println(editingContext.toString()); >> 96me.editingContext().saveChanges(); >> 97 } catch (Exception e){ >> 98System.out.println(me._primaryKey); >> 99 >> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); >> 100 System.out.println(e.getCause().toString()); > > So if the exception is happening on line 100, then e.getCause() is null, no? > Try e.printStackTrace(); > > > Chuck > >> 101 } >> >> Ken Anderson >> k...@watermarkstudios.com >> >> >> >> On Apr 12, 2012, at 10:14 AM, Chuck Hill wrote: >> >>> Which is line 100? My first guess is that editingContext != >>> me.editingContext() and further that me has been deleted or is otherwise no >>> longer in an valid editing context. >>> >>> >>> On 2012-04-12, at 10:05 AM, Ken Anderson wrote: >>> >>>> Okay...another issue from a revision project. If you need any other >>>> information to make the situation clearer, let me know. I keep getting a >>>> NullPointerException in the following code. Keep in mind that "me" is an >>>> Address object and this block of code is contained in a method that is >>>> triggered to give the exception. All of my System.out.println() efforts >>>> return positive results: >>>> >>>>"try{ >>>> System
Re: NullPointerException
On 2012-04-12, at 10:25 AM, Ken Anderson wrote: > The editing context is passed in as a parameter and checked between lines > 68-73. > > This is line 68-73: > > 68 Address me = this; > 69 > 70 if (editingContext() != editingContext) { > 71System.out.println("ec not matched"); > 72 me = this.localInstanceIn(editingContext); That seems confusing. You are using editingContext, editingContext(), and me.editingContext(). > 73 } > > And this is line 94-101: > > 94 try{ > 95System.out.println(editingContext.toString()); > 96me.editingContext().saveChanges(); > 97 } catch (Exception e){ > 98System.out.println(me._primaryKey); > 99 > System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); > 100 System.out.println(e.getCause().toString()); So if the exception is happening on line 100, then e.getCause() is null, no? Try e.printStackTrace(); Chuck > 101 } > > Ken Anderson > k...@watermarkstudios.com > > > > On Apr 12, 2012, at 10:14 AM, Chuck Hill wrote: > >> Which is line 100? My first guess is that editingContext != >> me.editingContext() and further that me has been deleted or is otherwise no >> longer in an valid editing context. >> >> >> On 2012-04-12, at 10:05 AM, Ken Anderson wrote: >> >>> Okay...another issue from a revision project. If you need any other >>> information to make the situation clearer, let me know. I keep getting a >>> NullPointerException in the following code. Keep in mind that "me" is an >>> Address object and this block of code is contained in a method that is >>> triggered to give the exception. All of my System.out.println() efforts >>> return positive results: >>> >>> "try{ >>> System.out.println(editingContext.toString()); >>> me.editingContext().saveChanges(); >>> } catch (Exception e){ >>> System.out.println(me._primaryKey); >>> >>> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); >>> System.out.println(e.getCause().toString()); >>> } >>> System.out.println("ec saved for: " + >>> me.getAddressForMap(true));" >>> >>> Printout: >>> >>> "r.extensions.eof.ERXEC@7a4fe91e >>> 1010660 >>> 42 Rue Perron >>> java.lang.NullPointerException >>> >>> at >>> com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:100) >>> >>> at >>> com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:120) >>> >>> at >>> com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) >>> >>> at com.digitalesdesign.pup.Application.(Application.java:34) >>> >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >>> >>> at >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >>> >>> at >>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >>> >>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>> >>> at java.lang.Class.newInstance0(Class.java:355) >>> >>> at java.lang.Class.newInstance(Class.java:308) >>> >>> at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) >>> >>> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) >>> >>> at com.digitalesdesign.pup.Application.main(Application.java:26)" >>> >>> >>> Ken Anderson >>> k...@watermarkstudios.com >>> >>> >>> >>> ___ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >>> >>> This email sent to ch...@global-village.net >> >> -- >> Chuck Hill Senior Co
Re: NullPointerException
The editing context is passed in as a parameter and checked between lines 68-73. This is line 68-73: 68 Address me = this; 69 70 if (editingContext() != editingContext) { 71System.out.println("ec not matched"); 72 me = this.localInstanceIn(editingContext); 73 } And this is line 94-101: 94 try{ 95System.out.println(editingContext.toString()); 96me.editingContext().saveChanges(); 97 } catch (Exception e){ 98System.out.println(me._primaryKey); 99 System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); 100 System.out.println(e.getCause().toString()); 101 } Ken Anderson k...@watermarkstudios.com On Apr 12, 2012, at 10:14 AM, Chuck Hill wrote: > Which is line 100? My first guess is that editingContext != > me.editingContext() and further that me has been deleted or is otherwise no > longer in an valid editing context. > > > On 2012-04-12, at 10:05 AM, Ken Anderson wrote: > >> Okay...another issue from a revision project. If you need any other >> information to make the situation clearer, let me know. I keep getting a >> NullPointerException in the following code. Keep in mind that "me" is an >> Address object and this block of code is contained in a method that is >> triggered to give the exception. All of my System.out.println() efforts >> return positive results: >> >> "try{ >>System.out.println(editingContext.toString()); >>me.editingContext().saveChanges(); >> } catch (Exception e){ >>System.out.println(me._primaryKey); >> >> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); >>System.out.println(e.getCause().toString()); >> } >> System.out.println("ec saved for: " + >> me.getAddressForMap(true));" >> >> Printout: >> >> "r.extensions.eof.ERXEC@7a4fe91e >> 1010660 >> 42 Rue Perron >> java.lang.NullPointerException >> >> at >> com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:100) >> >> at >> com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:120) >> >> at >> com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) >> >> at com.digitalesdesign.pup.Application.(Application.java:34) >> >> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >> >> at >> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >> >> at >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >> >> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >> >> at java.lang.Class.newInstance0(Class.java:355) >> >> at java.lang.Class.newInstance(Class.java:308) >> >> at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) >> >> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) >> >> at com.digitalesdesign.pup.Application.main(Application.java:26)" >> >> >> Ken Anderson >> k...@watermarkstudios.com >> >> >> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >> >> This email sent to ch...@global-village.net > > -- > Chuck Hill Senior Consultant / VP Development > > Practical WebObjects - for developers who want to increase their overall > knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/gvc/practical_webobjects > > > > > > > > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException
Which is line 100? My first guess is that editingContext != me.editingContext() and further that me has been deleted or is otherwise no longer in an valid editing context. On 2012-04-12, at 10:05 AM, Ken Anderson wrote: > Okay...another issue from a revision project. If you need any other > information to make the situation clearer, let me know. I keep getting a > NullPointerException in the following code. Keep in mind that "me" is an > Address object and this block of code is contained in a method that is > triggered to give the exception. All of my System.out.println() efforts > return positive results: > > "try{ > System.out.println(editingContext.toString()); > me.editingContext().saveChanges(); > } catch (Exception e){ > System.out.println(me._primaryKey); > > System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); > System.out.println(e.getCause().toString()); > } > System.out.println("ec saved for: " + > me.getAddressForMap(true));" > > Printout: > > "r.extensions.eof.ERXEC@7a4fe91e > 1010660 > 42 Rue Perron > java.lang.NullPointerException > > at > com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:100) > > at > com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:120) > > at > com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) > > at com.digitalesdesign.pup.Application.(Application.java:34) > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > > at java.lang.Class.newInstance0(Class.java:355) > > at java.lang.Class.newInstance(Class.java:308) > > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) > > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) > > at com.digitalesdesign.pup.Application.main(Application.java:26)" > > > Ken Anderson > k...@watermarkstudios.com > > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/gvc/practical_webobjects smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NullPointerException
Okay...another issue from a revision project. If you need any other information to make the situation clearer, let me know. I keep getting a NullPointerException in the following code. Keep in mind that "me" is an Address object and this block of code is contained in a method that is triggered to give the exception. All of my System.out.println() efforts return positive results: "try{ System.out.println(editingContext.toString()); me.editingContext().saveChanges(); } catch (Exception e){ System.out.println(me._primaryKey); System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY)); System.out.println(e.getCause().toString()); } System.out.println("ec saved for: " + me.getAddressForMap(true));" Printout: "r.extensions.eof.ERXEC@7a4fe91e 1010660 42 Rue Perron java.lang.NullPointerException at com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:100) at com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:120) at com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176) at com.digitalesdesign.pup.Application.(Application.java:34) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at com.webobjects.appserver.WOApplication.main(WOApplication.java:547) at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826) at com.digitalesdesign.pup.Application.main(Application.java:26)" Ken Anderson k...@watermarkstudios.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException
I was pretty sure it was something I was doing. Yes, I just did a copy and paste. Thanks again. Sent from my iPhone On Dec 4, 2011, at 2:48 AM, Paul D Yu wrote: > Kevin > > This is a java or may be even programming issue, NOT a WebObjects one. > > Because of the || or operator, the runtime has to evaluate the second portion > of the condition. Since errorMessage is null, length() of errorMessage will > throw the exception... > > Paul > > Sent from my iPad > > On Dec 4, 2011, at 3:22 AM, Philippe Rabier wrote: > >> Hi Kevin >> >> You have to use a && operator when you test if your string is not null and >> length > 0. ;-) >> >> Bad copy/paste I guess. >> >> Your code is clean. >> >> Philippe >> >> Sent from my iPhone >> >> On 4 déc. 2011, at 09:01, Kevin Spake wrote: >> >>> Still working on the WebObjects, WOlips and Wonder tutorial, part 2... >>> >>> Getting a null pointer exception. I've spent hours trying to figure out the >>> issue, but I just don't have the experience to properly trouble shoot it. >>> The stack trace is below, and below that is the code for my DirectAction. >>> The console says the error occurs on line 55, which is "if (errorMessage != >>> null || errorMessage.length() != 0) { " >>> >>> The thing is, errorMessage is null at this point. I've entered in valid >>> user credentials, the session object has been created. The currentUser and >>> nextPage objects are not null. nextPage is set to "AdminPage". As soon >>> as I try to step into the "if (errorMessage != null || >>> errorMessage.length() != 0) {"line the exception occurs. Is this a >>> scope issue? >>> >>> Thanks. >>> >>> >>> Application: SooperSeekrit Error: java.lang.NullPointerException Reason: >>> Stack trace: >>> FileLine# Method Package >>> DirectAction.java 55 loginAction com.sooperseekrit.app >>> NativeMethodAccessorImpl.java NA invoke0 sun.reflect >>> NativeMethodAccessorImpl.java 39 invoke sun.reflect >>> DelegatingMethodAccessorImpl.java 25 invoke sun.reflect >>> Method.java 597 invoke java.lang.reflect >>> WODirectAction.java 144 performActionNamed com.webobjects.appserver >>> ERXDirectAction.java401 performActionNamed >>> er.extensions.appserver >>> WOActionRequestHandler.java 259 _handleRequest >>> com.webobjects.appserver._private >>> WOActionRequestHandler.java 158 handleRequest >>> com.webobjects.appserver._private >>> ERXDirectActionRequestHandler.java 126 handleRequest >>> er.extensions.appserver >>> WOApplication.java 1687dispatchRequest com.webobjects.appserver >>> ERXApplication.java 2021dispatchRequestImmediately >>> er.extensions.appserver >>> ERXApplication.java 1986dispatchRequest er.extensions.appserver >>> WOWorkerThread.java 144 runOnce com.webobjects.appserver._private >>> WOWorkerThread.java 226 run com.webobjects.appserver._private >>> Thread.java 680 run java.lang >>> >>> >>> >>> >>> >>> package com.sooperseekrit.app; >>> >>> import java.util.NoSuchElementException; >>> >>> import com.webobjects.appserver.WOActionResults; >>> import com.webobjects.appserver.WOComponent; >>> import com.webobjects.appserver.WORequest; >>> import com.webobjects.eocontrol.EOQualifier; >>> >>> import er.extensions.appserver.ERXDirectAction; >>> import er.extensions.eof.ERXEC; >>> >>> import com.sooperseekrit.components.AdminPage; >>> import com.sooperseekrit.components.Main; >>> import com.sooperseekrit.components.UserPage; >>> import com.sooperseekrit.model.User; >>> >>> public class DirectAction extends ERXDirectAction { >>> public DirectAction(WORequest request) { >>> super(request); >>> } >>> >>> >>> @Override >>> public WOActionResults defaultAction() { >>> return pageWithName(Main.class.getName()); >>> } >>> >>> public WOActionResults loginAction() { >>> >>> WOComponent nextPage = null; >>> String username = request().stringFormValueForKey("username"); >>> String password = request().stringFormValueForKey("password"); >>> String errorMessage = null; >>> if (username == null || username.length() == 0 || >>> password == null || password.length() == 0) { >>> errorMessage = "Please enter a username and password"; >>> } else { >>> try { >>> EOQualifier qual = >>> User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); >>> User user = >>> User.fetchRequiredUser(ERXEC.newEditingContext(), qual); >>> ((Session)session()).set_currentUser(user); >>> if (user.group().name().equals("Admin")) { >>> nextPage = >>> pageWithName(AdminPage.class.getName()); >>> } else if (us
Re: NullPointerException
Kevin This is a java or may be even programming issue, NOT a WebObjects one. Because of the || or operator, the runtime has to evaluate the second portion of the condition. Since errorMessage is null, length() of errorMessage will throw the exception... Paul Sent from my iPad On Dec 4, 2011, at 3:22 AM, Philippe Rabier wrote: > Hi Kevin > > You have to use a && operator when you test if your string is not null and > length > 0. ;-) > > Bad copy/paste I guess. > > Your code is clean. > > Philippe > > Sent from my iPhone > > On 4 déc. 2011, at 09:01, Kevin Spake wrote: > >> Still working on the WebObjects, WOlips and Wonder tutorial, part 2... >> >> Getting a null pointer exception. I've spent hours trying to figure out the >> issue, but I just don't have the experience to properly trouble shoot it. >> The stack trace is below, and below that is the code for my DirectAction. >> The console says the error occurs on line 55, which is "if (errorMessage != >> null || errorMessage.length() != 0) { " >> >> The thing is, errorMessage is null at this point. I've entered in valid user >> credentials, the session object has been created. The currentUser and >> nextPage objects are not null. nextPage is set to "AdminPage". As soon as >> I try to step into the "if (errorMessage != null || errorMessage.length() != >> 0) {"line the exception occurs. Is this a scope issue? >> >> Thanks. >> >> >> Application: SooperSeekrit Error: java.lang.NullPointerException Reason: >> Stack trace: >> File Line# Method Package >> DirectAction.java55 loginAction com.sooperseekrit.app >> NativeMethodAccessorImpl.javaNA invoke0 sun.reflect >> NativeMethodAccessorImpl.java39 invoke sun.reflect >> DelegatingMethodAccessorImpl.java25 invoke sun.reflect >> Method.java 597 invoke java.lang.reflect >> WODirectAction.java 144 performActionNamed com.webobjects.appserver >> ERXDirectAction.java 401 performActionNamed er.extensions.appserver >> WOActionRequestHandler.java 259 _handleRequest >> com.webobjects.appserver._private >> WOActionRequestHandler.java 158 handleRequest >> com.webobjects.appserver._private >> ERXDirectActionRequestHandler.java 126 handleRequest >> er.extensions.appserver >> WOApplication.java 1687dispatchRequest com.webobjects.appserver >> ERXApplication.java 2021dispatchRequestImmediately >> er.extensions.appserver >> ERXApplication.java 1986dispatchRequest er.extensions.appserver >> WOWorkerThread.java 144 runOnce com.webobjects.appserver._private >> WOWorkerThread.java 226 run com.webobjects.appserver._private >> Thread.java 680 run java.lang >> >> >> >> >> >> package com.sooperseekrit.app; >> >> import java.util.NoSuchElementException; >> >> import com.webobjects.appserver.WOActionResults; >> import com.webobjects.appserver.WOComponent; >> import com.webobjects.appserver.WORequest; >> import com.webobjects.eocontrol.EOQualifier; >> >> import er.extensions.appserver.ERXDirectAction; >> import er.extensions.eof.ERXEC; >> >> import com.sooperseekrit.components.AdminPage; >> import com.sooperseekrit.components.Main; >> import com.sooperseekrit.components.UserPage; >> import com.sooperseekrit.model.User; >> >> public class DirectAction extends ERXDirectAction { >> public DirectAction(WORequest request) { >> super(request); >> } >> >> >> @Override >> public WOActionResults defaultAction() { >> return pageWithName(Main.class.getName()); >> } >> >> public WOActionResults loginAction() { >> >> WOComponent nextPage = null; >> String username = request().stringFormValueForKey("username"); >> String password = request().stringFormValueForKey("password"); >> String errorMessage = null; >> if (username == null || username.length() == 0 || >> password == null || password.length() == 0) { >> errorMessage = "Please enter a username and password"; >> } else { >> try { >> EOQualifier qual = >> User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); >> User user = >> User.fetchRequiredUser(ERXEC.newEditingContext(), qual); >> ((Session)session()).set_currentUser(user); >> if (user.group().name().equals("Admin")) { >> nextPage = >> pageWithName(AdminPage.class.getName()); >> } else if (user.group().name().equals("User")) { >> nextPage = >> pageWithName(UserPage.class.getName()); >> } >> } catch (NoSuchElementException e) { >> errorMessage = "No user found for those >> c
Re: NullPointerException
Hi Kevin You have to use a && operator when you test if your string is not null and length > 0. ;-) Bad copy/paste I guess. Your code is clean. Philippe Sent from my iPhone On 4 déc. 2011, at 09:01, Kevin Spake wrote: > Still working on the WebObjects, WOlips and Wonder tutorial, part 2... > > Getting a null pointer exception. I've spent hours trying to figure out the > issue, but I just don't have the experience to properly trouble shoot it. The > stack trace is below, and below that is the code for my DirectAction. The > console says the error occurs on line 55, which is "if (errorMessage != null > || errorMessage.length() != 0) { " > > The thing is, errorMessage is null at this point. I've entered in valid user > credentials, the session object has been created. The currentUser and > nextPage objects are not null. nextPage is set to "AdminPage". As soon as > I try to step into the "if (errorMessage != null || errorMessage.length() != > 0) {"line the exception occurs. Is this a scope issue? > > Thanks. > > > Application: SooperSeekrit Error: java.lang.NullPointerException Reason: > Stack trace: > File Line# Method Package > DirectAction.java 55 loginAction com.sooperseekrit.app > NativeMethodAccessorImpl.java NA invoke0 sun.reflect > NativeMethodAccessorImpl.java 39 invoke sun.reflect > DelegatingMethodAccessorImpl.java 25 invoke sun.reflect > Method.java 597 invoke java.lang.reflect > WODirectAction.java 144 performActionNamed com.webobjects.appserver > ERXDirectAction.java 401 performActionNamed er.extensions.appserver > WOActionRequestHandler.java 259 _handleRequest > com.webobjects.appserver._private > WOActionRequestHandler.java 158 handleRequest > com.webobjects.appserver._private > ERXDirectActionRequestHandler.java126 handleRequest > er.extensions.appserver > WOApplication.java1687dispatchRequest com.webobjects.appserver > ERXApplication.java 2021dispatchRequestImmediately > er.extensions.appserver > ERXApplication.java 1986dispatchRequest er.extensions.appserver > WOWorkerThread.java 144 runOnce com.webobjects.appserver._private > WOWorkerThread.java 226 run com.webobjects.appserver._private > Thread.java 680 run java.lang > > > > > > package com.sooperseekrit.app; > > import java.util.NoSuchElementException; > > import com.webobjects.appserver.WOActionResults; > import com.webobjects.appserver.WOComponent; > import com.webobjects.appserver.WORequest; > import com.webobjects.eocontrol.EOQualifier; > > import er.extensions.appserver.ERXDirectAction; > import er.extensions.eof.ERXEC; > > import com.sooperseekrit.components.AdminPage; > import com.sooperseekrit.components.Main; > import com.sooperseekrit.components.UserPage; > import com.sooperseekrit.model.User; > > public class DirectAction extends ERXDirectAction { > public DirectAction(WORequest request) { > super(request); > } > > > @Override > public WOActionResults defaultAction() { > return pageWithName(Main.class.getName()); > } > > public WOActionResults loginAction() { > > WOComponent nextPage = null; > String username = request().stringFormValueForKey("username"); > String password = request().stringFormValueForKey("password"); > String errorMessage = null; > if (username == null || username.length() == 0 || > password == null || password.length() == 0) { > errorMessage = "Please enter a username and password"; > } else { > try { > EOQualifier qual = > User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); > User user = > User.fetchRequiredUser(ERXEC.newEditingContext(), qual); > ((Session)session()).set_currentUser(user); > if (user.group().name().equals("Admin")) { > nextPage = > pageWithName(AdminPage.class.getName()); > } else if (user.group().name().equals("User")) { > nextPage = > pageWithName(UserPage.class.getName()); > } > } catch (NoSuchElementException e) { > errorMessage = "No user found for those > credentials"; > } catch (Exception e) { > // something bad happened > } > } > > if (errorMessage != null || errorMessage.length() != 0) { > nextPage = pageWithName(Main.class.getName()); > nextPage.takeValueForKey(errorMessage, "errorMessage"); > nextPa
NullPointerException
Still working on the WebObjects, WOlips and Wonder tutorial, part 2... Getting a null pointer exception. I've spent hours trying to figure out the issue, but I just don't have the experience to properly trouble shoot it. The stack trace is below, and below that is the code for my DirectAction. The console says the error occurs on line 55, which is "if (errorMessage != null || errorMessage.length() != 0) { " The thing is, errorMessage is null at this point. I've entered in valid user credentials, the session object has been created. The currentUser and nextPage objects are not null. nextPage is set to "AdminPage". As soon as I try to step into the "if (errorMessage != null || errorMessage.length() != 0) {" line the exception occurs. Is this a scope issue? Thanks. Application: SooperSeekrit Error: java.lang.NullPointerException Reason: Stack trace: FileLine# Method Package DirectAction.java 55 loginAction com.sooperseekrit.app NativeMethodAccessorImpl.java NA invoke0 sun.reflect NativeMethodAccessorImpl.java 39 invoke sun.reflect DelegatingMethodAccessorImpl.java 25 invoke sun.reflect Method.java 597 invoke java.lang.reflect WODirectAction.java 144 performActionNamed com.webobjects.appserver ERXDirectAction.java401 performActionNamed er.extensions.appserver WOActionRequestHandler.java 259 _handleRequest com.webobjects.appserver._private WOActionRequestHandler.java 158 handleRequest com.webobjects.appserver._private ERXDirectActionRequestHandler.java 126 handleRequest er.extensions.appserver WOApplication.java 1687dispatchRequest com.webobjects.appserver ERXApplication.java 2021dispatchRequestImmediately er.extensions.appserver ERXApplication.java 1986dispatchRequest er.extensions.appserver WOWorkerThread.java 144 runOnce com.webobjects.appserver._private WOWorkerThread.java 226 run com.webobjects.appserver._private Thread.java 680 run java.lang package com.sooperseekrit.app; import java.util.NoSuchElementException; import com.webobjects.appserver.WOActionResults; import com.webobjects.appserver.WOComponent; import com.webobjects.appserver.WORequest; import com.webobjects.eocontrol.EOQualifier; import er.extensions.appserver.ERXDirectAction; import er.extensions.eof.ERXEC; import com.sooperseekrit.components.AdminPage; import com.sooperseekrit.components.Main; import com.sooperseekrit.components.UserPage; import com.sooperseekrit.model.User; public class DirectAction extends ERXDirectAction { public DirectAction(WORequest request) { super(request); } @Override public WOActionResults defaultAction() { return pageWithName(Main.class.getName()); } public WOActionResults loginAction() { WOComponent nextPage = null; String username = request().stringFormValueForKey("username"); String password = request().stringFormValueForKey("password"); String errorMessage = null; if (username == null || username.length() == 0 || password == null || password.length() == 0) { errorMessage = "Please enter a username and password"; } else { try { EOQualifier qual = User.USERNAME.eq(username).and(User.PASSWORD.eq(password)); User user = User.fetchRequiredUser(ERXEC.newEditingContext(), qual); ((Session)session()).set_currentUser(user); if (user.group().name().equals("Admin")) { nextPage = pageWithName(AdminPage.class.getName()); } else if (user.group().name().equals("User")) { nextPage = pageWithName(UserPage.class.getName()); } } catch (NoSuchElementException e) { errorMessage = "No user found for those credentials"; } catch (Exception e) { // something bad happened } } if (errorMessage != null || errorMessage.length() != 0) { nextPage = pageWithName(Main.class.getName()); nextPage.takeValueForKey(errorMessage, "errorMessage"); nextPage.takeValueForKey(username, "username"); nextPage.takeValueForKey(password, "password"); } return nextPage; } } ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing lis
Re: Weird NullPointerException
Thanks Chuck, you made my day. Cheers ---markus--- On 25.03.2011, at 18:47, Chuck Hill wrote: > Hi Markus, > > > On Mar 25, 2011, at 3:41 AM, Markus Ruggiero wrote: > >> I have an EO that has business logic for creating an PDF file. There is a >> WOComponent that generates an XML which is then fed to ApacheFOP. Following >> code is in the EO: >> >> GeneratedDocument.java >> >> public void generatePDF(WOComponent sender) { >> if (sender == null) { >> return; >> } >> >> String generatorName = xmlGeneratorClassName(); >> if (generatorName != null) { >> XmlGeneratorComponent xmlGenerator = >> (XmlGeneratorComponent)sender.pageWithName(generatorName); > > That might be a problem there. Try this instead: > XmlGeneratorComponent xmlGenerator = > (XmlGeneratorComponent)WOApplication.application().pageWithName(generatorName, > new WOContent(sender.context().request())); > > It is usually safer to create a new context for things like this. > > > Chuck > > >> PDFGenerator pdfGenerator = >> PDFGenerator.sharedInstance(); >> pdfGenerator.generatePdfFile( this, xmlGenerator ); >> } >> else { >> log.error( "*** No xmlGeneratorClassName available" ); >> } >> } >> >> >> Depending on the context I call this I get a NullPointerException or not. >> This is the NPE, context info follows below: >> >> Mar 25 11:13:49 ec_admin[13000] WARN NSLog - >> : Exception >> occurred while handling request: >> java.lang.NullPointerException >> [2011-3-25 11:13:49 CET] java.lang.NullPointerException >> at >> com.webobjects.appserver._private.WOComponentReference._popComponentFromContext(WOComponentReference.java:108) >> at >> com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:128) >> at >> er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >> at >> er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >> at >> er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:113) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >> at >> er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:104) >> at >> com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) >> at >> com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >> at >> com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >> at >> com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) >> at >> com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) >> at >> er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) >> at >> com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) >> at >> com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) >> at er.directtoweb.pages.ERD2WPage.invokeAction(ERD2WPage.java:619) >> at >> er.directtoweb.pages.ERD2WListPage.invokeAction(ERD2WListPage.java:479) >> at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357) >&
Re: Weird NullPointerException
Hi Markus, On Mar 25, 2011, at 3:41 AM, Markus Ruggiero wrote: > I have an EO that has business logic for creating an PDF file. There is a > WOComponent that generates an XML which is then fed to ApacheFOP. Following > code is in the EO: > > GeneratedDocument.java > > public void generatePDF(WOComponent sender) { > if (sender == null) { > return; > } > > String generatorName = xmlGeneratorClassName(); > if (generatorName != null) { > XmlGeneratorComponent xmlGenerator = > (XmlGeneratorComponent)sender.pageWithName(generatorName); That might be a problem there. Try this instead: XmlGeneratorComponent xmlGenerator = (XmlGeneratorComponent)WOApplication.application().pageWithName(generatorName, new WOContent(sender.context().request())); It is usually safer to create a new context for things like this. Chuck > PDFGenerator pdfGenerator = > PDFGenerator.sharedInstance(); > pdfGenerator.generatePdfFile( this, xmlGenerator ); > } > else { > log.error( "*** No xmlGeneratorClassName available" ); > } > } > > > Depending on the context I call this I get a NullPointerException or not. > This is the NPE, context info follows below: > > Mar 25 11:13:49 ec_admin[13000] WARN NSLog - > : Exception > occurred while handling request: > java.lang.NullPointerException > [2011-3-25 11:13:49 CET] java.lang.NullPointerException > at > com.webobjects.appserver._private.WOComponentReference._popComponentFromContext(WOComponentReference.java:108) > at > com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:128) > at > er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) > at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) > at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) > at > er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) > at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) > at > er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:113) > at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) > at > er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:104) > at > com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) > at > com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) > at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) > at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) > at > com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38) > at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) > at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) > at > com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) > at > com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) > at > er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) > at > com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) > at > com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) > at > com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) > at er.directtoweb.pages.ERD2WPage.invokeAction(ERD2WPage.java:619) > at > er.directtoweb.pages.ERD2WListPage.invokeAction(ERD2WListPage.java:479) > at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357) > at > com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745) > at > er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:93) > at > er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1863) > at > com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:206) >
Weird NullPointerException
I have an EO that has business logic for creating an PDF file. There is a WOComponent that generates an XML which is then fed to ApacheFOP. Following code is in the EO: GeneratedDocument.java public void generatePDF(WOComponent sender) { if (sender == null) { return; } String generatorName = xmlGeneratorClassName(); if (generatorName != null) { XmlGeneratorComponent xmlGenerator = (XmlGeneratorComponent)sender.pageWithName(generatorName); PDFGenerator pdfGenerator = PDFGenerator.sharedInstance(); pdfGenerator.generatePdfFile( this, xmlGenerator ); } else { log.error( "*** No xmlGeneratorClassName available" ); } } Depending on the context I call this I get a NullPointerException or not. This is the NPE, context info follows below: Mar 25 11:13:49 ec_admin[13000] WARN NSLog - : Exception occurred while handling request: java.lang.NullPointerException [2011-3-25 11:13:49 CET] java.lang.NullPointerException at com.webobjects.appserver._private.WOComponentReference._popComponentFromContext(WOComponentReference.java:108) at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:128) at er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er.extensions.components._private.ERXWORepetition.invokeAction(ERXWORepetition.java:496) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at er.extensions.components.conditionals.ERXWOConditional.invokeChildrenAction(ERXWOConditional.java:113) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er.extensions.components.conditionals.ERXWOConditional.invokeAction(ERXWOConditional.java:104) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver._private.WOComponentContent.invokeAction(WOComponentContent.java:38) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:127) at er.extensions.components._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:1079) at er.directtoweb.pages.ERD2WPage.invokeAction(ERD2WPage.java:619) at er.directtoweb.pages.ERD2WListPage.invokeAction(ERD2WListPage.java:479) at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357) at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1745) at er.extensions.appserver.ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:93) at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1863) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:206) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:298) at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332) at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:369) at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:442) at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687) at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1978)
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
On Sep 4, 2010, at 11:12 AM, Mike Schrag wrote: > No way apple's soca teach prototypes, right? I seem to recall those soca only > teach bad practices. Yeah, the apple soca fwe narki in places. er, whatever. > Sent from my iPhone Apparently. :-P I missed the Apple reference, only the Wiki link sunk in. Didn't someone make proper directions? http://wiki.objectstyle.org/confluence/display/WO/Home http://www.wocommunity.org/ Hmmm, guess not. Chuck > On Sep 4, 2010, at 10:46 AM, Chuck Hill wrote: > >> Or the prototypes are not configured or not loading properly? >> >> >> On Sep 4, 2010, at 10:40 AM, Mike Schrag wrote: >> >>> I don't have source in front of me at the moment, but I seem to recall this >>> is when you accidentally forget to fill in the external type of an >>> attribute (the "varchar" part). Go back through the attributes in your >>> model and give then a once-over. I should really add a check to entity >>> modeler for JDBC attributes with missing required values. >>> >>> Sent from my iPhone >>> >>> On Sep 4, 2010, at 4:58 AM, Marvin wrote: >>> Hi, I am new to WebObjects and am working through the documentation and Apple's Movies tutorial found here: http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. I am running on Mac OS 10.6.4. I was able to get WebObects installed (version 5.4.3) along with the WOLips plugin for eclipse obtained from: http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I installed it using method 2. I am using the built in VelocityEOGenerator with the Entity.java templates obtained from: http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. I have created the Movies database and have generated the Movies entities using the EO Generator and can launch the application but when I do a search as instructed in the tutorial I get the following exception. I have searched this mailing list archive and the web for elements of this error but have not had any luck Does anyone have any idea what is going wrong? Thanks for the help. Marvin [2010-9-4 4:3:15 EDT] Waiting for requests... java.lang.NullPointerException at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) at com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) at com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) at
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
Thanks Mike and Chuck. I did forget to enter values for the external types. I had been through the steps to set up the EOModel so many times trying to get it to work that I eventually convinced myself that the docs were wrong and those values weren't used for anything. Eventually I just started overlooking them in the setup. It would help to have warnings for required fields. Thanks for getting me unstuck. Marvin On Sep 4, 2010, at 11:13 AM, Mike Schrag wrote: > soca? Apparently the iPhone thought I wanted to say soca instead of docs. > > Sent from my iPhone > > On Sep 4, 2010, at 11:12 AM, Mike Schrag wrote: > >> No way apple's soca teach prototypes, right? I seem to recall those soca >> only teach bad practices. >> >> Sent from my iPhone >> >> On Sep 4, 2010, at 10:46 AM, Chuck Hill wrote: >> >>> Or the prototypes are not configured or not loading properly? >>> >>> >>> On Sep 4, 2010, at 10:40 AM, Mike Schrag wrote: >>> I don't have source in front of me at the moment, but I seem to recall this is when you accidentally forget to fill in the external type of an attribute (the "varchar" part). Go back through the attributes in your model and give then a once-over. I should really add a check to entity modeler for JDBC attributes with missing required values. Sent from my iPhone On Sep 4, 2010, at 4:58 AM, Marvin wrote: > Hi, > > I am new to WebObjects and am working through the documentation and > Apple's Movies tutorial found here: > http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. > > I am running on Mac OS 10.6.4. > > I was able to get WebObects installed (version 5.4.3) along with the > WOLips plugin for eclipse obtained from: > http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I > installed it using method 2. > > I am using the built in VelocityEOGenerator with the Entity.java > templates obtained from: > http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. > > I have created the Movies database and have generated the Movies entities > using the EO Generator and can launch the application but when I do a > search as instructed in the tutorial I get the following exception. I > have searched this mailing list archive and the web for elements of this > error but have not had any luck Does anyone have any idea what is going > wrong? > > Thanks for the help. > > Marvin > > > [2010-9-4 4:3:15 EDT] Waiting for requests... > java.lang.NullPointerException > at > com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) > at > com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) > at > com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) > at > com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) > at > com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) > at > com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) > at > com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) > at > com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) > at > com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) > at > com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:319
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
soca? Apparently the iPhone thought I wanted to say soca instead of docs. Sent from my iPhone On Sep 4, 2010, at 11:12 AM, Mike Schrag wrote: > No way apple's soca teach prototypes, right? I seem to recall those soca only > teach bad practices. > > Sent from my iPhone > > On Sep 4, 2010, at 10:46 AM, Chuck Hill wrote: > >> Or the prototypes are not configured or not loading properly? >> >> >> On Sep 4, 2010, at 10:40 AM, Mike Schrag wrote: >> >>> I don't have source in front of me at the moment, but I seem to recall this >>> is when you accidentally forget to fill in the external type of an >>> attribute (the "varchar" part). Go back through the attributes in your >>> model and give then a once-over. I should really add a check to entity >>> modeler for JDBC attributes with missing required values. >>> >>> Sent from my iPhone >>> >>> On Sep 4, 2010, at 4:58 AM, Marvin wrote: >>> Hi, I am new to WebObjects and am working through the documentation and Apple's Movies tutorial found here: http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. I am running on Mac OS 10.6.4. I was able to get WebObects installed (version 5.4.3) along with the WOLips plugin for eclipse obtained from: http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I installed it using method 2. I am using the built in VelocityEOGenerator with the Entity.java templates obtained from: http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. I have created the Movies database and have generated the Movies entities using the EO Generator and can launch the application but when I do a search as instructed in the tutorial I get the following exception. I have searched this mailing list archive and the web for elements of this error but have not had any luck Does anyone have any idea what is going wrong? Thanks for the help. Marvin [2010-9-4 4:3:15 EDT] Waiting for requests... java.lang.NullPointerException at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) at com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) at com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) at your.app.eo._Movie.fetchMovies(_Movie.java:84) at your.app.components.Main.searchMovies(Main.java:75) at sunreflect.NativeMethodAccessorImpl.invoke0(Native Method)
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
No way apple's soca teach prototypes, right? I seem to recall those soca only teach bad practices. Sent from my iPhone On Sep 4, 2010, at 10:46 AM, Chuck Hill wrote: > Or the prototypes are not configured or not loading properly? > > > On Sep 4, 2010, at 10:40 AM, Mike Schrag wrote: > >> I don't have source in front of me at the moment, but I seem to recall this >> is when you accidentally forget to fill in the external type of an attribute >> (the "varchar" part). Go back through the attributes in your model and give >> then a once-over. I should really add a check to entity modeler for JDBC >> attributes with missing required values. >> >> Sent from my iPhone >> >> On Sep 4, 2010, at 4:58 AM, Marvin wrote: >> >>> Hi, >>> >>> I am new to WebObjects and am working through the documentation and Apple's >>> Movies tutorial found here: >>> http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. >>> >>> I am running on Mac OS 10.6.4. >>> >>> I was able to get WebObects installed (version 5.4.3) along with the WOLips >>> plugin for eclipse obtained from: >>> http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I >>> installed it using method 2. >>> >>> I am using the built in VelocityEOGenerator with the Entity.java templates >>> obtained from: >>> http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. >>> >>> I have created the Movies database and have generated the Movies entities >>> using the EO Generator and can launch the application but when I do a >>> search as instructed in the tutorial I get the following exception. I have >>> searched this mailing list archive and the web for elements of this error >>> but have not had any luck Does anyone have any idea what is going wrong? >>> >>> Thanks for the help. >>> >>> Marvin >>> >>> >>> [2010-9-4 4:3:15 EDT] Waiting for requests... >>> java.lang.NullPointerException >>>at >>> com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) >>>at >>> com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) >>>at >>> com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) >>>at >>> com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) >>>at >>> com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) >>>at >>> com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) >>>at >>> com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) >>>at >>> com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) >>>at >>> com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) >>>at >>> com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) >>>at >>> com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) >>>at >>> com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) >>>at >>> com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) >>>at >>> com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) >>>at >>> com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) >>>at >>> com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) >>>at >>> com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) >>>at >>> com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) >>>at >>> com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) >>>at >>> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) >>>at >>> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) >>>at your.app.eo._Movie.fetchMovies(_Movie.java:84) >>>at your.app.components.Main.searchMovies(Main.java:75) >>>at sunreflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>at java.lang.reflect.Method.invoke(Met
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
Or the prototypes are not configured or not loading properly? On Sep 4, 2010, at 10:40 AM, Mike Schrag wrote: > I don't have source in front of me at the moment, but I seem to recall this > is when you accidentally forget to fill in the external type of an attribute > (the "varchar" part). Go back through the attributes in your model and give > then a once-over. I should really add a check to entity modeler for JDBC > attributes with missing required values. > > Sent from my iPhone > > On Sep 4, 2010, at 4:58 AM, Marvin wrote: > >> Hi, >> >> I am new to WebObjects and am working through the documentation and Apple's >> Movies tutorial found here: >> http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. >> >> I am running on Mac OS 10.6.4. >> >> I was able to get WebObects installed (version 5.4.3) along with the WOLips >> plugin for eclipse obtained from: >> http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I >> installed it using method 2. >> >> I am using the built in VelocityEOGenerator with the Entity.java templates >> obtained from: >> http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. >> >> I have created the Movies database and have generated the Movies entities >> using the EO Generator and can launch the application but when I do a search >> as instructed in the tutorial I get the following exception. I have >> searched this mailing list archive and the web for elements of this error >> but have not had any luck Does anyone have any idea what is going wrong? >> >> Thanks for the help. >> >> Marvin >> >> >> [2010-9-4 4:3:15 EDT] Waiting for requests... >> java.lang.NullPointerException >> at >> com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) >> at >> com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) >> at >> com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) >> at >> com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) >> at >> com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) >> at >> com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) >> at >> com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) >> at >> com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) >> at >> com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) >> at >> com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) >> at >> com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) >> at >> com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) >> at >> com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) >> at >> com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) >> at >> com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) >> at >> com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) >> at >> com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) >> at >> com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) >> at >> com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) >> at >> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) >> at >> com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) >> at your.app.eo._Movie.fetchMovies(_Movie.java:84) >> at your.app.components.Main.searchMovies(Main.java:75) >> at sunreflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) >> at >> com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSK
Re: NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
I don't have source in front of me at the moment, but I seem to recall this is when you accidentally forget to fill in the external type of an attribute (the "varchar" part). Go back through the attributes in your model and give then a once-over. I should really add a check to entity modeler for JDBC attributes with missing required values. Sent from my iPhone On Sep 4, 2010, at 4:58 AM, Marvin wrote: > Hi, > > I am new to WebObjects and am working through the documentation and Apple's > Movies tutorial found here: > http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html. > > I am running on Mac OS 10.6.4. > > I was able to get WebObects installed (version 5.4.3) along with the WOLips > plugin for eclipse obtained from: > http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I > installed it using method 2. > > I am using the built in VelocityEOGenerator with the Entity.java templates > obtained from: > http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions. > > I have created the Movies database and have generated the Movies entities > using the EO Generator and can launch the application but when I do a search > as instructed in the tutorial I get the following exception. I have searched > this mailing list archive and the web for elements of this error but have not > had any luck Does anyone have any idea what is going wrong? > > Thanks for the help. > > Marvin > > > [2010-9-4 4:3:15 EDT] Waiting for requests... > java.lang.NullPointerException > at > com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) > at > com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) > at > com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) > at > com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) > at > com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) > at > com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) > at > com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) > at > com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) > at > com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) > at > com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) > at > com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) > at > com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) > at > com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) > at > com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) > at > com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) > at your.app.eo._Movie.fetchMovies(_Movie.java:84) > at your.app.components.Main.searchMovies(Main.java:75) > at sunreflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) > at > com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) > at > com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) > at > com.webobjects.appserver.WOCom
NullPointerException in DerbyPlugIn$DerbyExpression.isLOBAttribute
Hi,I am new to WebObjects and am working through the documentation and Apple's Movies tutorial found here: http://developer.apple.com/legacy/mac/library/documentation/DeveloperTools/Conceptual/WOTutorial/DatabaseApplication/DatabaseApplication.html.I am running on Mac OS 10.6.4.I was able to get WebObects installed (version 5.4.3) along with the WOLips plugin for eclipse obtained from: http://wiki.objectstyle.org/confluence/display/WOL/Installing+WOLips. I installed it using method 2.I am using the built in VelocityEOGenerator with the Entity.java templates obtained from: http://wiki.objectstyle.org/confluence/display/WOL/EOGenerator+Templates+and+Additions.I have created the Movies database and have generated the Movies entities using the EO Generator and can launch the application but when I do a search as instructed in the tutorial I get the following exception. I have searched this mailing list archive and the web for elements of this error but have not had any luck Does anyone have any idea what is going wrong?Thanks for the help.Marvin[2010-9-4 4:3:15 EDT] Waiting for requests...java.lang.NullPointerException at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.isLOBAttribute(DerbyPlugIn.java:345) at com.webobjects.jdbcadaptor.DerbyPlugIn$DerbyExpression.shouldUseBindVariableForAttribute(DerbyPlugIn.java:361) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForValue(EOSQLExpression.java:1965) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1659) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(EOSQLExpression.java:1528) at com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifiers(EOSQLExpression.java:1560) at com.webobjects.eoaccess.EOQualifierSQLGeneration$_AndQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:541) at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165) at com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997) at com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146) at com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225) at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:213) at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897) at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234) at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055) at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195) at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069) at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:) at your.app.eo._Movie.fetchMovies(_Movie.java:84) at your.app.components.Main.searchMovies(Main.java:75) at sunreflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKeyValueCoding.java:636) at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134) at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324) at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1736) at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447) at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212) at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804) at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50) at com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:81) at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver._private.WOForm.invokeAction(WOForm.java:141) at com.webobjects.appserver._p
Re: WOXMLDecoder NullPointerException
Okay. Will try it out! Thanks for your suggestion, Simon! From: Simon To: Shravan Kumar. M Cc: WO Dev Group Sent: Sun, March 14, 2010 4:35:04 PM Subject: Re: WOXMLDecoder NullPointerException my advice is to use a mapping file. no mapping file = debugging nightmare simon On 13 March 2010 11:45, Shravan Kumar. M wrote: > Hi Group, > > Following code to decode an xml file or xml string is resuting in NPE, could > you any one please advise what's going wrong here: > > WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder(); > //InputStream is = > application().resourceManager().inputStreamForResourceNamed("supra.xml", > null, null); > //System.out.println("is..." + is); > //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024)); > String xmlString = " encoding='UTF-8'?>123"; > StringReader stringReader = new StringReader(xmlString); > InputSource is = new InputSource(stringReader); > Object obj = xmlDecoder.decodeRootObject(is); > System.out.println("childe: " + xmlDecoder.valueForKey("childe")); > > java.lang.NullPointerException > [2010-03-13 17:08:56 IST] java.lang.NullPointerException > at > com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744) > at > com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31) > at > com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706) > at your.app.components.Main.submitData(Main.java:160) > > Thank You, > Shravan Kumar. M > --- > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk > > This email sent to si...@potwells.co.uk > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WOXMLDecoder NullPointerException
my advice is to use a mapping file. no mapping file = debugging nightmare simon On 13 March 2010 11:45, Shravan Kumar. M wrote: > Hi Group, > > Following code to decode an xml file or xml string is resuting in NPE, could > you any one please advise what's going wrong here: > > WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder(); > //InputStream is = > application().resourceManager().inputStreamForResourceNamed("supra.xml", > null, null); > //System.out.println("is..." + is); > //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024)); > String xmlString = " encoding='UTF-8'?>123"; > StringReader stringReader = new StringReader(xmlString); > InputSource is = new InputSource(stringReader); > Object obj = xmlDecoder.decodeRootObject(is); > System.out.println("childe: " + xmlDecoder.valueForKey("childe")); > > java.lang.NullPointerException > [2010-03-13 17:08:56 IST] java.lang.NullPointerException > at > com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744) > at > com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31) > at > com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706) > at your.app.components.Main.submitData(Main.java:160) > > Thank You, > Shravan Kumar. M > --- > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk > > This email sent to si...@potwells.co.uk > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Fw: WOXMLDecoder NullPointerException
Any suggestions please? Fw: WOXMLDecoder NullPointerException WOXMLDecoder NullPointerException Sat Mar 13 17:15:22 2010 From: "Shravan Kumar. M" To: "WO Dev Group" Hi Group, Following code to decode an xml file or xml string is resuting in NPE, could you any one please advise what's going wrong here: WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder(); //InputStream is = application().resourceManager().inputStreamForResourceNamed("supra.xml", null, null); //supra.xml has similar xml as shown in xmlString below, but little elaborated. //System.out.println("is..." + is); //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024)); String xmlString = "123"; StringReader stringReader = new StringReader(xmlString); InputSource is = new InputSource(stringReader); Object obj = xmlDecoder.decodeRootObject(is); System.out.println("childe: " + xmlDecoder.valueForKey("childe")); java.lang.NullPointerException [2010-03-13 17:08:56 IST] java.lang.NullPointerException at com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744) at com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31) at com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706) at your.app.components.Main.submitData(Main.java:160) Thank You, Shravan Kumar. M --- ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WOXMLDecoder NullPointerException
Hi Group, Following code to decode an xml file or xml string is resuting in NPE, could you any one please advise what's going wrong here: WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder(); //InputStream is = application().resourceManager().inputStreamForResourceNamed("supra.xml", null, null); //System.out.println("is..." + is); //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024)); String xmlString = "123"; StringReader stringReader = new StringReader(xmlString); InputSource is = new InputSource(stringReader); Object obj = xmlDecoder.decodeRootObject(is); System.out.println("childe: " + xmlDecoder.valueForKey("childe")); java.lang.NullPointerException [2010-03-13 17:08:56 IST] java.lang.NullPointerException at com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744) at com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31) at com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706) at your.app.components.Main.submitData(Main.java:160) Thank You, Shravan Kumar. M --- ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in many-many relationship cross two models
On Dec 15, 2009, at 6:55 AM, Kieran Kelleher wrote: > Chuck, you are mean! ;-) > > Ren, here is connection URL example: > > jdbc:mysql://myhost/mydatabase?capitalizeTypenames=true&useUnicode=true&characterEncoding=UTF-8 > > Also, changing the my.cnf will not magically change databases and tables that > have been previously created without UTF-8. > > > See the CREATE DATABASE and CREATE TABLE statement docs online. YOu can > verify a table's current encoding with SHOW CREATE TABLE. I *think* you can > even have different encodings on different columns if you really want to > . that of course if the versatility of the wonderful MySQL. The reference > manual is generally comprehensive > http://dev.mysql.com/doc/refman/5.0/en/ > http://dev.mysql.com/doc/refman/5.0/en/charset.html > > HTH, Kieran Whew. Good thing MySQL is so simple. :-P Dave > > On Dec 14, 2009, at 10:59 PM, Chuck Hill wrote: > >> For WebObjects and Java, UTF-8. Not sure what MySquirrelyDatabase needs. >> >> >> >> >> On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote: >> >>> >>> yes, this confused me. In my.cnf default-character-set=utf8 >>> >>> I did google search someone said characterEncoding=UTF8 working, others >>> said characterEncoding=UTF-8. >>> >>> Not sure which one is right? >>> >>> >>> Kevin >>> >>>> -Original Message- >>>> From: Chuck Hill [mailto:ch...@global-village.net] >>>> Sent: Tuesday, 15 December 2009 4:42 p.m. >>>> To: Ran, Kevin >>>> Cc: webobjects-dev@lists.apple.com >>>> Subject: Re: NullPointerException in many-many relationship >>>> cross two models >>>> >>>> >>>> On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: >>>> >>>>> >>>>> Hi, >>>>> >>>>> You are brilliant, guys. It's simple copy/past error in the URL. >>>>> >>>>> jdbc:mysql://156.13.128.28:3306/school? >>>>> useUnicode=true&characterEncoding=UTF8 >>>>> >>>>> One was using characterEncoding=UTF-8 instead of UTF8, causing this >>>>> problem. >>>>> >>>>> Now I change them both to UTF8 and works, >>>> >>>> >>>> UTF-8 is the correct form >>>> >>>> >>>> Chuck >>>> >>>> >>>>>> -Original Message- >>>>>> From: >>>>>> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com >>>>>> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c >>>>>> om] On Behalf Of Mike Schrag >>>>>> Sent: Tuesday, 15 December 2009 4:25 p.m. >>>>>> To: Development WebObjects >>>>>> Subject: Re: NullPointerException in many-many >>>> relationship cross two >>>>>> models >>>>>> >>>>>> same connection dictionary like "i think they're the same >>>> because the >>>>>> url is the same" or same like "i tested with >>>>>> .equals(..) at runtime and it returns true thereby proving they're >>>>>> the same" (technically they don't have to be exactly >>>> .equals, but if >>>>>> they are .equals, they are same-enough) >>>>>> >>>>>> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: >>>>>> >>>>>>> >>>>>>> HI, >>>>>>> >>>>>>> I checked that, they are same connection dictionary, >>>>>> because this just moral test example. >>>>>>> >>>>>>> Not using WOnder, >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> Kevin >>>>>>> >>>>>>>> -Original Message- >>>>>>>> From: Chuck Hill [mailto:ch...@global-village.net] >>>>>>>> Sent: Tuesday, 15 December 2009 4:18 p.m. >>>>>>>> To: Ren, Kevin >>>>>>>> Cc: webobjects-dev@lists.apple.com >>>>>>>> Subject: Re: NullPointerException in many-many >>>>>> relationship cross two >>>>>>>> models >>>>>>>> >>>>>>>
Re: NullPointerException in many-many relationship cross two models
Chuck, you are mean! ;-) Ren, here is connection URL example: jdbc:mysql://myhost/mydatabase? capitalizeTypenames=true&useUnicode=true&characterEncoding=UTF-8 Also, changing the my.cnf will not magically change databases and tables that have been previously created without UTF-8. See the CREATE DATABASE and CREATE TABLE statement docs online. YOu can verify a table's current encoding with SHOW CREATE TABLE. I *think* you can even have different encodings on different columns if you really want to . that of course if the versatility of the wonderful MySQL. The reference manual is generally comprehensive http://dev.mysql.com/doc/refman/5.0/en/ http://dev.mysql.com/doc/refman/5.0/en/charset.html HTH, Kieran On Dec 14, 2009, at 10:59 PM, Chuck Hill wrote: For WebObjects and Java, UTF-8. Not sure what MySquirrelyDatabase needs. On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote: yes, this confused me. In my.cnf default-character-set=utf8 I did google search someone said characterEncoding=UTF8 working, others said characterEncoding=UTF-8. Not sure which one is right? Kevin -Original Message- From: Chuck Hill [mailto:ch...@global-village.net] Sent: Tuesday, 15 December 2009 4:42 p.m. To: Ran, Kevin Cc: webobjects-dev@lists.apple.com Subject: Re: NullPointerException in many-many relationship cross two models On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: Hi, You are brilliant, guys. It's simple copy/past error in the URL. jdbc:mysql://156.13.128.28:3306/school? useUnicode=true&characterEncoding=UTF8 One was using characterEncoding=UTF-8 instead of UTF8, causing this problem. Now I change them both to UTF8 and works, UTF-8 is the correct form Chuck -Original Message- From: webobjects-dev-bounces+kevin.ren=anz@lists.apple.com [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c om] On Behalf Of Mike Schrag Sent: Tuesday, 15 December 2009 4:25 p.m. To: Development WebObjects Subject: Re: NullPointerException in many-many relationship cross two models same connection dictionary like "i think they're the same because the url is the same" or same like "i tested with .equals(..) at runtime and it returns true thereby proving they're the same" (technically they don't have to be exactly .equals, but if they are .equals, they are same-enough) On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: HI, I checked that, they are same connection dictionary, because this just moral test example. Not using WOnder, Thanks Kevin -Original Message- From: Chuck Hill [mailto:ch...@global-village.net] Sent: Tuesday, 15 December 2009 4:18 p.m. To: Ren, Kevin Cc: webobjects-dev@lists.apple.com Subject: Re: NullPointerException in many-many relationship cross two models Both models need to have the exact (and I _do_ mean _exact_) same connection dictionary. The dictionaries must be equals(). This is most easily accomplished by setting the programatically when the app loads. Wonder, of course, does this. Chuck On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: Hi, There is m-m relationship between A and B entities which are in different models, but in same database. I can create and platen this relationship in EOModler and got AB table as well. AB is in the same DB and only has compound PK like A_ID and B_ID. When I tried to do saveChanges got this error [2009-12-15 12:6:48 NZDT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext .primaryKeyForIntermediateRowFromSourceObject (EODatabaseContext.java: 4845) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForIntermediateRowFromSourceObject (EODatabaseContext.java:4863) at com .webobjects .eoaccess .EODatabaseContext .recordInsertForIntermediateRowFromSourceObject (EODatabaseContext.java:4888) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObject (EODatabaseContext.java:4913) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObjects (EODatabaseContext.java:4966) at com .webobjects .eoaccess .EODatabaseContext .recordChangesInEditingContext(EODatabaseContext.java:6036) at com .webobjects .eocontrol .EOObjectStoreCoordinator .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java: 3192) And I found only updateObjects could has two entities's details and insertedObjects does not print out anything. Not sure this does not work in across models or something else need setup? thanks Xiaowen(Kevin) Ren Analyst Programmer Channel Applications, Retail Applications ANZ National Bank Ltd Level 6 ASB Tower 2 Hunter Street PO Box 1791 Wellington Phone: 04 4365363 Fax: 04 8028696 "This e-mail and any at
Re: NullPointerException in many-many relationship cross two models
Thought it is unsolved yet. Pls ignore. - Original Message - From: "Cheong Hee (Gmail)" To: "Ren, Kevin" ; Sent: Tuesday, December 15, 2009 12:26 PM Subject: Re: NullPointerException in many-many relationship cross two models Hi Kevin Could you post your code over how object inserted and saved? Cheers Cheong Hee ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in many-many relationship cross two models
Hi Kevin Could you post your code over how object inserted and saved? Cheers Cheong Hee ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
RE: NullPointerException in many-many relationship cross two models
Cool, thanks Kevin > -Original Message- > From: Chuck Hill [mailto:ch...@global-village.net] > Sent: Tuesday, 15 December 2009 5:00 p.m. > To: Ren, Kevin > Cc: webobjects-dev@lists.apple.com > Subject: Re: NullPointerException in many-many relationship > cross two models > > For WebObjects and Java, UTF-8. Not sure what > MySquirrelyDatabase needs. > > > > > On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote: > > > > > yes, this confused me. In my.cnf default-character-set=utf8 > > > > I did google search someone said characterEncoding=UTF8 working, > > others said characterEncoding=UTF-8. > > > > Not sure which one is right? > > > > > > Kevin > > > >> -Original Message- > >> From: Chuck Hill [mailto:ch...@global-village.net] > >> Sent: Tuesday, 15 December 2009 4:42 p.m. > >> To: Ran, Kevin > >> Cc: webobjects-dev@lists.apple.com > >> Subject: Re: NullPointerException in many-many > relationship cross two > >> models > >> > >> > >> On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: > >> > >>> > >>> Hi, > >>> > >>> You are brilliant, guys. It's simple copy/past error in the URL. > >>> > >>> jdbc:mysql://156.13.128.28:3306/school? > >>> useUnicode=true&characterEncoding=UTF8 > >>> > >>> One was using characterEncoding=UTF-8 instead of UTF8, > causing this > >>> problem. > >>> > >>> Now I change them both to UTF8 and works, > >> > >> > >> UTF-8 is the correct form > >> > >> > >> Chuck > >> > >> > >>>> -Original Message- > >>>> From: > >>>> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com > >>>> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c > >>>> om] On Behalf Of Mike Schrag > >>>> Sent: Tuesday, 15 December 2009 4:25 p.m. > >>>> To: Development WebObjects > >>>> Subject: Re: NullPointerException in many-many > >> relationship cross two > >>>> models > >>>> > >>>> same connection dictionary like "i think they're the same > >> because the > >>>> url is the same" or same like "i tested with > >>>> .equals(..) at runtime and it returns true thereby > proving they're > >>>> the same" (technically they don't have to be exactly > >> .equals, but if > >>>> they are .equals, they are same-enough) > >>>> > >>>> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: > >>>> > >>>>> > >>>>> HI, > >>>>> > >>>>> I checked that, they are same connection dictionary, > >>>> because this just moral test example. > >>>>> > >>>>> Not using WOnder, > >>>>> > >>>>> Thanks > >>>>> > >>>>> Kevin > >>>>> > >>>>>> -Original Message- > >>>>>> From: Chuck Hill [mailto:ch...@global-village.net] > >>>>>> Sent: Tuesday, 15 December 2009 4:18 p.m. > >>>>>> To: Ren, Kevin > >>>>>> Cc: webobjects-dev@lists.apple.com > >>>>>> Subject: Re: NullPointerException in many-many > >>>> relationship cross two > >>>>>> models > >>>>>> > >>>>>> Both models need to have the exact (and I _do_ mean > >> _exact_) same > >>>>>> connection dictionary. The dictionaries must be equals(). > >>>> This is > >>>>>> most easily accomplished by setting the programatically > >>>> when the app > >>>>>> loads. Wonder, of course, does this. > >>>>>> > >>>>>> > >>>>>> Chuck > >>>>>> > >>>>>> > >>>>>> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: > >>>>>>> Hi, > >>>>>>> > >>>>>>> There is m-m relationship between A and B entities > which are in > >>>>>>> different models, but in same database. I can create and > >>>>>> platen this > >>>>>>> relationship in E
Re: NullPointerException in many-many relationship cross two models
For WebObjects and Java, UTF-8. Not sure what MySquirrelyDatabase needs. On Dec 14, 2009, at 7:51 PM, Ren, Kevin wrote: yes, this confused me. In my.cnf default-character-set=utf8 I did google search someone said characterEncoding=UTF8 working, others said characterEncoding=UTF-8. Not sure which one is right? Kevin -Original Message- From: Chuck Hill [mailto:ch...@global-village.net] Sent: Tuesday, 15 December 2009 4:42 p.m. To: Ran, Kevin Cc: webobjects-dev@lists.apple.com Subject: Re: NullPointerException in many-many relationship cross two models On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: Hi, You are brilliant, guys. It's simple copy/past error in the URL. jdbc:mysql://156.13.128.28:3306/school? useUnicode=true&characterEncoding=UTF8 One was using characterEncoding=UTF-8 instead of UTF8, causing this problem. Now I change them both to UTF8 and works, UTF-8 is the correct form Chuck -Original Message- From: webobjects-dev-bounces+kevin.ren=anz@lists.apple.com [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c om] On Behalf Of Mike Schrag Sent: Tuesday, 15 December 2009 4:25 p.m. To: Development WebObjects Subject: Re: NullPointerException in many-many relationship cross two models same connection dictionary like "i think they're the same because the url is the same" or same like "i tested with .equals(..) at runtime and it returns true thereby proving they're the same" (technically they don't have to be exactly .equals, but if they are .equals, they are same-enough) On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: HI, I checked that, they are same connection dictionary, because this just moral test example. Not using WOnder, Thanks Kevin -Original Message- From: Chuck Hill [mailto:ch...@global-village.net] Sent: Tuesday, 15 December 2009 4:18 p.m. To: Ren, Kevin Cc: webobjects-dev@lists.apple.com Subject: Re: NullPointerException in many-many relationship cross two models Both models need to have the exact (and I _do_ mean _exact_) same connection dictionary. The dictionaries must be equals(). This is most easily accomplished by setting the programatically when the app loads. Wonder, of course, does this. Chuck On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: Hi, There is m-m relationship between A and B entities which are in different models, but in same database. I can create and platen this relationship in EOModler and got AB table as well. AB is in the same DB and only has compound PK like A_ID and B_ID. When I tried to do saveChanges got this error [2009-12-15 12:6:48 NZDT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 4845) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForIntermediateRowFromSourceObject (EODatabaseContext.java:4863) at com .webobjects .eoaccess .EODatabaseContext .recordInsertForIntermediateRowFromSourceObject (EODatabaseContext.java:4888) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObject (EODatabaseContext.java:4913) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObjects (EODatabaseContext.java:4966) at com .webobjects .eoaccess .EODatabaseContext .recordChangesInEditingContext(EODatabaseContext.java:6036) at com .webobjects .eocontrol .EOObjectStoreCoordinator .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) And I found only updateObjects could has two entities's details and insertedObjects does not print out anything. Not sure this does not work in across models or something else need setup? thanks Xiaowen(Kevin) Ren Analyst Programmer Channel Applications, Retail Applications ANZ National Bank Ltd Level 6 ASB Tower 2 Hunter Street PO Box 1791 Wellington Phone: 04 4365363 Fax: 04 8028696 "This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus,
RE: NullPointerException in many-many relationship cross two models
yes, this confused me. In my.cnf default-character-set=utf8 I did google search someone said characterEncoding=UTF8 working, others said characterEncoding=UTF-8. Not sure which one is right? Kevin > -Original Message- > From: Chuck Hill [mailto:ch...@global-village.net] > Sent: Tuesday, 15 December 2009 4:42 p.m. > To: Ran, Kevin > Cc: webobjects-dev@lists.apple.com > Subject: Re: NullPointerException in many-many relationship > cross two models > > > On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: > > > > > Hi, > > > > You are brilliant, guys. It's simple copy/past error in the URL. > > > > jdbc:mysql://156.13.128.28:3306/school? > > useUnicode=true&characterEncoding=UTF8 > > > > One was using characterEncoding=UTF-8 instead of UTF8, causing this > > problem. > > > > Now I change them both to UTF8 and works, > > > UTF-8 is the correct form > > > Chuck > > > >> -Original Message- > >> From: > >> webobjects-dev-bounces+kevin.ren=anz@lists.apple.com > >> [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c > >> om] On Behalf Of Mike Schrag > >> Sent: Tuesday, 15 December 2009 4:25 p.m. > >> To: Development WebObjects > >> Subject: Re: NullPointerException in many-many > relationship cross two > >> models > >> > >> same connection dictionary like "i think they're the same > because the > >> url is the same" or same like "i tested with > >> .equals(..) at runtime and it returns true thereby proving they're > >> the same" (technically they don't have to be exactly > .equals, but if > >> they are .equals, they are same-enough) > >> > >> On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: > >> > >>> > >>> HI, > >>> > >>> I checked that, they are same connection dictionary, > >> because this just moral test example. > >>> > >>> Not using WOnder, > >>> > >>> Thanks > >>> > >>> Kevin > >>> > >>>> -Original Message- > >>>> From: Chuck Hill [mailto:ch...@global-village.net] > >>>> Sent: Tuesday, 15 December 2009 4:18 p.m. > >>>> To: Ren, Kevin > >>>> Cc: webobjects-dev@lists.apple.com > >>>> Subject: Re: NullPointerException in many-many > >> relationship cross two > >>>> models > >>>> > >>>> Both models need to have the exact (and I _do_ mean > _exact_) same > >>>> connection dictionary. The dictionaries must be equals(). > >> This is > >>>> most easily accomplished by setting the programatically > >> when the app > >>>> loads. Wonder, of course, does this. > >>>> > >>>> > >>>> Chuck > >>>> > >>>> > >>>> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: > >>>>> Hi, > >>>>> > >>>>> There is m-m relationship between A and B entities which are in > >>>>> different models, but in same database. I can create and > >>>> platen this > >>>>> relationship in EOModler and got AB table as well. > >>>>> > >>>>> AB is in the same DB and only has compound PK like A_ID > and B_ID. > >>>>> > >>>>> When I tried to do saveChanges got this error > >>>>> > >>>>> > >>>>> [2009-12-15 12:6:48 NZDT] > >>>>> java.lang.NullPointerException > >>>>> at > >>>>> com > >>>>> .webobjects > >>>>> .eoaccess > >>>>> .EODatabaseContext > >>>>> > >>>> > >> > .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: > >>>>> 4845) > >>>>> > >>>>> at > >>>>> com > >>>>> .webobjects > >>>>> .eoaccess > >>>>> .EODatabaseContext > >>>>> .databaseOperationForIntermediateRowFromSourceObject > >>>>> (EODatabaseContext.java:4863) > >>>>> > >>>>> at > >>>>> com > >>>>> .webobjects > >>>>> .eoaccess > >>>>> .EODatabaseContext > >>>>> .r
Re: NullPointerException in many-many relationship cross two models
On Dec 14, 2009, at 7:37 PM, Ren, Kevin wrote: Hi, You are brilliant, guys. It's simple copy/past error in the URL. jdbc:mysql://156.13.128.28:3306/school? useUnicode=true&characterEncoding=UTF8 One was using characterEncoding=UTF-8 instead of UTF8, causing this problem. Now I change them both to UTF8 and works, UTF-8 is the correct form Chuck -Original Message- From: webobjects-dev-bounces+kevin.ren=anz@lists.apple.com [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c om] On Behalf Of Mike Schrag Sent: Tuesday, 15 December 2009 4:25 p.m. To: Development WebObjects Subject: Re: NullPointerException in many-many relationship cross two models same connection dictionary like "i think they're the same because the url is the same" or same like "i tested with .equals(..) at runtime and it returns true thereby proving they're the same" (technically they don't have to be exactly .equals, but if they are .equals, they are same-enough) On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: HI, I checked that, they are same connection dictionary, because this just moral test example. Not using WOnder, Thanks Kevin -Original Message- From: Chuck Hill [mailto:ch...@global-village.net] Sent: Tuesday, 15 December 2009 4:18 p.m. To: Ren, Kevin Cc: webobjects-dev@lists.apple.com Subject: Re: NullPointerException in many-many relationship cross two models Both models need to have the exact (and I _do_ mean _exact_) same connection dictionary. The dictionaries must be equals(). This is most easily accomplished by setting the programatically when the app loads. Wonder, of course, does this. Chuck On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: Hi, There is m-m relationship between A and B entities which are in different models, but in same database. I can create and platen this relationship in EOModler and got AB table as well. AB is in the same DB and only has compound PK like A_ID and B_ID. When I tried to do saveChanges got this error [2009-12-15 12:6:48 NZDT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 4845) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForIntermediateRowFromSourceObject (EODatabaseContext.java:4863) at com .webobjects .eoaccess .EODatabaseContext .recordInsertForIntermediateRowFromSourceObject (EODatabaseContext.java:4888) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObject (EODatabaseContext.java:4913) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObjects (EODatabaseContext.java:4966) at com .webobjects .eoaccess .EODatabaseContext .recordChangesInEditingContext(EODatabaseContext.java:6036) at com .webobjects .eocontrol .EOObjectStoreCoordinator .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) And I found only updateObjects could has two entities's details and insertedObjects does not print out anything. Not sure this does not work in across models or something else need setup? thanks Xiaowen(Kevin) Ren Analyst Programmer Channel Applications, Retail Applications ANZ National Bank Ltd Level 6 ASB Tower 2 Hunter Street PO Box 1791 Wellington Phone: 04 4365363 Fax: 04 8028696 "This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication." ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global- v illage.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overa
RE: NullPointerException in many-many relationship cross two models
Hi, You are brilliant, guys. It's simple copy/past error in the URL. jdbc:mysql://156.13.128.28:3306/school?useUnicode=true&characterEncoding=UTF8 One was using characterEncoding=UTF-8 instead of UTF8, causing this problem. Now I change them both to UTF8 and works, Thanks, kevin > -Original Message- > From: > webobjects-dev-bounces+kevin.ren=anz@lists.apple.com > [mailto:webobjects-dev-bounces+kevin.ren=anz@lists.apple.c > om] On Behalf Of Mike Schrag > Sent: Tuesday, 15 December 2009 4:25 p.m. > To: Development WebObjects > Subject: Re: NullPointerException in many-many relationship > cross two models > > same connection dictionary like "i think they're the same > because the url is the same" or same like "i tested with > .equals(..) at runtime and it returns true thereby proving > they're the same" (technically they don't have to be exactly > .equals, but if they are .equals, they are same-enough) > > On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: > > > > > HI, > > > > I checked that, they are same connection dictionary, > because this just moral test example. > > > > Not using WOnder, > > > > Thanks > > > > Kevin > > > >> -Original Message- > >> From: Chuck Hill [mailto:ch...@global-village.net] > >> Sent: Tuesday, 15 December 2009 4:18 p.m. > >> To: Ren, Kevin > >> Cc: webobjects-dev@lists.apple.com > >> Subject: Re: NullPointerException in many-many > relationship cross two > >> models > >> > >> Both models need to have the exact (and I _do_ mean _exact_) same > >> connection dictionary. The dictionaries must be equals(). > This is > >> most easily accomplished by setting the programatically > when the app > >> loads. Wonder, of course, does this. > >> > >> > >> Chuck > >> > >> > >> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: > >>> Hi, > >>> > >>> There is m-m relationship between A and B entities which are in > >>> different models, but in same database. I can create and > >> platen this > >>> relationship in EOModler and got AB table as well. > >>> > >>> AB is in the same DB and only has compound PK like A_ID and B_ID. > >>> > >>> When I tried to do saveChanges got this error > >>> > >>> > >>> [2009-12-15 12:6:48 NZDT] > >>> java.lang.NullPointerException > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> > >> > .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: > >>> 4845) > >>> > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> .databaseOperationForIntermediateRowFromSourceObject > >>> (EODatabaseContext.java:4863) > >>> > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> .recordInsertForIntermediateRowFromSourceObject > >>> (EODatabaseContext.java:4888) > >>> > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> .relayAttributesInRelationshipSourceObjectDestinationObject > >>> (EODatabaseContext.java:4913) > >>> > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> .relayAttributesInRelationshipSourceObjectDestinationObjects > >>> (EODatabaseContext.java:4966) > >>> > >>>at > >>> com > >>> .webobjects > >>> .eoaccess > >>> .EODatabaseContext > >>> .recordChangesInEditingContext(EODatabaseContext.java:6036) > >>>at > >>> com > >>> .webobjects > >>> .eocontrol > >>> .EOObjectStoreCoordinator > >>> .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) > >>> > >>>at > >>> com > >>> .webobjects > >>> > .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) > >>> > >>> > >>> And I found only updateObjects could has two entities's > de
Re: NullPointerException in many-many relationship cross two models
On 14. Dec. 2009, at 19:22 , Ren, Kevin wrote: > I checked that, they are same connection dictionary, because this just moral > test example. You need to check them programmatically. As Chuck said - equals() needs to return true. Guido -- http://www.event-s.net ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in many-many relationship cross two models
same connection dictionary like "i think they're the same because the url is the same" or same like "i tested with .equals(..) at runtime and it returns true thereby proving they're the same" (technically they don't have to be exactly .equals, but if they are .equals, they are same-enough) On Dec 14, 2009, at 10:22 PM, Ren, Kevin wrote: > > HI, > > I checked that, they are same connection dictionary, because this just moral > test example. > > Not using WOnder, > > Thanks > > Kevin > >> -Original Message- >> From: Chuck Hill [mailto:ch...@global-village.net] >> Sent: Tuesday, 15 December 2009 4:18 p.m. >> To: Ren, Kevin >> Cc: webobjects-dev@lists.apple.com >> Subject: Re: NullPointerException in many-many relationship >> cross two models >> >> Both models need to have the exact (and I _do_ mean _exact_) >> same connection dictionary. The dictionaries must be >> equals(). This is most easily accomplished by setting the >> programatically when the app loads. Wonder, of course, does this. >> >> >> Chuck >> >> >> On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: >>> Hi, >>> >>> There is m-m relationship between A and B entities which are in >>> different models, but in same database. I can create and >> platen this >>> relationship in EOModler and got AB table as well. >>> >>> AB is in the same DB and only has compound PK like A_ID and B_ID. >>> >>> When I tried to do saveChanges got this error >>> >>> >>> [2009-12-15 12:6:48 NZDT] >>> java.lang.NullPointerException >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> >> .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: >>> 4845) >>> >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> .databaseOperationForIntermediateRowFromSourceObject >>> (EODatabaseContext.java:4863) >>> >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> .recordInsertForIntermediateRowFromSourceObject >>> (EODatabaseContext.java:4888) >>> >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> .relayAttributesInRelationshipSourceObjectDestinationObject >>> (EODatabaseContext.java:4913) >>> >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> .relayAttributesInRelationshipSourceObjectDestinationObjects >>> (EODatabaseContext.java:4966) >>> >>>at >>> com >>> .webobjects >>> .eoaccess >>> .EODatabaseContext >>> .recordChangesInEditingContext(EODatabaseContext.java:6036) >>>at >>> com >>> .webobjects >>> .eocontrol >>> .EOObjectStoreCoordinator >>> .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) >>> >>>at >>> com >>> .webobjects >>> .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) >>> >>> >>> And I found only updateObjects could has two entities's details and >>> insertedObjects does not print out anything. >>> >>> Not sure this does not work in across models or something else need >>> setup? >>> >>> thanks >>> >>> >>> >>> Xiaowen(Kevin) Ren >>> >>> Analyst Programmer >>> Channel Applications, Retail Applications ANZ National Bank >> Ltd Level >>> 6 ASB Tower >>> 2 Hunter Street >>> PO Box 1791 >>> Wellington >>> Phone: 04 4365363 >>> Fax: 04 8028696 >>> >>> >>> >>> >>> >>> "This e-mail and any attachments to it (the "Communication") is, >>> unless otherwise stated, confidential, may contain >> copyright material >>> and is for the use only of the intended recipient. If you >> receive the >>> Communication in error, please notify the sender >> immediately by return >>> e-mail, delete the Communication and the return e-mail, and do not >>> read, copy, retransmit or otherwise deal with it. Any views >> expressed >>> i
RE: NullPointerException in many-many relationship cross two models
HI, I checked that, they are same connection dictionary, because this just moral test example. Not using WOnder, Thanks Kevin > -Original Message- > From: Chuck Hill [mailto:ch...@global-village.net] > Sent: Tuesday, 15 December 2009 4:18 p.m. > To: Ren, Kevin > Cc: webobjects-dev@lists.apple.com > Subject: Re: NullPointerException in many-many relationship > cross two models > > Both models need to have the exact (and I _do_ mean _exact_) > same connection dictionary. The dictionaries must be > equals(). This is most easily accomplished by setting the > programatically when the app loads. Wonder, of course, does this. > > > Chuck > > > On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: > > Hi, > > > > There is m-m relationship between A and B entities which are in > > different models, but in same database. I can create and > platen this > > relationship in EOModler and got AB table as well. > > > > AB is in the same DB and only has compound PK like A_ID and B_ID. > > > > When I tried to do saveChanges got this error > > > > > > [2009-12-15 12:6:48 NZDT] > > java.lang.NullPointerException > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > > .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: > > 4845) > > > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > .databaseOperationForIntermediateRowFromSourceObject > > (EODatabaseContext.java:4863) > > > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > .recordInsertForIntermediateRowFromSourceObject > > (EODatabaseContext.java:4888) > > > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > .relayAttributesInRelationshipSourceObjectDestinationObject > > (EODatabaseContext.java:4913) > > > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > .relayAttributesInRelationshipSourceObjectDestinationObjects > > (EODatabaseContext.java:4966) > > > > at > > com > > .webobjects > > .eoaccess > > .EODatabaseContext > > .recordChangesInEditingContext(EODatabaseContext.java:6036) > > at > > com > > .webobjects > > .eocontrol > > .EOObjectStoreCoordinator > > .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) > > > > at > > com > > .webobjects > > .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) > > > > > > And I found only updateObjects could has two entities's details and > > insertedObjects does not print out anything. > > > > Not sure this does not work in across models or something else need > > setup? > > > > thanks > > > > > > > > Xiaowen(Kevin) Ren > > > > Analyst Programmer > > Channel Applications, Retail Applications ANZ National Bank > Ltd Level > > 6 ASB Tower > > 2 Hunter Street > > PO Box 1791 > > Wellington > > Phone: 04 4365363 > > Fax: 04 8028696 > > > > > > > > > > > > "This e-mail and any attachments to it (the "Communication") is, > > unless otherwise stated, confidential, may contain > copyright material > > and is for the use only of the intended recipient. If you > receive the > > Communication in error, please notify the sender > immediately by return > > e-mail, delete the Communication and the return e-mail, and do not > > read, copy, retransmit or otherwise deal with it. Any views > expressed > > in the Communication are those of the individual sender > only, unless > > expressly stated to be those of Australia and New Zealand Banking > > Group Limited ABN 11 005 357 522, or any of its related entities > > including ANZ National Bank Limited (together "ANZ"). ANZ does not > > accept liability in connection with the integrity of or > errors in the > > Communication, computer virus, data corruption, > interference or delay > > arising from or in respect of the Communication." > > > > ___ > > Do not post admin requests to the list. They will be ignored. > > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > > Help/Unsubscribe/Update your Subscription: > > > http://lists.apple.com/mailman/options/webobjects-dev/chil
Re: NullPointerException in many-many relationship cross two models
Both models need to have the exact (and I _do_ mean _exact_) same connection dictionary. The dictionaries must be equals(). This is most easily accomplished by setting the programatically when the app loads. Wonder, of course, does this. Chuck On Dec 14, 2009, at 3:30 PM, Ren, Kevin wrote: Hi, There is m-m relationship between A and B entities which are in different models, but in same database. I can create and platen this relationship in EOModler and got AB table as well. AB is in the same DB and only has compound PK like A_ID and B_ID. When I tried to do saveChanges got this error [2009-12-15 12:6:48 NZDT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext .primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java: 4845) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForIntermediateRowFromSourceObject (EODatabaseContext.java:4863) at com .webobjects .eoaccess .EODatabaseContext .recordInsertForIntermediateRowFromSourceObject (EODatabaseContext.java:4888) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObject (EODatabaseContext.java:4913) at com .webobjects .eoaccess .EODatabaseContext .relayAttributesInRelationshipSourceObjectDestinationObjects (EODatabaseContext.java:4966) at com .webobjects .eoaccess .EODatabaseContext .recordChangesInEditingContext(EODatabaseContext.java:6036) at com .webobjects .eocontrol .EOObjectStoreCoordinator .saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) And I found only updateObjects could has two entities's details and insertedObjects does not print out anything. Not sure this does not work in across models or something else need setup? thanks Xiaowen(Kevin) Ren Analyst Programmer Channel Applications, Retail Applications ANZ National Bank Ltd Level 6 ASB Tower 2 Hunter Street PO Box 1791 Wellington Phone: 04 4365363 Fax: 04 8028696 "This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication." ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NullPointerException in many-many relationship cross two models
Hi, There is m-m relationship between A and B entities which are in different models, but in same database. I can create and platen this relationship in EOModler and got AB table as well. AB is in the same DB and only has compound PK like A_ID and B_ID. When I tried to do saveChanges got this error [2009-12-15 12:6:48 NZDT] java.lang.NullPointerException at com.webobjects.eoaccess.EODatabaseContext.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:4845) at com.webobjects.eoaccess.EODatabaseContext.databaseOperationForIntermediateRowFromSourceObject(EODatabaseContext.java:4863) at com.webobjects.eoaccess.EODatabaseContext.recordInsertForIntermediateRowFromSourceObject(EODatabaseContext.java:4888) at com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipSourceObjectDestinationObject(EODatabaseContext.java:4913) at com.webobjects.eoaccess.EODatabaseContext.relayAttributesInRelationshipSourceObjectDestinationObjects(EODatabaseContext.java:4966) at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(EODatabaseContext.java:6036) at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373) at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192) And I found only updateObjects could has two entities's details and insertedObjects does not print out anything. Not sure this does not work in across models or something else need setup? thanks Xiaowen(Kevin) Ren Analyst Programmer Channel Applications, Retail Applications ANZ National Bank Ltd Level 6 ASB Tower 2 Hunter Street PO Box 1791 Wellington Phone: 04 4365363 Fax: 04 8028696 "This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication." ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
Good news and bad news I guess. The good news is that I identified all the components that are wrapping the call to performParentAction() with a "swallowing" exception handler. I modified them all to extend my base component (MPVWOComponent). I added the performParentAction() to MPVWOComponent. Then I set a break point. It gets called a couple of times but never from the swallowers. In other words, none of the swallowers are participating in the action. So even though the performParentAction in WOComponent changes the current component and then calls pushValuesToParent() and pullValuesFromParent() without wrapping them in an exception handler, I don't think that is the problem in my case. So my new theory is that there is a swallower somewhere else that calls some portion of code (ours or WO's) that changes the current component and an exception is thrown without restoring the current context and then the exception swallower hides the problem. Sigh... LIfe is not easy sometimes!! :-) On Jun 26, 2009, at 12:12 PM, Ricardo J. Parada wrote: Wow... I did a search through all our projects for places where we call performParentAction() and I found a whole bunch of component that are catching and swallowing like this: try { String s = (String) valueForBinding("parentAction"); if (s != null) { performParentAction(s); } } catch (Exception e) { session.addUserMessagesFromException(e); return null; } Bad huh? :-) I'm changing all of these to extend the base class MPVWOComponent and then I should know which is getting the exception and what it is! On Jun 26, 2009, at 11:49 AM, Ricardo J. Parada wrote: On Jun 26, 2009, at 11:39 AM, Mike Schrag wrote: You are right... Good idea... but it may be challenging as the performParentAction() calls an action in a parent component and then that component also calls performParentAction()... and it's a long chain. So I need to look at all of them to find out... Hey, I did not write those components hehehe... but it's clear to me it is overly complex from the way I usually do things in WebObjects. And it's one of legacy components which seems to be screaming for re-design. :-) Thanks for the suggestions.. I'll try them to find out WHERE and WHY... The deep call trace is why i suggest putting a try/catch in your base component's performParentAction -- so all your components have to pass through yours ... SOMEONE in that chain is going to throw out -- it's required for this to fail. If it DOESN'T, then there's something else going on. Yep... working on this... I'm first making sure all the components extend my base class MPVWOComponent (who is a subclass of ERXComponent). then I'll put the performParentAction() in MPVWOComponent to try to catch the exception assuming it's happening. Thanks ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/rparada%40mac.com This email sent to rpar...@mac.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
Wow... I did a search through all our projects for places where we call performParentAction() and I found a whole bunch of component that are catching and swallowing like this: try { String s = (String) valueForBinding("parentAction"); if (s != null) { performParentAction(s); } } catch (Exception e) { session.addUserMessagesFromException(e); return null; } Bad huh? :-) I'm changing all of these to extend the base class MPVWOComponent and then I should know which is getting the exception and what it is! On Jun 26, 2009, at 11:49 AM, Ricardo J. Parada wrote: On Jun 26, 2009, at 11:39 AM, Mike Schrag wrote: You are right... Good idea... but it may be challenging as the performParentAction() calls an action in a parent component and then that component also calls performParentAction()... and it's a long chain. So I need to look at all of them to find out... Hey, I did not write those components hehehe... but it's clear to me it is overly complex from the way I usually do things in WebObjects. And it's one of legacy components which seems to be screaming for re-design. :-) Thanks for the suggestions.. I'll try them to find out WHERE and WHY... The deep call trace is why i suggest putting a try/catch in your base component's performParentAction -- so all your components have to pass through yours ... SOMEONE in that chain is going to throw out -- it's required for this to fail. If it DOESN'T, then there's something else going on. Yep... working on this... I'm first making sure all the components extend my base class MPVWOComponent (who is a subclass of ERXComponent). then I'll put the performParentAction() in MPVWOComponent to try to catch the exception assuming it's happening. Thanks ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/rparada %40mac.com This email sent to rpar...@mac.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
On Jun 26, 2009, at 11:39 AM, Mike Schrag wrote: You are right... Good idea... but it may be challenging as the performParentAction() calls an action in a parent component and then that component also calls performParentAction()... and it's a long chain. So I need to look at all of them to find out... Hey, I did not write those components hehehe... but it's clear to me it is overly complex from the way I usually do things in WebObjects. And it's one of legacy components which seems to be screaming for re-design. :-) Thanks for the suggestions.. I'll try them to find out WHERE and WHY... The deep call trace is why i suggest putting a try/catch in your base component's performParentAction -- so all your components have to pass through yours ... SOMEONE in that chain is going to throw out -- it's required for this to fail. If it DOESN'T, then there's something else going on. Yep... working on this... I'm first making sure all the components extend my base class MPVWOComponent (who is a subclass of ERXComponent). then I'll put the performParentAction() in MPVWOComponent to try to catch the exception assuming it's happening. Thanks ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
You are right... Good idea... but it may be challenging as the performParentAction() calls an action in a parent component and then that component also calls performParentAction()... and it's a long chain. So I need to look at all of them to find out... Hey, I did not write those components hehehe... but it's clear to me it is overly complex from the way I usually do things in WebObjects. And it's one of legacy components which seems to be screaming for re- design. :-) Thanks for the suggestions.. I'll try them to find out WHERE and WHY... The deep call trace is why i suggest putting a try/catch in your base component's performParentAction -- so all your components have to pass through yours ... SOMEONE in that chain is going to throw out -- it's required for this to fail. If it DOESN'T, then there's something else going on. ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
On Jun 26, 2009, at 11:23 AM, Mike Schrag wrote: My theory is that the performParentAction() changes the context's current component with the intention to restore it afterwards. But an exception may be occurring in a section of the code in performParentAction() which is not properly wrapped with an exception handler and so we end up with the wrong current component in the context. So it is definitely the case that performParentAction doesn't reset the current component in a finally block (which it seems like it should). However, it seems to me the only way this can fail is by throwing an exception OUT of performParentAction (inside the action that was called), which should manifest in YOUR code. There's not way I can see that you don't get a reset of the component without you also getting an exception. Is your code that calls performParentAction wrapped in a swallowing catch? I'm investigating to see if it's wrapped in a swallowing catch... And I see performParentAction() seems to be pushing bindings to the parent and that is not wrapped in an exception handler I think. It seems to me you're putting in a really weird hack and hiding the root cause of your problem which might just be hanging around to screw you again later in another weird way. I would figure out WHERE and WHY you aren't getting an exception out of performParentAction. You should be able to override performParentAction in your base component or in ERXComponent and wrap it in an exception handler so you can always see when that dies and then you can possibly trace who's swallowing it. You are right... Good idea... but it may be challenging as the performParentAction() calls an action in a parent component and then that component also calls performParentAction()... and it's a long chain. So I need to look at all of them to find out... Hey, I did not write those components hehehe... but it's clear to me it is overly complex from the way I usually do things in WebObjects. And it's one of legacy components which seems to be screaming for re- design. :-) Thanks for the suggestions.. I'll try them to find out WHERE and WHY... :-) ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
My theory is that the performParentAction() changes the context's current component with the intention to restore it afterwards. But an exception may be occurring in a section of the code in performParentAction() which is not properly wrapped with an exception handler and so we end up with the wrong current component in the context. So it is definitely the case that performParentAction doesn't reset the current component in a finally block (which it seems like it should). However, it seems to me the only way this can fail is by throwing an exception OUT of performParentAction (inside the action that was called), which should manifest in YOUR code. There's not way I can see that you don't get a reset of the component without you also getting an exception. Is your code that calls performParentAction wrapped in a swallowing catch? It seems to me you're putting in a really weird hack and hiding the root cause of your problem which might just be hanging around to screw you again later in another weird way. I would figure out WHERE and WHY you aren't getting an exception out of performParentAction. You should be able to override performParentAction in your base component or in ERXComponent and wrap it in an exception handler so you can always see when that dies and then you can possibly trace who's swallowing it. ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext -- [WORKAROUND]
My theory is that the performParentAction() changes the context's current component with the intention to restore it afterwards. But an exception may be occurring in a section of the code in performParentAction() which is not properly wrapped with an exception handler and so we end up with the wrong current component in the context. Does it make sense? With that theory in mind I wrote the following workaround which seems to be working. The method below is the invokeAction() method in my component that detects it should call the action method. Calling that action method goes through a whole lot of stuff and eventually calls performParentAction() which seems to be messing up the current component in the context because it's not catching an exception. And the exception may be getting caught at a higher level but at this point we have a messed up current component. The workaround is to read the current component before calling the action and then restore it afterwards as shown here in my component's invokeAction(). Notice the finally clause restoring the current component : public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) { ... some code omitted here which detects whether this component is the one that should call the action ... if so the shouldInvokeAction flag gets set if (shouldInvokeAction) { // Makes sure calling the action does not mess up the current // component which should remain as this component otherwise // WebObjects runs into a null pointer exception eventually // in _popComponentFromContext(). WOComponent current = wocontext.component(); WOActionResults obj = null; try { obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); } finally { wocontext._setCurrentComponent(current); // Tell context that an action was performed. If this is // not done, the form's default action will be called also. wocontext.setActionInvoked(true); } if (obj == null) { obj = wocontext.page(); } return obj; } // The action wasn't for us so try the child components WOActionResults childActionResults = super.invokeAction(worequest, wocontext); return childActionResults; } On Jun 26, 2009, at 8:59 AM, Ricardo J. Parada wrote: On Jun 26, 2009, at 12:55 AM, Chuck Hill wrote: On Jun 25, 2009, at 8:49 PM, Ricardo J. Parada wrote: Let me correct something I said: the action method is getting called!!! –– I was just confused the first time I looked. Anyways, the action method gets called and then that action method is calling performParentAction as follows: return performParentAction(s); I did not write that component and I rarely use the performParentAction. But that is returning null. And that is the value my component gets at line#113 and returns the page instead (is that bad? should I return the null value instead?). Returning context.page is best. Thanks... it's good to know. Then if I resume execution I get the null pointer exception in _popComponentFromContext() in WebObjects. Any chance the code called by performParentAction(s); is doing something bad? I just noticed that the context().component() right before calling performParentAction(s) is my component that triggered the action. BUT then, after I call performParentAction(s) I check the context().component() again and I noticed it has changed. Shouldn't it be the same? Anyways, I'm suspecting that's my problem. Because if I call context()._setCurrentComponent() to set the current component back to the one before calling performParentAction(s) then the exception no longer happens. Anyways, this is good progress... If the context current component was not supposed to change then I need to find out why it's changing. That may require a subclass of the editing context (which Wonder may already have) and then implement the _setCurrentComponent() and set a breakpoint so that I can see what's changing it. Chuck Still investigating... On Jun 25, 2009, at 10:59 PM, Ricardo J. Parada wrote: Well here's what I'm seeing... my component determines that it is the one that should invoke the action and goes through this code: // Tell context that an action was performed. If this is // not done, the form's default action will be called also. 111:wocontext.setActionInvoked(true); 112: 113: WOActionResults obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); 114:if (obj == null) obj =
Re: NullPointerException in _popComponentFromContext
On Jun 26, 2009, at 12:55 AM, Chuck Hill wrote: On Jun 25, 2009, at 8:49 PM, Ricardo J. Parada wrote: Let me correct something I said: the action method is getting called!!! –– I was just confused the first time I looked. Anyways, the action method gets called and then that action method is calling performParentAction as follows: return performParentAction(s); I did not write that component and I rarely use the performParentAction. But that is returning null. And that is the value my component gets at line#113 and returns the page instead (is that bad? should I return the null value instead?). Returning context.page is best. Thanks... it's good to know. Then if I resume execution I get the null pointer exception in _popComponentFromContext() in WebObjects. Any chance the code called by performParentAction(s); is doing something bad? I just noticed that the context().component() right before calling performParentAction(s) is my component that triggered the action. BUT then, after I call performParentAction(s) I check the context().component() again and I noticed it has changed. Shouldn't it be the same? Anyways, I'm suspecting that's my problem. Because if I call context()._setCurrentComponent() to set the current component back to the one before calling performParentAction(s) then the exception no longer happens. Anyways, this is good progress... If the context current component was not supposed to change then I need to find out why it's changing. That may require a subclass of the editing context (which Wonder may already have) and then implement the _setCurrentComponent() and set a breakpoint so that I can see what's changing it. Chuck Still investigating... On Jun 25, 2009, at 10:59 PM, Ricardo J. Parada wrote: Well here's what I'm seeing... my component determines that it is the one that should invoke the action and goes through this code: // Tell context that an action was performed. If this is // not done, the form's default action will be called also. 111:wocontext.setActionInvoked(true); 112: 113: WOActionResults obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); 114:if (obj == null) obj = wocontext.page(); 115: 116:return obj; Line # 113 should be calling the action method that is bound to the action binding. That is the method on which I set the breakpoint that I was referring to earlier. The one I never hit. So if I don't hit the breakpoint then it's not calling it. But it is calling something else because I see stuff show on the console every time I evaluate the expression valueForBinding(ACTION_BINDING_KEY). Anyways, I'll try to investigate what is getting called... or maybe take a look at valueForBinding to find out why it's not calling the right thing. If I evaluate the expression _associationWithName(ACTION_BINDING_KEY) in the debugger right after line #113 I get the following: (ognl.helperfunction.WOHelperFunctionBindingNameAssociation) keyPath=^action> On Jun 25, 2009, at 10:19 PM, Chuck Hill wrote: On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote: On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. I really ought to take better notes when I hit things like this. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev
Re: NullPointerException in _popComponentFromContext
On Jun 25, 2009, at 8:49 PM, Ricardo J. Parada wrote: Let me correct something I said: the action method is getting called!!! –– I was just confused the first time I looked. Anyways, the action method gets called and then that action method is calling performParentAction as follows: return performParentAction(s); I did not write that component and I rarely use the performParentAction. But that is returning null. And that is the value my component gets at line#113 and returns the page instead (is that bad? should I return the null value instead?). Returning context.page is best. Then if I resume execution I get the null pointer exception in _popComponentFromContext() in WebObjects. Any chance the code called by performParentAction(s); is doing something bad? Chuck Still investigating... On Jun 25, 2009, at 10:59 PM, Ricardo J. Parada wrote: Well here's what I'm seeing... my component determines that it is the one that should invoke the action and goes through this code: // Tell context that an action was performed. If this is // not done, the form's default action will be called also. 111:wocontext.setActionInvoked(true); 112: 113: WOActionResults obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); 114:if (obj == null) obj = wocontext.page(); 115: 116:return obj; Line # 113 should be calling the action method that is bound to the action binding. That is the method on which I set the breakpoint that I was referring to earlier. The one I never hit. So if I don't hit the breakpoint then it's not calling it. But it is calling something else because I see stuff show on the console every time I evaluate the expression valueForBinding(ACTION_BINDING_KEY). Anyways, I'll try to investigate what is getting called... or maybe take a look at valueForBinding to find out why it's not calling the right thing. If I evaluate the expression _associationWithName(ACTION_BINDING_KEY) in the debugger right after line #113 I get the following: (ognl.helperfunction.WOHelperFunctionBindingNameAssociation) keyPath=^action> On Jun 25, 2009, at 10:19 PM, Chuck Hill wrote: On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote: On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. I really ought to take better notes when I hit things like this. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/rparada%40mac.com This email sent to rpar...@mac.com -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext
Let me correct something I said: the action method is getting called!!! –– I was just confused the first time I looked. Anyways, the action method gets called and then that action method is calling performParentAction as follows: return performParentAction(s); I did not write that component and I rarely use the performParentAction. But that is returning null. And that is the value my component gets at line#113 and returns the page instead (is that bad? should I return the null value instead?). Then if I resume execution I get the null pointer exception in _popComponentFromContext() in WebObjects. Still investigating... On Jun 25, 2009, at 10:59 PM, Ricardo J. Parada wrote: Well here's what I'm seeing... my component determines that it is the one that should invoke the action and goes through this code: // Tell context that an action was performed. If this is // not done, the form's default action will be called also. 111:wocontext.setActionInvoked(true); 112: 113: WOActionResults obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); 114:if (obj == null) obj = wocontext.page(); 115: 116:return obj; Line # 113 should be calling the action method that is bound to the action binding. That is the method on which I set the breakpoint that I was referring to earlier. The one I never hit. So if I don't hit the breakpoint then it's not calling it. But it is calling something else because I see stuff show on the console every time I evaluate the expression valueForBinding(ACTION_BINDING_KEY). Anyways, I'll try to investigate what is getting called... or maybe take a look at valueForBinding to find out why it's not calling the right thing. If I evaluate the expression _associationWithName(ACTION_BINDING_KEY) in the debugger right after line #113 I get the following: (ognl.helperfunction.WOHelperFunctionBindingNameAssociation) keyPath=^action> On Jun 25, 2009, at 10:19 PM, Chuck Hill wrote: On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote: On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. I really ought to take better notes when I hit things like this. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/rparada %40mac.com This email sent to rpar...@mac.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext
Well here's what I'm seeing... my component determines that it is the one that should invoke the action and goes through this code: // Tell context that an action was performed. If this is // not done, the form's default action will be called also. 111:wocontext.setActionInvoked(true); 112: 113: WOActionResults obj = (WOActionResults) valueForBinding(ACTION_BINDING_KEY); 114:if (obj == null) obj = wocontext.page(); 115: 116:return obj; Line # 113 should be calling the action method that is bound to the action binding. That is the method on which I set the breakpoint that I was referring to earlier. The one I never hit. So if I don't hit the breakpoint then it's not calling it. But it is calling something else because I see stuff show on the console every time I evaluate the expression valueForBinding(ACTION_BINDING_KEY). Anyways, I'll try to investigate what is getting called... or maybe take a look at valueForBinding to find out why it's not calling the right thing. If I evaluate the expression _associationWithName(ACTION_BINDING_KEY) in the debugger right after line #113 I get the following: (ognl.helperfunction.WOHelperFunctionBindingNameAssociation) keyPath=^action> On Jun 25, 2009, at 10:19 PM, Chuck Hill wrote: On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote: On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. I really ought to take better notes when I hit things like this. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext
On Jun 25, 2009, at 7:10 PM, Ricardo J. Parada wrote: On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. I really ought to take better notes when I hit things like this. Chuck -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext
On Jun 25, 2009, at 9:53 PM, Chuck Hill wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? I see in the stack trace that it's going through the invokeAction phase. But the action method that is supposed to get called has not been called yet. I set a breakpoint in the method that it's supposed to get called but I hit the exception first and the action method never gets called. I'll set a breakpoint in the invokeAction() method of the component that is supposed to call the action to see how things look from there. From what I can tell the _popComponentFromContext() gets the current component from the context and then to message it and throws the null pointer exception because the current component is null for some obscure reason. Anyways, I'm taking a look at the invokeAction in my component. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NullPointerException in _popComponentFromContext
On Jun 25, 2009, at 6:49 PM, Ricardo J. Parada wrote: Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) I have seen this before. It is caused by the context not knowing the current component. This is hitting some action method. What is it returning? Chuck Jun 25 21:40:45 Phynance[58302] WARN NSLog - : Exception occurred while handling request: java.lang.NullPointerException [2009-6-25 21:40:45 EDT] java.lang.NullPointerException at com .webobjects .appserver ._private .WOComponentReference ._popComponentFromContext(WOComponentReference.java:108) at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:128) at er .extensions .components ._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at er .extensions .components._private.ERXWOForm.invokeAction(ERXWOForm.java:180) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at er .extensions .components .conditionals.ERXWOTemplate.invokeAction(ERXWOTemplate.java:50) at er .extensions .components .ERXWOComponentContent.invokeAction(ERXWOComponentContent.java:217) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at com .webobjects .appserver ._private.WOComponentContent.invokeAction(WOComponentContent.java:38) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:127) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com .webobjects .appserver ._private .WOComponentReference.invokeAction(WOComponentReference.java:127) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java: 115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java: 92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com.webobjects.appserver.WOSession.invokeAction(WOSession.java: 1357) at com.mpv.webcomponents.MPVWOSession.invokeAction(MPVWOSession.java:175) at com .webobjects.appserver.WOApplication.invokeAction(WOApplication.java: 1745) at er .extensions .appserver .ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:50) at er .extensions .appserver.ERXApplication.invokeAction(ERXApplication.java:1657) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedPage(WOComponentRequestHandler.java:206) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedSession(WOComponentRequestHandler.java:298) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332) at com .webobjects .appserver ._private .WOComponentRequestHandler ._handleRequest(WOComponentRequestHandler.java:369) at com .webobjects .appserver ._private .WOComponentRequestHandler .handleRequest(WOComponentRequestHandler.java:442) at com .webobjects .appserver.WOApplication.dispatchRequest(WOApplication.java:1687) at
NullPointerException in _popComponentFromContext
Sigh... Does anybody see anything obvious in this stack trace? I used to have this exception ages ago and it was obscure. I don't recall what ended up fixing it exactly but now that I moved my application to Wonder I'm running into this again and haven't figured out yet why or how to fix it. Any ideas?? Pleeeassee!! :-) Jun 25 21:40:45 Phynance[58302] WARN NSLog - : Exception occurred while handling request: java.lang.NullPointerException [2009-6-25 21:40:45 EDT] java.lang.NullPointerException at com .webobjects .appserver ._private .WOComponentReference ._popComponentFromContext(WOComponentReference.java:108) at com .webobjects .appserver ._private.WOComponentReference.invokeAction(WOComponentReference.java: 128) at er .extensions .components ._private.ERXSwitchComponent.invokeAction(ERXSwitchComponent.java:117) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er .extensions.components._private.ERXWOForm.invokeAction(ERXWOForm.java: 180) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at er .extensions .components.conditionals.ERXWOTemplate.invokeAction(ERXWOTemplate.java: 50) at er .extensions .components .ERXWOComponentContent.invokeAction(ERXWOComponentContent.java:217) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com .webobjects .appserver ._private.WOComponentContent.invokeAction(WOComponentContent.java:38) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com .webobjects .appserver ._private.WOComponentReference.invokeAction(WOComponentReference.java: 127) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com .webobjects .appserver ._private.WOComponentReference.invokeAction(WOComponentReference.java: 127) at com .webobjects .appserver ._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:105) at com .webobjects .appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:115) at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java: 1079) at er.extensions.components.ERXComponent.invokeAction(ERXComponent.java:92) at er .extensions .components .ERXNonSynchronizingComponent .invokeAction(ERXNonSynchronizingComponent.java:60) at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1357) at com.mpv.webcomponents.MPVWOSession.invokeAction(MPVWOSession.java: 175) at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java: 1745) at er .extensions .appserver .ajax.ERXAjaxApplication.invokeAction(ERXAjaxApplication.java:50) at er .extensions.appserver.ERXApplication.invokeAction(ERXApplication.java: 1657) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedPage(WOComponentRequestHandler.java:206) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedSession(WOComponentRequestHandler.java:298) at com .webobjects .appserver ._private .WOComponentRequestHandler ._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332) at com .webobjects .appserver ._private .WOComponentRequestHandler ._handleRequest(WOComponentRequestHandler.java:369) at com .webobjects .appserver ._private .WOComponentRequestHandler .handleRequest(WOComponentRequestHandler.java:442) at com .webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java: 1687) at er .extensions .appserver .ERXApplication.dispatchRequestImmediately(ERXApplication.java:1772) at er .extensions .appserver.ERXApplication.dispatchRequest(ERXApplication.java:1737) at com .webobjects .appserver._private.WOWorkerThre
Re: You crossed editing context boundaries...Fixzed, now NullPointerException, now fixing db
19 PM, WebObjects wrote: mmm.. weird I tried to add it one by one using the addObjectToBothSidesOfRelationshipWithKey() method and it stills giving me the java.lang.nullpointerexception :S:S:S: maybe something wrong with my EOModel??? Im attaching it.. The join table between Employee and Turn looks whacked. - It has a three way compound primary key. (employeeId, id, turnId) - It has a 'creationDate' attribute. - It participates in a flattened relationship between Employee and Turn. EOF is not going to know how generate that three way compound primary key. If EmployeeXTurn is just a join table and is going to be flattened out of the object graph then it should just have a 2 way compound PK based on the FKs from Employee and Turn and it should NOT have any other attributes. If EmployeeXTurn has attributes you need to gain access to (i.e. creationDate) then you should treat it like a standard EO. - Remove the flattened relationships from Employee to Turn - Expose the relationships from Employee and Turn to EmployeeXTurn - Use only id as the PK. - Manage the creation of EmployeeXTurn manually. apart of the consistency names and other stuff, are the relations good? Regards Gus On Oct 14, 2008, at 7:43 PM, Ricardo J. Parada wrote: How about your registerTurns() method? Did you change it to use myEC instead of ERXEC.newEditingContext()? On Oct 14, 2008, at 8:17 PM, WebObjects wrote: aha... you are right, after whole day sitting here, I didn't realize I had teh emp at login with the session().defaultEditingContext, and here at PaguinaUsuario I m using another one. My mind its kind of distracted... I made the changes, and still Im getting the nullpointerexception java.lang.NullPointerException [2008-10-14 19:13:51 COT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext ._objectFaultWithSnapshotRelationshipEditingContext (EODatabaseContext.java:2356) at com .webobjects .eoaccess .EODatabaseContext ._fireDeferredFaultWithSourceObject(EODatabaseContext.java: 2401) at com .webobjects .eoaccess .EOAccessDeferredFaultHandler .createFaultForDeferredFault (EOAccessDeferredFaultHandler.java:49) at com .webobjects .eocontrol .EOCustomObject.willReadRelationship(EOCustomObject.java: 1279) at er .extensions .eof .ERXGenericRecord .willReadRelationship(ERXGenericRecord.java:348) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary $Initializer $ _LazyGenericRecordBinding .valueInObject(_EOMutableKnownKeyDictionary.java:614) at com .webobjects .eocontrol .EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForObject(EODatabaseContext.java:4814) at com .webobjects .eoaccess .EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535) at com .webobjects .eocontrol .EOObjectStoreCoordinator .valuesForKeys(EOObjectStoreCoordinator.java:326) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ _KeyValueQualifierSupport .schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:439) at er.extensions.ERXExtensions $ KeyValueQualifierSQLGenerationSupport .schemaBasedQualifierWithRootEntity(ERXExtensions.java:304) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ Support ._schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:179) at com .webobjects .eoaccess .EODatabaseChannel .selectObjectsWithFetchSpecification(EODatabaseChannel.java: 227) and more much more. On Oct 14, 2008, at 7:06 PM, Ricardo J. Parada wrote: It looks like you got the employee object using the session's default editing context. And you are saying that your PaginaUsuario creates its own editing context in the constructor. So there you have it: two different editing contexts. I would modify your setEmp() method in the PaginaUsuario that you make a copy of the emp object passed in to the editing context used in that page. Something like this: public void estEmp(Employee anEmp) { emp = anEmp.localInstanceIn(myEC); } Then your registerTurns() method is yet creating another editing context. Shouldn't that be also myEC?? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com ) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com This email sent to [EMAIL PROTECTED] ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile:http://www.linkedin.com/in/davidleber twitter:http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org
Re: You crossed editing context boundaries...Fixzed, now NullPointerException, now fixing db
EOF is not going to know how generate that three way compound primary key. If EmployeeXTurn is just a join table and is going to be flattened out of the object graph then it should just have a 2 way compound PK based on the FKs from Employee and Turn and it should NOT have any other attributes. If EmployeeXTurn has attributes you need to gain access to (i.e. creationDate) then you should treat it like a standard EO. - Remove the flattened relationships from Employee to Turn - Expose the relationships from Employee and Turn to EmployeeXTurn - Use only id as the PK. - Manage the creation of EmployeeXTurn manually. apart of the consistency names and other stuff, are the relations good? Regards Gus On Oct 14, 2008, at 7:43 PM, Ricardo J. Parada wrote: How about your registerTurns() method? Did you change it to use myEC instead of ERXEC.newEditingContext()? On Oct 14, 2008, at 8:17 PM, WebObjects wrote: aha... you are right, after whole day sitting here, I didn't realize I had teh emp at login with the session().defaultEditingContext, and here at PaguinaUsuario I m using another one. My mind its kind of distracted... I made the changes, and still Im getting the nullpointerexception java.lang.NullPointerException [2008-10-14 19:13:51 COT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext ._objectFaultWithSnapshotRelationshipEditingContext (EODatabaseContext.java:2356) at com .webobjects .eoaccess .EODatabaseContext ._fireDeferredFaultWithSourceObject(EODatabaseContext.java: 2401) at com .webobjects .eoaccess .EOAccessDeferredFaultHandler .createFaultForDeferredFault (EOAccessDeferredFaultHandler.java:49) at com .webobjects .eocontrol .EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at er .extensions .eof .ERXGenericRecord.willReadRelationship(ERXGenericRecord.java: 348) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary $Initializer $ _LazyGenericRecordBinding .valueInObject(_EOMutableKnownKeyDictionary.java:614) at com .webobjects .eocontrol .EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForObject(EODatabaseContext.java:4814) at com .webobjects .eoaccess .EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535) at com .webobjects .eocontrol .EOObjectStoreCoordinator .valuesForKeys(EOObjectStoreCoordinator.java:326) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ _KeyValueQualifierSupport .schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:439) at er.extensions.ERXExtensions $ KeyValueQualifierSQLGenerationSupport .schemaBasedQualifierWithRootEntity(ERXExtensions.java:304) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ Support ._schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:179) at com .webobjects .eoaccess .EODatabaseChannel .selectObjectsWithFetchSpecification(EODatabaseChannel.java: 227) and more much more. On Oct 14, 2008, at 7:06 PM, Ricardo J. Parada wrote: It looks like you got the employee object using the session's default editing context. And you are saying that your PaginaUsuario creates its own editing context in the constructor. So there you have it: two different editing contexts. I would modify your setEmp() method in the PaginaUsuario that you make a copy of the emp object passed in to the editing context used in that page. Something like this: public void estEmp(Employee anEmp) { emp = anEmp.localInstanceIn(myEC); } Then your registerTurns() method is yet creating another editing context. Shouldn't that be also myEC?? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com This email sent to [EMAIL PROTECTED] ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile:http://www.linkedin.com/in/davidleber twitter:http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.co
Re: You crossed editing context boundaries...Fixzed, now NullPointerException, now fixing db
ess to (i.e. creationDate) then you should treat it like a standard EO. - Remove the flattened relationships from Employee to Turn - Expose the relationships from Employee and Turn to EmployeeXTurn - Use only id as the PK. - Manage the creation of EmployeeXTurn manually. apart of the consistency names and other stuff, are the relations good? Regards Gus On Oct 14, 2008, at 7:43 PM, Ricardo J. Parada wrote: How about your registerTurns() method? Did you change it to use myEC instead of ERXEC.newEditingContext()? On Oct 14, 2008, at 8:17 PM, WebObjects wrote: aha... you are right, after whole day sitting here, I didn't realize I had teh emp at login with the session().defaultEditingContext, and here at PaguinaUsuario I m using another one. My mind its kind of distracted... I made the changes, and still Im getting the nullpointerexception java.lang.NullPointerException [2008-10-14 19:13:51 COT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext ._objectFaultWithSnapshotRelationshipEditingContext (EODatabaseContext.java:2356) at com .webobjects .eoaccess .EODatabaseContext ._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2401) at com .webobjects .eoaccess .EOAccessDeferredFaultHandler .createFaultForDeferredFault(EOAccessDeferredFaultHandler.java: 49) at com .webobjects .eocontrol .EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at er .extensions .eof .ERXGenericRecord.willReadRelationship(ERXGenericRecord.java: 348) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary $Initializer $ _LazyGenericRecordBinding .valueInObject(_EOMutableKnownKeyDictionary.java:614) at com .webobjects .eocontrol .EOCustomObject.storedValueForKey(EOCustomObject.java:1634) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForObject(EODatabaseContext.java:4814) at com .webobjects .eoaccess .EODatabaseContext.valuesForKeys(EODatabaseContext.java:6535) at com .webobjects .eocontrol .EOObjectStoreCoordinator .valuesForKeys(EOObjectStoreCoordinator.java:326) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ _KeyValueQualifierSupport .schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:439) at er.extensions.ERXExtensions $ KeyValueQualifierSQLGenerationSupport .schemaBasedQualifierWithRootEntity(ERXExtensions.java:304) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ Support ._schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:179) at com .webobjects .eoaccess .EODatabaseChannel .selectObjectsWithFetchSpecification(EODatabaseChannel.java:227) and more much more. On Oct 14, 2008, at 7:06 PM, Ricardo J. Parada wrote: It looks like you got the employee object using the session's default editing context. And you are saying that your PaginaUsuario creates its own editing context in the constructor. So there you have it: two different editing contexts. I would modify your setEmp() method in the PaginaUsuario that you make a copy of the emp object passed in to the editing context used in that page. Something like this: public void estEmp(Employee anEmp) { emp = anEmp.localInstanceIn(myEC); } Then your registerTurns() method is yet creating another editing context. Shouldn't that be also myEC?? ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com This email sent to [EMAIL PROTECTED] ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile:http://www.linkedin.com/in/davidleber twitter:http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: You crossed editing context boundaries...Fixzed, no NullPointerException, now fixing db
Hi Gus, Sorry to be so late on this thread as I am the one that suggested you model your application like this. Flattening makes many-to-many relationships more convenient, BUT it only works if the join table is nothing but a join table that exists simply to manage a relationship. The fact is that in this situation it is not _just_ a join table. It contains important business information. You will need to manage this table manually. But with WO, "manually" is still pretty simple. Treat it like any other relationship. You'll just need to use key paths to resolve the relationship and you can create your own convenience methods for this so you only have to do it once. For example, if you want all a Turn's employees, create the following method on Turn: public NSArray employees() { return employeeXTurns().valueForKey("Employee"); } OR, if more safely: public NSArray employees() { return employeeXTurns(). valueForKey(EmployeeXTurn.EMPLOYEE_KEY); } Don't go changing your Entity Model to make your programming easier. Make it match the real world as closely as possible - that in itself will make developing your application easier. Dave On Oct 15, 2008, at 11:03 AM, WebObjects wrote: well is it easier to manage it leaving EOF to handle the relationships, i guess, so if ther is a way to get the date the turn was assigned to the Employee not doing it by the EmployeeXTurn Entity, then will be fine, just I can't see it where, or how. Gus Begin forwarded message: From: WebObjects <[EMAIL PROTECTED]> Date: October 15, 2008 9:58:11 AM GMT-05:00 To: David LeBer <[EMAIL PROTECTED]> Cc: WebObjects-Dev Apple Subject: Re: You crossed editing context boundaries... Aha, I need the CreationDate in the EmployeeXTurn table because I will need to know sometimes when was created the turn by the employee, for administrative reasons. So following your advise I will need to make the relatonship again, but this time I shouldn't flattened (im not familiar with the term ;-)) ... ok let me see if I can do it, the only problem i see, is that i tried once to leave id as the only PK, but then when trying to make the relationship, EOModeler complained when trying to make the relationship to attributes that weren't PK, Im gonna try it once again.. I will let you know. Gus PS taking care of babies and trying to programing hard work. On Oct 14, 2008, at 10:32 PM, David LeBer wrote: On 14-Oct-08, at 10:19 PM, WebObjects wrote: mmm.. weird I tried to add it one by one using the addObjectToBothSidesOfRelationshipWithKey() method and it stills giving me the java.lang.nullpointerexception :S:S:S: maybe something wrong with my EOModel??? Im attaching it.. The join table between Employee and Turn looks whacked. - It has a three way compound primary key. (employeeId, id, turnId) - It has a 'creationDate' attribute. - It participates in a flattened relationship between Employee and Turn. EOF is not going to know how generate that three way compound primary key. If EmployeeXTurn is just a join table and is going to be flattened out of the object graph then it should just have a 2 way compound PK based on the FKs from Employee and Turn and it should NOT have any other attributes. If EmployeeXTurn has attributes you need to gain access to (i.e. creationDate) then you should treat it like a standard EO. - Remove the flattened relationships from Employee to Turn - Expose the relationships from Employee and Turn to EmployeeXTurn - Use only id as the PK. - Manage the creation of EmployeeXTurn manually. apart of the consistency names and other stuff, are the relations good? Regards Gus On Oct 14, 2008, at 7:43 PM, Ricardo J. Parada wrote: How about your registerTurns() method? Did you change it to use myEC instead of ERXEC.newEditingContext()? On Oct 14, 2008, at 8:17 PM, WebObjects wrote: aha... you are right, after whole day sitting here, I didn't realize I had teh emp at login with the session().defaultEditingContext, and here at PaguinaUsuario I m using another one. My mind its kind of distracted... I made the changes, and still Im getting the nullpointerexception java.lang.NullPointerException [2008-10-14 19:13:51 COT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext ._objectFaultWithSnapshotRelationshipEditingContext (EODatabaseContext.java:2356) at com .webobjects .eoaccess .EODatabaseContext ._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2401) at com .webobjects .eoaccess .EOAccessDeferredFaultHandler .createFaultForDeferredFault(EOAccessDeferredFaultHandler.java: 49) at com .webobjects .eocontrol .EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at er .extensions .eof .ERXGenericRecord.willReadRelationship(ERXGenericRecord.java
Re: You crossed editing context boundaries...Fixzed, no NullPointerException, now fixing db
well is it easier to manage it leaving EOF to handle the relationships, i guess, so if ther is a way to get the date the turn was assigned to the Employee not doing it by the EmployeeXTurn Entity, then will be fine, just I can't see it where, or how. Gus Begin forwarded message: From: WebObjects <[EMAIL PROTECTED]> Date: October 15, 2008 9:58:11 AM GMT-05:00 To: David LeBer <[EMAIL PROTECTED]> Cc: WebObjects-Dev Apple Subject: Re: You crossed editing context boundaries... Aha, I need the CreationDate in the EmployeeXTurn table because I will need to know sometimes when was created the turn by the employee, for administrative reasons. So following your advise I will need to make the relatonship again, but this time I shouldn't flattened (im not familiar with the term ;-)) ... ok let me see if I can do it, the only problem i see, is that i tried once to leave id as the only PK, but then when trying to make the relationship, EOModeler complained when trying to make the relationship to attributes that weren't PK, Im gonna try it once again.. I will let you know. Gus PS taking care of babies and trying to programing hard work. On Oct 14, 2008, at 10:32 PM, David LeBer wrote: On 14-Oct-08, at 10:19 PM, WebObjects wrote: mmm.. weird I tried to add it one by one using the addObjectToBothSidesOfRelationshipWithKey() method and it stills giving me the java.lang.nullpointerexception :S:S:S: maybe something wrong with my EOModel??? Im attaching it.. The join table between Employee and Turn looks whacked. - It has a three way compound primary key. (employeeId, id, turnId) - It has a 'creationDate' attribute. - It participates in a flattened relationship between Employee and Turn. EOF is not going to know how generate that three way compound primary key. If EmployeeXTurn is just a join table and is going to be flattened out of the object graph then it should just have a 2 way compound PK based on the FKs from Employee and Turn and it should NOT have any other attributes. If EmployeeXTurn has attributes you need to gain access to (i.e. creationDate) then you should treat it like a standard EO. - Remove the flattened relationships from Employee to Turn - Expose the relationships from Employee and Turn to EmployeeXTurn - Use only id as the PK. - Manage the creation of EmployeeXTurn manually. apart of the consistency names and other stuff, are the relations good? Regards Gus On Oct 14, 2008, at 7:43 PM, Ricardo J. Parada wrote: How about your registerTurns() method? Did you change it to use myEC instead of ERXEC.newEditingContext()? On Oct 14, 2008, at 8:17 PM, WebObjects wrote: aha... you are right, after whole day sitting here, I didn't realize I had teh emp at login with the session().defaultEditingContext, and here at PaguinaUsuario I m using another one. My mind its kind of distracted... I made the changes, and still Im getting the nullpointerexception java.lang.NullPointerException [2008-10-14 19:13:51 COT] java.lang.NullPointerException at com .webobjects .eoaccess .EODatabaseContext ._objectFaultWithSnapshotRelationshipEditingContext (EODatabaseContext.java:2356) at com .webobjects .eoaccess .EODatabaseContext ._fireDeferredFaultWithSourceObject(EODatabaseContext.java:2401) at com .webobjects .eoaccess .EOAccessDeferredFaultHandler .createFaultForDeferredFault(EOAccessDeferredFaultHandler.java:49) at com .webobjects .eocontrol .EOCustomObject.willReadRelationship(EOCustomObject.java:1279) at er .extensions .eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java: 348) at com.webobjects.eocontrol._EOMutableKnownKeyDictionary $Initializer $ _LazyGenericRecordBinding .valueInObject(_EOMutableKnownKeyDictionary.java:614) at com .webobjects .eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java: 1634) at com .webobjects .eoaccess .EODatabaseContext .databaseOperationForObject(EODatabaseContext.java:4814) at com .webobjects .eoaccess.EODatabaseContext.valuesForKeys(EODatabaseContext.java: 6535) at com .webobjects .eocontrol .EOObjectStoreCoordinator .valuesForKeys(EOObjectStoreCoordinator.java:326) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ _KeyValueQualifierSupport .schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:439) at er.extensions.ERXExtensions $ KeyValueQualifierSQLGenerationSupport .schemaBasedQualifierWithRootEntity(ERXExtensions.java:304) at com.webobjects.eoaccess.EOQualifierSQLGeneration $ Support ._schemaBasedQualifierWithRootEntity (EOQualifierSQLGeneration.java:179) at com .webobjects .eoaccess .EODatabaseChannel .selectObjectsWithFetchSpecification(EODatabaseChannel.java:227) and more much more. On Oct 14, 2008, at 7:06 PM, Ricardo J. Parada wrote: It looks like you got the employee object using the session's
Re: NullPointerException
Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. __!!! Oh come on now. A little humility, please. :-) Steve Well, I did say "should" not "does". :-P For the record, I actually DID fix this bug about 2 years ago, but removed the patch because it had another side-effect that was arguably more confusing :) ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
On Oct 1, 2008, at 2:23 PM, Steve Quirk wrote: On Wed, 1 Oct 2008, Chuck Hill wrote: Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. __!!! Oh come on now. A little humility, please. :-) Steve Well, I did say "should" not "does". :-P Anyone have an idea on this? Chuck On Oct 1, 2008, at 7:40 AM, Awbrey Hughlett wrote: I am using Wonder 5.3 and I have found a few things saying there was a bug with WOForm in that version. Is this the case here? Form : WOForm { } SpecificType : WOTextField { value = specific.specificType; } SaveChanges : WOSubmitButton { action = saveChanges; value = "Save"; } Awbrey On Oct 1, 2008, at 1:01 AM, Chuck Hill wrote: Please keep messages on the list. ^ now I understand what you are saying :( oops sorry That error seems very odd. What is in the HTML and WOD? Chuck On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote: File Line# Method Package WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote: On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific )EOUtilities.createAndInsertInstance(editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
On Wed, 1 Oct 2008, Chuck Hill wrote: Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. __!!! Oh come on now. A little humility, please. :-) Steve Anyone have an idea on this? Chuck On Oct 1, 2008, at 7:40 AM, Awbrey Hughlett wrote: I am using Wonder 5.3 and I have found a few things saying there was a bug with WOForm in that version. Is this the case here? Form : WOForm { } SpecificType : WOTextField { value = specific.specificType; } SaveChanges : WOSubmitButton { action = saveChanges; value = "Save"; } Awbrey On Oct 1, 2008, at 1:01 AM, Chuck Hill wrote: Please keep messages on the list. ^ now I understand what you are saying :( oops sorry That error seems very odd. What is in the HTML and WOD? Chuck On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote: File Line# Method Package WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote: On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
That worked. Thanks, Awbrey On Oct 1, 2008, at 3:03 PM, Mike Schrag wrote: I am using a WOHyperlink from main to the component with pageName bound to the component. Is SpecificEntry component the actual page you're going to? Meaning is the first tag on the page and there's no , etc? I seem to recall there's an obscure bug where if you start a page level component with a form, it breaks might be what you're seeing. ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/athughlett% 40gmail.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
I am using a WOHyperlink from main to the component with pageName bound to the component. Is SpecificEntry component the actual page you're going to? Meaning is the first tag on the page and there's no , etc? I seem to recall there's an obscure bug where if you start a page level component with a form, it breaks might be what you're seeing. ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
I am using a WOHyperlink from main to the component with pageName bound to the component. Awbrey On Oct 1, 2008, at 2:26 PM, Mike Schrag wrote: Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. How are you creating this page? By any chance did you not create it with pageWithName? ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/athughlett% 40gmail.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. How are you creating this page? By any chance did you not create it with pageWithName? ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug. Anyone have an idea on this? Chuck On Oct 1, 2008, at 7:40 AM, Awbrey Hughlett wrote: I am using Wonder 5.3 and I have found a few things saying there was a bug with WOForm in that version. Is this the case here? Form : WOForm { } SpecificType : WOTextField { value = specific.specificType; } SaveChanges : WOSubmitButton { action = saveChanges; value = "Save"; } Awbrey On Oct 1, 2008, at 1:01 AM, Chuck Hill wrote: Please keep messages on the list. ^ now I understand what you are saying :( oops sorry That error seems very odd. What is in the HTML and WOD? Chuck On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote: File Line# Method Package WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote: On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-de
Re: NullPointerException
I am using Wonder 5.3 and I have found a few things saying there was a bug with WOForm in that version. Is this the case here? Form : WOForm { } SpecificType : WOTextField { value = specific.specificType; } SaveChanges : WOSubmitButton { action = saveChanges; value = "Save"; } Awbrey On Oct 1, 2008, at 1:01 AM, Chuck Hill wrote: Please keep messages on the list. ^ now I understand what you are saying :( oops sorry That error seems very odd. What is in the HTML and WOD? Chuck On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote: File Line# Method Package WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote: On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges () all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance (editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net This email sent to [EMAIL PROTECTED] -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
Please keep messages on the list. That error seems very odd. What is in the HTML and WOD? Chuck On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote: File Line# Method Package WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote: On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException
On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote: I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? You have other problems, some of which you probably don't know about. public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); Noo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here: 1. Start using Wonder and ERXEC 2. Use session().defaultEditingContext() - though this has issues of its own 3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management. public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); Post the stack track for for NPE. Guessing is too hard. Chuck } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to [EMAIL PROTECTED] -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
NullPointerException
I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems? public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext(); public SpecificEntry(WOContext context) { super(context); } public Specific specific() { if (specific == null) { editingContext().revert(); specific = (Specific)EOUtilities.createAndInsertInstance (editingContext(), "Specific"); } return specific; } public WOComponent saveChanges() { editingContext().saveChanges(); setSpecific(null); return context().page(); } public EOEditingContext editingContext() { return ec; } public void setSpecific(Specific newSpecific) { specific = newSpecific; } } Thanks, Awbrey ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: WOLips ( Entity Modeler ) MySQL JDBC NullPointerException
If you are using WebObjects 5.4, the SQL generation is broken. It works just fine in 5.3. http://lists.apple.com/archives/webobjects-dev/2008/Apr/msg00585.html Dave On May 22, 2008, at 3:53 AM, Francisc Simon wrote: Hi @all, i've tried to connect to my mysql database and create the sql with Entity Modeler but it gives me the following error: Can somebody help me please ? THX :-) java.lang.RuntimeException: Failed to generate SQL. at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory $ ReflectionSQLGenerator .generateSchemaCreationScript(EOFSQLGeneratorFactory.java:57) at org .objectstyle .wolips .eomodeler .actions.GenerateSQLDialog.generateSql(GenerateSQLDialog.java:271) at org.objectstyle.wolips.eomodeler.actions.GenerateSQLDialog $1.run(GenerateSQLDialog.java:252) at java.lang.Thread.run(Thread.java:613) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory $ ReflectionSQLGenerator .generateSchemaCreationScript(EOFSQLGeneratorFactory.java:55) ... 3 more Caused by: java.lang.NullPointerException at com .webobjects .jdbcadaptor .JDBCExpression.columnTypeStringForAttribute(JDBCExpression.java:160) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory ._columnCreationClauseForAttribute (EOSchemaSynchronizationFactory.java:2124) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .createTableStatementsForEntityGroup (EOSchemaSynchronizationFactory.java:350) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .createTableStatementsForEntityGroups (EOSchemaSynchronizationFactory.java:500) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .schemaCreationStatementsForEntities (EOSchemaSynchronizationFactory.java:887) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .schemaCreationScriptForEntities(EOSchemaSynchronizationFactory.java: 685) at com .webobjects .eoaccess .EOSynchronizationFactory .schemaCreationScriptForEntities(EOSynchronizationFactory.java:220) at org .objectstyle .wolips .eomodeler .core .sql .EOFSQLGenerator.generateSchemaCreationScript(EOFSQLGenerator.java: 407) ... 8 more ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
WOLips ( Entity Modeler ) MySQL JDBC NullPointerException
Hi @all, i've tried to connect to my mysql database and create the sql with Entity Modeler but it gives me the following error: Can somebody help me please ? THX :-) java.lang.RuntimeException: Failed to generate SQL. at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory $ ReflectionSQLGenerator .generateSchemaCreationScript(EOFSQLGeneratorFactory.java:57) at org .objectstyle .wolips .eomodeler .actions.GenerateSQLDialog.generateSql(GenerateSQLDialog.java:271) at org.objectstyle.wolips.eomodeler.actions.GenerateSQLDialog $1.run(GenerateSQLDialog.java:252) at java.lang.Thread.run(Thread.java:613) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) at sun .reflect .DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 25) at java.lang.reflect.Method.invoke(Method.java:585) at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory $ ReflectionSQLGenerator .generateSchemaCreationScript(EOFSQLGeneratorFactory.java:55) ... 3 more Caused by: java.lang.NullPointerException at com .webobjects .jdbcadaptor .JDBCExpression.columnTypeStringForAttribute(JDBCExpression.java:160) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory ._columnCreationClauseForAttribute(EOSchemaSynchronizationFactory.java: 2124) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .createTableStatementsForEntityGroup (EOSchemaSynchronizationFactory.java:350) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .createTableStatementsForEntityGroups (EOSchemaSynchronizationFactory.java:500) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .schemaCreationStatementsForEntities (EOSchemaSynchronizationFactory.java:887) at com .webobjects .eoaccess .synchronization .EOSchemaSynchronizationFactory .schemaCreationScriptForEntities(EOSchemaSynchronizationFactory.java: 685) at com .webobjects .eoaccess .EOSynchronizationFactory .schemaCreationScriptForEntities(EOSynchronizationFactory.java:220) at org .objectstyle .wolips .eomodeler .core .sql.EOFSQLGenerator.generateSchemaCreationScript(EOFSQLGenerator.java: 407) ... 8 more ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException in ERXLogger.getERXLogger
On 27/02/2008, at 11:35 PM, Daniele Corti wrote: 2008/2/27, Yung-Luen Lan <[EMAIL PROTECTED]>: Hi all, I'm a newbie of both WebObjects and server programming who is responsible to maintain a WO project left by other guy several years ago. I've added some features and tested in Eclipse. However, during these year, I always encountered a problem when I want to update the ERExtensions.framework in /Library/Frameworks. When I replace the original ERExtensions.framework (whose version is believed ≤ Project WONDER 3) with new one, I got the exception: Do you also replace ERJar.framework? Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:271) at org.apache.log4j.LogManager.getLogger(LogManager.java:220) at org.apache.log4j.Logger.getLogger(Logger.java:156) at er.extensions.ERXLogger.getLogger(ERXLogger.java:111) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:91) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:121) at woserver.Application.(Application.java:25) And that's the very first line of my project. public class Application extends ERXApplication { public static final ERXLogger log = ERXLogger.getERXLogger( Application.class); Replace all of these with: [public/private] static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger( TheClass.class.getName() ); I've my Properties file configured like this: Here's what I've got. Modify as necessary... In Properties file: er.extensions.ERXProperties.OptionalConfigurationFiles=(Properties/ log4j.properties,...) And in Properties/log4j.properties: # log4j appender and formatting log4j.rootLogger=INFO, A1, myMail log4j.loggerFactory=er.extensions.ERXLogger$Factory # A1 is a ConsoleAppender log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=er.extensions.ERXPatternLayout #log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:% L) %x -%m%n log4j.appender.A1.layout.ConversionPattern=%r %-5p %d{ISO8601} [%t] (% C{3}, %M, %L) - %n%m%n%n # A2 is a DailyRollingFileAppender log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.file=/var/log/webobjects_apps/my.woa.log log4j.appender.A2.datePattern='.'-MM-dd log4j.appender.A2.append=true log4j.appender.A2.layout=er.extensions.ERXPatternLayout log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} [%t] (%c: %L) - %m%n # myMail is the SMTPAppender log4j.appender.myMail=org.apache.log4j.net.SMTPAppender log4j.appender.myMail.Threshold=ERROR log4j.appender.myMail.BufferSize=10 log4j.appender.myMail.From=<...snip...> log4j.appender.myMail.To=<...snip...> log4j.appender.myMail.SMTPHost=localhost log4j.appender.myMail.Subject=Log4J Error Message (<...snip...>) log4j.appender.myMail.layout=er.extensions.ERXPatternLayout log4j.appender.myMail.layout.ConversionPattern=%r %-5p %d{ISO8601} [% t] %n%n (%C, %M, %F:%L) - %n%n%m%n # This is needed to see all startup logs log4j.logger.NSLog=DEBUG #log4j.logger.some.package.someclassToDebug=DEBUG # etc with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException in ERXLogger.getERXLogger
2008/2/27 Yung-Luen Lan <[EMAIL PROTECTED]>: > 2008/2/27 Daniele Corti <[EMAIL PROTECTED]>: > > > 2008/2/27, Yung-Luen Lan <[EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > > > An extra question: when you add some features to your wo project, how > > > do you stop the current running wo server and start the new one? I don't > > > know how to do this so I run my server inside eclipse. I know it's stupid, > > > but I couldn't find the answer. Maybe it's too basic to document? > > > > > > Not a stupid question: look at the bottom panels, and select the Console > > one (if you are running WO app in development, WOLips changes it to show > > logs) at the top of the panel, you can see a little red square. You can stop > > the current app by clicking on it. It's not very visible, I've passed months > > before notice it, when I've started working on Eclipse. > > > > Thanks for your reply. My question actually is, how do you do that for > normal deployed WO server. That is, the WO server is not running inside > Eclipse --- sorry that I didn't make it clear. > > Regards, > yllan > Are you using JavaMonitor? if not what do you do? call the build file from Terminal? -- Daniele Corti AIM: S0CR4TE5 Messenger: [EMAIL PROTECTED] -- Computers are like air conditioners -- they stop working properly if you open WINDOWS -- What about the four lusers of the apocalypse? I nominate: "advertising", "can't log in", "power switch" and "what backup?" --Alistair Young ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException in ERXLogger.getERXLogger
2008/2/27 Daniele Corti <[EMAIL PROTECTED]>: > 2008/2/27, Yung-Luen Lan <[EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > An extra question: when you add some features to your wo project, how do > > you stop the current running wo server and start the new one? I don't know > > how to do this so I run my server inside eclipse. I know it's stupid, but I > > couldn't find the answer. Maybe it's too basic to document? > > > Not a stupid question: look at the bottom panels, and select the Console > one (if you are running WO app in development, WOLips changes it to show > logs) at the top of the panel, you can see a little red square. You can stop > the current app by clicking on it. It's not very visible, I've passed months > before notice it, when I've started working on Eclipse. > Thanks for your reply. My question actually is, how do you do that for normal deployed WO server. That is, the WO server is not running inside Eclipse --- sorry that I didn't make it clear. Regards, yllan ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException in ERXLogger.getERXLogger
ERXLogger has long since been gone. The frameworks are by no means a drag and drop replace and I can't figure why you would even want to do it? You need to actually build and deploy a new version of your apps. Cheers, Anjo Am 27.02.2008 um 13:11 schrieb Yung-Luen Lan: Hi all, I'm a newbie of both WebObjects and server programming who is responsible to maintain a WO project left by other guy several years ago. I've added some features and tested in Eclipse. However, during these year, I always encountered a problem when I want to update the ERExtensions.framework in /Library/Frameworks. When I replace the original ERExtensions.framework (whose version is believed ≤ Project WONDER 3) with new one, I got the exception: Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:271) at org.apache.log4j.LogManager.getLogger(LogManager.java:220) at org.apache.log4j.Logger.getLogger(Logger.java:156) at er.extensions.ERXLogger.getLogger(ERXLogger.java:111) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:91) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:121) at woserver.Application.(Application.java:25) And that's the very first line of my project. public class Application extends ERXApplication { public static final ERXLogger log = ERXLogger.getERXLogger(Application.class); I've my Properties file configured like this: BEGIN OF PART OF MY PROPERTIES FILE er.extensions.ERXLocalizer.frameworkSearchPath = (app,ERExtensions) er.extensions.ERXLocalizer.defaultLanguage = English er.extensions.ERXLocalizer.availableLanguages = (English, Chinese) ### Enterprise Objects ### er.extensions.ERXRaiseOnMissingEditingContextDelegate = false ### Application Name ### er.extensions.ERXApplicationHostURL = localhost # # Log4j Configuration # log4j.rootLogger = INFO, A1, A2 log4j.loggerFactory=er.extensions.ERXLogger$Factory # Appenders log4j.appender.A1 = org.apache.log4j.ConsoleAppender log4j.appender.A2 = org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.datePattern='.'-MM-dd log4j.appender.A2.append = true log4j.appender.A2.File = /var/log/woproject/woproject.log # A1, A2 uses PatternLayout. log4j.appender.A1.layout = er.extensions.ERXPatternLayout log4j.appender.A2.layout = er.extensions.ERXPatternLayout # This pattern will produce logs that look like: # 2002-06-18 17:46:18,292 MyAppName[4002:9133 0] MyCategory (MyClass.java:40) - Some log log4j.appender.A1.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} %c{1} (%F:%L) %x - %m%n log4j.appender.A2.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} %c{1} (%F:%L) %x - %m%n # Note that %F and %L is fairly slow and shouldn't be used in performance intensive logging # Custom Categories - These are the main categories and sub categories #that are used in frameworks. # Base Category log4j.logger.er = INFO log4j.logger.er.extensions.ERXNSLogLog4jBridge = INFO log4j.additivity.er.extensions.ERXNSLogLog4jBridge = false log4j.logger.er.changenotification = INFO END OF PART OF MY PROPERTIES FILE Hence, I must copy the old ERExtensions to a new environment every time. Did I miss something? An extra question: when you add some features to your wo project, how do you stop the current running wo server and start the new one? I don't know how to do this so I run my server inside eclipse. I know it's stupid, but I couldn't find the answer. Maybe it's too basic to document? Regards, yllan ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/krank%40logicunited.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NullPointerException in ERXLogger.getERXLogger
2008/2/27, Yung-Luen Lan <[EMAIL PROTECTED]>: > > Hi all, > > I'm a newbie of both WebObjects and server programming who is responsible > to maintain a WO project left by other guy several years ago. I've added > some features and tested in Eclipse. However, during these year, I always > encountered a problem when I want to update the ERExtensions.framework in > /Library/Frameworks. > > When I replace the original ERExtensions.framework (whose version is > believed ≤ Project WONDER 3) with new one, I got the exception: Do you also replace ERJar.framework? Exception in thread "main" java.lang.ExceptionInInitializerError > Caused by: java.lang.NullPointerException > at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:271) > at org.apache.log4j.LogManager.getLogger(LogManager.java:220) > at org.apache.log4j.Logger.getLogger(Logger.java:156) > at er.extensions.ERXLogger.getLogger(ERXLogger.java:111) > at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:91) > at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:121) > at woserver.Application.(Application.java:25) > > And that's the very first line of my project. > > public class Application extends ERXApplication { > public static final ERXLogger log = ERXLogger.getERXLogger( > Application.class); > > I've my Properties file configured like this: > > BEGIN OF PART OF MY PROPERTIES FILE > er.extensions.ERXLocalizer.frameworkSearchPath = (app,ERExtensions) > er.extensions.ERXLocalizer.defaultLanguage = English > er.extensions.ERXLocalizer.availableLanguages = (English, Chinese) > > ### Enterprise Objects ### > er.extensions.ERXRaiseOnMissingEditingContextDelegate = false > > ### Application Name ### > er.extensions.ERXApplicationHostURL = localhost > > # > # Log4j Configuration > # > log4j.rootLogger = INFO, A1, A2 > log4j.loggerFactory=er.extensions.ERXLogger$Factory > > # Appenders > log4j.appender.A1 = org.apache.log4j.ConsoleAppender > > log4j.appender.A2 = org.apache.log4j.DailyRollingFileAppender > log4j.appender.A2.datePattern='.'-MM-dd > log4j.appender.A2.append = true > log4j.appender.A2.File = /var/log/woproject/woproject.log > > # A1, A2 uses PatternLayout. > log4j.appender.A1.layout = er.extensions.ERXPatternLayout > log4j.appender.A2.layout = er.extensions.ERXPatternLayout > > # This pattern will produce logs that look like: > # 2002-06-18 17:46:18,292 MyAppName[4002:9133 0] MyCategory (MyClass.java:40) > - Some log > log4j.appender.A1.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} > %c{1} (%F:%L) %x - %m%n > log4j.appender.A2.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} > %c{1} (%F:%L) %x - %m%n > > # Note that %F and %L is fairly slow and shouldn't be used in performance > intensive logging > > > # Custom Categories - These are the main categories and sub categories > #that are used in frameworks. > > > # Base Category > log4j.logger.er = INFO > log4j.logger.er.extensions.ERXNSLogLog4jBridge = INFO > log4j.additivity.er.extensions.ERXNSLogLog4jBridge = false > > log4j.logger.er.changenotification = INFO > END OF PART OF MY PROPERTIES FILE > > Hence, I must copy the old ERExtensions to a new environment every time. > Did I miss something? > > An extra question: when you add some features to your wo project, how do > you stop the current running wo server and start the new one? I don't know > how to do this so I run my server inside eclipse. I know it's stupid, but I > couldn't find the answer. Maybe it's too basic to document? Not a stupid question: look at the bottom panels, and select the Console one (if you are running WO app in development, WOLips changes it to show logs) at the top of the panel, you can see a little red square. You can stop the current app by clicking on it. It's not very visible, I've passed months before notice it, when I've started working on Eclipse. Regards, > yllan > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/ildenae%40gmail.com > > This email sent to [EMAIL PROTECTED] > -- Daniele Corti AIM: S0CR4TE5 Messenger: [EMAIL PROTECTED] -- Computers are like air conditioners -- they stop working properly if you open WINDOWS -- What about the four lusers of the apocalypse? I nominate: "advertising", "can't log in", "power switch" and "what backup?" --Alistair Young ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (We
NullPointerException in ERXLogger.getERXLogger
Hi all, I'm a newbie of both WebObjects and server programming who is responsible to maintain a WO project left by other guy several years ago. I've added some features and tested in Eclipse. However, during these year, I always encountered a problem when I want to update the ERExtensions.framework in /Library/Frameworks. When I replace the original ERExtensions.framework (whose version is believed ≤ Project WONDER 3) with new one, I got the exception: Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:271) at org.apache.log4j.LogManager.getLogger(LogManager.java:220) at org.apache.log4j.Logger.getLogger(Logger.java:156) at er.extensions.ERXLogger.getLogger(ERXLogger.java:111) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:91) at er.extensions.ERXLogger.getERXLogger(ERXLogger.java:121) at woserver.Application.(Application.java:25) And that's the very first line of my project. public class Application extends ERXApplication { public static final ERXLogger log = ERXLogger.getERXLogger( Application.class); I've my Properties file configured like this: BEGIN OF PART OF MY PROPERTIES FILE er.extensions.ERXLocalizer.frameworkSearchPath = (app,ERExtensions) er.extensions.ERXLocalizer.defaultLanguage = English er.extensions.ERXLocalizer.availableLanguages = (English, Chinese) ### Enterprise Objects ### er.extensions.ERXRaiseOnMissingEditingContextDelegate = false ### Application Name ### er.extensions.ERXApplicationHostURL = localhost # # Log4j Configuration # log4j.rootLogger = INFO, A1, A2 log4j.loggerFactory=er.extensions.ERXLogger$Factory # Appenders log4j.appender.A1 = org.apache.log4j.ConsoleAppender log4j.appender.A2 = org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.datePattern='.'-MM-dd log4j.appender.A2.append = true log4j.appender.A2.File = /var/log/woproject/woproject.log # A1, A2 uses PatternLayout. log4j.appender.A1.layout = er.extensions.ERXPatternLayout log4j.appender.A2.layout = er.extensions.ERXPatternLayout # This pattern will produce logs that look like: # 2002-06-18 17:46:18,292 MyAppName[4002:9133 0] MyCategory (MyClass.java:40) - Some log log4j.appender.A1.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} %c{1} (%F:%L) %x - %m%n log4j.appender.A2.layout.ConversionPattern = %d{ISO8601} %-5p %W{n[i:p s]} %c{1} (%F:%L) %x - %m%n # Note that %F and %L is fairly slow and shouldn't be used in performance intensive logging # Custom Categories - These are the main categories and sub categories #that are used in frameworks. # Base Category log4j.logger.er = INFO log4j.logger.er.extensions.ERXNSLogLog4jBridge = INFO log4j.additivity.er.extensions.ERXNSLogLog4jBridge = false log4j.logger.er.changenotification = INFO END OF PART OF MY PROPERTIES FILE Hence, I must copy the old ERExtensions to a new environment every time. Did I miss something? An extra question: when you add some features to your wo project, how do you stop the current running wo server and start the new one? I don't know how to do this so I run my server inside eclipse. I know it's stupid, but I couldn't find the answer. Maybe it's too basic to document? Regards, yllan ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]