Eclipse 3.3.2 WOLips 3.3.5281 Mac OS X 10.5.4 WO 5.3.3 frameworks and /Library/WebObjects/Extensions
OK, I'm at wit's end (or maybe half-wit's or dimwit's end :-)
A non-WOnder app, Waldo, depends on a non-WOnder framework, WOCommon. The WOCommon framework defines a class wocommon.Session that derives from WOSession. Waldo defines a class waldo.Session that derives from wocommon.Session.
Waldo runs without error from within Eclipse running in Web server connect mode.
Ant-built Waldo runs without error from outside Eclipse when the ant-built WOCommon framework is not embedded in Waldo. /Library/Frameworks/WOCommon.framework is a symbolic link to <my_Eclipse_workspace_path>/WOCommon/dist/WOCommon.framework so that /Library/Frameworks/WOCommon.framework is always up-to-date with the ant-built WOCommon framework in the dist directory of my WOCommon framework project.
Ant-built Waldo throws a class cast exception when run from outside Eclipse with identical launch arguments (those configured in JavaMonitor and used when wotaskd launches the app) when the ant-built WOCommon framework is embedded in Waldo by setting the wo.wolocalroot framework "embed" property to "true". The class cast exception is thrown at this statement in Waldo's Main.java:
final Session sessionL = (Session)session();
because session() returns a wocommon.Session but is being cast to a waldo.Session.
When the WOCommon framework isn't embedded but is otherwise identical as best I can tell, session() returns a waldo.Session. For some reason, a wocommon.Session is being created rather than a waldo.Session when the WOCommon framework is embedded. WTF?!
I have compared the class paths in MacOSClassPath.txt and in the launch output for Waldo with and without the WOCommon framework embedded. The class paths are identical with the exception of the paths to wocommon.jar. The checksums of waldo.jar and wocommon.jar are identical in the embedded and non-embedded cases. I've run out of ideas.
I need to deploy Waldo with the WOCommon framework embedded because a different WOCommon framework version is in /Library/Frameworks on the deployment server. But I am unable to do so because of this class cast exception that has defied my ability to debug the problem for a couple of very frustrating days. Can someone please point out the error in my ways?
|