Re: Wonder EOF extended prototypes - HELP!
Re: Wonder EOF extended prototypes - HELP!
- Subject: Re: Wonder EOF extended prototypes - HELP!
- From: Fabian Peters <email@hidden>
- Date: Fri, 06 Sep 2013 18:54:11 +0200
Hi Ken,
This is indeed confusing, see my post here: <http://lists.apple.com/archives/webobjects-dev/2013/Jul/msg00262.html> For now, I'm just ignoring the warnings that you got as well. All I can say is, it works fine.
Maybe we should remove the warning but then throw, in case a prototype attribute is referenced that does not exist in any model?
Fabian
Am 06.09.2013 um 18:18 schrieb Ken Anderson:
> OK, still pulling out hair…
>
> With this setting:
>
> er.extensions.ERXModel.useExtendedPrototypes = true
>
> Looks like it's picking up my attribute:
>
> Sep 06 12:14:04 FitnotixMaint[57250] INFO com.webobjects.eoaccess.ERXModel - Creating prototypes for model: Fitnotix->{driver = "com.mysql.jdbc.Driver"; password = "<deleted for log>"; username = "root"; URL = "jdbc:mysql://127.0.0.1:3306/FitnotixLocal?capitalizeTypenames=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8"; }
> Sep 06 12:14:04 FitnotixMaint[57250] DEBUG com.webobjects.eoaccess.ERXModel - Attributes from EOJDBCMySQLFitnotixPrototypes: (<EOAttribute amount
> <EOAttribute normalDecimal
> name : 'normalDecimal'
> columnName : ''
> className : 'java.math.BigDecimal'
> externalType : 'DECIMAL'
> scale : '8'
> valueType : 'B'
> precision : '20'
> …
>
> I was calling it decimal, but thought maybe it was a reserved word somewhere, so changed it to normalDecimal. All good so far.
>
> Then we get here:
>
> Sep 06 12:14:04 FitnotixMaint[57250] DEBUG com.webobjects.eoaccess.ERXModel - Model = Fitnotix; plugin = MySQL; Prototype Entities Searched = EOPrototypes, EOJDBCPrototypes, EOJDBCMySQLPrototypes, EOCustomPrototypes, EOJDBCCustomPrototypes, EOJDBCMySQLCustomPrototypes, EOFitnotixPrototypes, EOJDBCFitnotixPrototypes, EOJDBCMySQLFitnotixPrototypes
> Sep 06 12:14:04 FitnotixMaint[57250] WARN er.extensions.eof.ERXModelGroup - Using er.extensions.ERXModel.useExtendedPrototypes=true may be incompatible with er.extensions.ERXModelGroup.flattenPrototypes=true (its default value).
> Sep 06 12:14:04 FitnotixMaint[57250] WARN er.extensions.eof.ERXModelGroup - Fitnotix/MemberInfo/accruedDaysOff references a prototype attribute named normalDecimal that does not exist in EOJDBCMySQLPrototypes.
>
> OK fine - try this, since it says it MIGHT be incompatible:
>
> #er.extensions.ERXModelGroup.flattenPrototypes = false;
>
> Then THIS happens:
>
> Sep 06 12:17:54 FitnotixMaint[57279] WARN NSLog - <er.extensions.appserver.ERXComponentRequestHandler>: Exception occurred while handling request:
> com.webobjects.foundation.NSForwardException [java.lang.reflect.InvocationTargetException] null:java.lang.reflect.InvocationTargetException
> [2013-9-6 12:17:54 EDT] <WorkerThread12> com.webobjects.foundation.NSForwardException [java.lang.reflect.InvocationTargetException] null:java.lang.reflect.InvocationTargetException
> at com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
> at com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:646)
> at com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext(WOComponentDefinition.java:544)
> at com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(WOComponentDefinition.java:642)
> at com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:2332)
> at com.fitnotix.core.FXApplication.pageWithName(FXApplication.java:90)
> at com.webobjects.appserver._private.WOHyperlink.invokeAction(WOHyperlink.java:102)
> at er.extensions.components._private.ERXHyperlink.invokeAction(ERXHyperlink.java:60)
> 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 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:168)
> 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:119)
> at er.extensions.appserver.ERXApplication.invokeAction(ERXApplication.java:1988)
> at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedPage(ERXComponentRequestHandler.java:157)
> at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedSession(ERXComponentRequestHandler.java:235)
> at er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedApplication(ERXComponentRequestHandler.java:268)
> at er.extensions.appserver.ERXComponentRequestHandler._handleRequest(ERXComponentRequestHandler.java:302)
> at er.extensions.appserver.ERXComponentRequestHandler.handleRequest(ERXComponentRequestHandler.java:378)
> at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
> at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2109)
> at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2074)
> at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
> at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
> at java.lang.Thread.run(Thread.java:680)
> Caused by: java.lang.reflect.InvocationTargetException
> 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 com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:640)
> ... 29 more
> Caused by: com.webobjects.foundation.NSForwardException [java.lang.NoClassDefFoundError] Could not initialize class er.extensions.eof.ERXModelGroup:java.lang.NoClassDefFoundError: Could not initialize class er.extensions.eof.ERXModelGroup
> at com.webobjects.foundation.NSForwardException._runtimeExceptionForThrowable(NSForwardException.java:43)
> at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:124)
> at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223)
> at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155)
> at com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328)
> at com.webobjects.eoaccess.EOModelGroup.modelGroupForObjectStoreCoordinator(EOModelGroup.java:797)
> at com.webobjects.eoaccess.EODatabaseContext._cooperatingObjectStoreNeeded(EODatabaseContext.java:1155)
> 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:562)
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.requestStore(EOObjectStoreCoordinator.java:223)
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectStoreForFetchSpecification(EOObjectStoreCoordinator.java:287)
> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:476)
> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1308)
> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
> at er.extensions.eof.ERXFetchSpecification.fetchObjects(ERXFetchSpecification.java:155)
> at com.fitnotix.model._Stage.fetchStages(_Stage.java:127)
> at com.fitnotix.model._Stage.fetchAllStages(_Stage.java:121)
> at your.app.components.StageEditor.<init>(StageEditor.java:20)
> ... 34 more
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class er.extensions.eof.ERXModelGroup
> at er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:138)
> 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)
> ... 57 more
>
> Sep 06 12:17:54 FitnotixMaint[57279] WARN NSLog - java.lang.Error "java.lang.NoClassDefFoundError" occured.
> Sep 06 12:17:54 FitnotixMaint[57279] ERROR er.extensions.appserver.ERXApplication - java.lang.Error "java.lang.NoClassDefFoundError" occured.
> NoClassDefFoundError: Could not initialize class er.extensions.eof.ERXModelGroup
>
>
>
>
>
>
> On Sep 5, 2013, at 10:54 PM, Kieran Kelleher <email@hidden> wrote:
>
>> Hi Ken,
>>
>> You checked the javadoc in ERXModel class, right?
>>
>> IIRC, EntityModeler may not support extendedPrototypes in the way ERXModel does for runtime .... I may be wrong, but I have a vague recollection of EntityModeler not recognizing protos the way ERXModel javadoc says, but nevertheless all working at runtime.
>>
>> I have a project using extended prototypes and I use EOJDBCMySQLcheetahPrototypes where the model name is 'cheetah' and it works fine. The prototypes entity is in the cheetah model itself too.
>>
>> Turn on DEBUG logging for ERXModel and you should get a lot of console logging telling you which prototype entities are being loaded and in what order.
>>
>> HTH, Kieran
>>
>> On Sep 5, 2013, at 9:25 PM, Ken Anderson <email@hidden> wrote:
>>
>>> OK all - I've been pulling my hair out for a while… hopefully someone WOnderful can help out.
>>>
>>> I would like to add a new attribute to the prototypes called 'decimal'. It's a big decimal (20,8).
>>>
>>> When I load my model in EntityModeler, it has my model, plus the erprototypes model.
>>>
>>> I have tried everything I can think of to add my prototype attribute, but it all fails.
>>>
>>> The doc says that if I do this:
>>>
>>> er.extensions.ERXModel.useExtendedPrototypes = true
>>>
>>> I can just name my prototypes entity in my model something like:
>>>
>>> EOJDBCMySqlCustomPrototypes
>>>
>>> or
>>>
>>> EOJDBCMySql[MODELNAME]Prototypes
>>>
>>> and it will work - but it doesn't. It either tells me there's no prototype definition for 'decimal', or when I mess with other things like:
>>>
>>> er.extensions.ERXModelGroup.patchModelsOnLoad=true
>>> er.extensions.ERXModelGroup.flattenPrototypes = false;
>>>
>>> it just crashes:
>>>
>>> Caused by: com.webobjects.foundation.NSForwardException [java.lang.NoClassDefFoundError] Could not initialize class er.extensions.eof.ERXModelGroup:java.lang.NoClassDefFoundError: Could not initialize class er.extensions.eof.ERXModelGroup
>>>
>>> How do I get this to work?
>>>
>>> Thanks,
>>> Ken
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden