Problems packaging Seaside XD image as NT service

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Problems packaging Seaside XD image as NT service

Postby PhotonDemon » Thu Apr 07, 2011 2:01 pm

Hi,

I'm having problems packaging a very simple Seaside demo XD image as an NT service. I don't think the NT service part is the problem. I think the trouble stems from the XD image side. After tweaking things I can get a packaged image without errors. But when I run the image it dies before it gets to the code that registers the Seaside app.

It dies in EmSystemConfiguration>>#xdImageStartup when it calls #loaded of #GreaseCore (and others):

Code: Select all
loaded
   "Send #initialize to every class defined in this subapplication that implements it."

   defined do: [ :aClass |
      (aClass class includesSelector: #initialize) ifTrue: [ aClass initialize ] ]


#defined is a class instance variable defined in #SubApplication. It should be a list of the classes defined in GreaseCore but it is nil. So, #xdImageStartup traps "MessageNotUnderstood: UndefinedObject>>do:" many times and then gives up and stops running.

Is there something I should be doing to insure this class instance variable is not nil and contains the classes it should? Should I include more classes? Should I include fewer classes? Should this initialize code be called? Any help is greatly appreciated. Thanks.

Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Problems packaging Seaside XD image as NT service

Postby koschate » Thu Apr 07, 2011 6:01 pm

The #loaded method is called every time an XD image is started. Because XD images are built passively, no code is executed, meaning that there's no way of setting state prior to saving the packaged image. You need to make sure that #defined is properly populated as part of the image startup.

Your particular code fragment is also an excellent example of why I always insist on using accessor methods to get at variables. How much easier would it have been to set up a lazy initializer for #defined if an accessor had been used instead of direct variable access? Note that I'm not saying it's the right answer in this case, but it might be, and it could have been implemented with a lot less code changing.

There actually is an accessor for #defined, but it doesn't do any initialization currently. I'd be tempted play with the packager's method replacement tools to replace the offending #loaded methods with ones that refer to an explicitly populated list of classes rather than enumerating them dynamically. This list of classes could be generated programmatically prior to packaging and saved into a method.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: Problems packaging Seaside XD image as NT service

Postby marten » Thu Apr 07, 2011 9:14 pm

koschate wrote:Your particular code fragment is also an excellent example of why I always insist on using accessor methods to get at variables. How much easier would it have been to set up a lazy initializer for #defined if an accessor had been used instead of direct variable access?


This "defined" has been changed by Instantiations in VA 8.03 (and they did it right) to get rid of packaging problems of Seaside with VA 8.02, where instead of "defined" a "self defined" was used. The problem is, that the accessor "defined" is defined in an application, which is contraproductive in packaging.

To the original problem - I did packaging of Seaside in Windows and Linux and had no problems at all with it ...
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest

cron