If you try to load the Map z.ST:Server Smalltalk (SST) - Seaside twice, you'll get a WAAttributeNotFound exception.
This is what happens:
in SeasideDevelopmentCore class>>#loaded all classes in the application that implement the class method #initialize are sent #initialize. Then WAWalkbackErrorHandler class>>#initialize tries to register itself as the default Seaside ExceptionHandler class:
- Code: Select all
initialize
WAAdmin applicationExceptionHandlingDefaults at: #exceptionHandler put: self
This leads to a problem because of the following (maybe strange) implementation of at:put: (look at the comment!)
- Code: Select all
at: aSymbol put: anObject
"It would be faster to simply add the value to the dictionary and
implement #takeValue:forAttribute: in terms of this method, but
config options are set only rarely and this ensures you are setting
a value for an attribute that actually exists."
^ self takeValue: anObject forAttribute: (self attributeAt: aSymbol)
This leads to the abovementioned exception to be thrown, because the attribute #exceptionHandler has been cleaned earlier:
- Code: Select all
attributeAt: aSymbol
^ self attributeAt: aSymbol ifAbsent: [ WAAttributeNotFound signalWithKey: aSymbol ]
So what could be done to solve this?
a) The attribute needs to be created before WAWalkbackErrorHandler class>>#initialize is called. This could be done in the #loaded method and could therefor be Seaside-independent (since #loaded is VAST specific afaik). But it would be a bit strange to do so
b) at:put: is modified to use #storeExpression:forAttribute: directly instead of #takeValue:forAttribute:. But this would definitely be a change to Seaside code and would (I guess) make porting harder, unless the Seaside team agrees to adapt this
c) The attribute itself is made to lazily initialize itself to WAWalkbackErrorHandler - this again would need a change in Seaside's code base
d) something clever that I cannot think of right now.
Why am I complaining? Because this error makes loading code in a tree of required maps (one-click-loading) harder, since Seaside itself may not be part of the required maps structure, because it cannot be loaded twice. I don't really like that
Regards
Joachim