Re: packages and wocomponents problem

From: Jason Dwyer (Jason.Dwye..edata.com.au)
Date: Thu Oct 21 2004 - 03:48:26 EDT

  • Next message: James Cicenia: "Re: Waiting for virtual machine to exit..."

    hi thomas,

    this will drive you crazy in the end.

    once you start packaging the java classes correctly ( in
    de.huebnerInformatik.wocomponents... etc) you will need to start
    manually writing your .api, .woo and .wod files to utilise your
    components, as the WOBuilder doesnt seem to want to know about packaged
    components. at least, thats my experience with WO5.2 on windows, perhaps
    its sorted out in the new Mac versions.

    i always found the convention in WO for no-packages by default to be a
    pain, particularly once your projects get big.

    anyway, back on topic, i was able to get my components java classes
    packaged as i liked, but had to do some kind of voodoo to get the
    runtime to pick up the component, the .api and marry them up to the
    correct class.

    i think i ended up putting the .wo's in a directory (Components), along
    with the .api, and then altering the resources.include.patternset to
    pick them up. clean and rebuild.

    make sure you also set up the working directory for when you run the app
    to be the ${workspace_loc:$PROJECT/build/$PROJECT.woa} directory, and
    after the build, take a look inside that to make sure all the resources
    ( including the java package hierarchy) are there.

    mind you , i was prodding and poking around at this on linux, and using
    cvs to go back to a windows env. to use the WOBuilder & EOModeler, but
    there shouldnt be too much different underneath for win/mac.

    sounds like you're on the right track with what you were trying ...

    regards,

    j.dwyer
    redata software systems

    On Mon, 2004-10-11 at 08:43, Thomas Engeroff wrote:
    > Dear List,
    >
    > I really need help!
    > I was trying to clean up and reorganize one of my WO projects and have some
    > really strange problems. I try to use packages for my WO-Components Java
    > sources. My reorganized project structure looks like the following:
    >
    > <Project root>
    > <src>
    > Application.java
    > Session.java
    > ...
    > <de>
    > <huebnerInformatik>
    > <wocomponents>
    > MyComponentPage.java
    > ...
    > <components>
    > <pages>
    > <MyComponentPage.wo>
    > MyComponentPage.html
    > MyComponentPage.wod
    > MyComponentPage.woo
    > MyComponentPage.api
    > ...
    >
    > When I compile, build (without any errors) and run my wo-app I get the error
    > message below. It says, that the component class can not be found, therefore
    > I tried to find out how WO determines where to search for the class. I found
    > out, that the classname is defined in the *.api files.
    > I changed my *.api files to the following:
    >
    > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    > <wodefinitions>
    > <wo wocomponentcontent="false"
    > class="de.huebnerInformatik.wocomponents.MyComponentPage">
    >
    > </wo>
    > </wodefinitions>
    >
    > I changed " class="MyComponentPage" " to " class="de.huebnerInformatik... "
    > as you see above.
    >
    > Well, this did not help at all. I still get the same error message. I also
    > searched the archives and could not find a solution which works for me.
    >
    > I'm using:
    > Eclipse 3.0.1
    > WOLips 1.0.7.50
    > WO 5.2
    > on Windows XP Pro
    >
    > The same WO Application works great on this machine as long as I don't move
    > the components class files into packages!
    >
    > I just moved my WOComponents back to the root dir (class files still in the
    > packages), rebuild and get the same error message!
    >
    > Any help is greatly appreciated!
    >
    > Regards,
    > Thomas
    >
    >
    > 2004-10-10 22:58:46,643 DEBUG ImmoShop_v3[-:2050 1] NSLog
    > (ERXNSLogLog4jBridge.java:44) -
    > <com.webobjects.appserver._private.WOComponentDefinition> WARNING: Unable to
    > find component class named "WelcomePage". If this is not intended to be a
    > classless component, check your framework settings and the contents of your
    > classpath file (in the .woa's Contents/<PLATFORM_NAME> subdirectory).
    > 2004-10-10 22:58:46,733 WARN ImmoShop_v3[-:2050 1] NSLog
    > (ERXNSLogLog4jBridge.java:41) -
    > WOBundle.lookForClassInAllBundles(MenuTopRight_comp) failed!
    > 2004-10-10 22:58:46,793 WARN ImmoShop_v3[-:2050 1] NSLog
    > (ERXNSLogLog4jBridge.java:41) -
    > WOBundle.lookForClassInAllBundles(MenuBottomLeft_comp) failed!
    > 2004-10-10 22:58:46,813 WARN ImmoShop_v3[-:2050 1] NSLog
    > (ERXNSLogLog4jBridge.java:41) -
    > <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception
    > occurred while handling request:
    > com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException:
    > [<com.webobjects.appserver.WOComponent name: WelcomePage subcomponents: null
    > > valueForKey()]: lookup of unknown key: 'showMenuTopRight'.
    > This WOComponent does not have an instance variable of the name
    > showMenuTopRight or _showMenuTopRight, nor a method of the name
    > showMenuTopRight, _showMenuTopRight, getShowMenuTopRight, or
    > _getShowMenuTopRight
    > [2004-10-10 22:58:46 GMT+1] <WorkerThread0>
    > com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException:
    > [<com.webobjects.appserver.WOComponent name: WelcomePage subcomponents: null
    > > valueForKey()]: lookup of unknown key: 'showMenuTopRight'.
    > This WOComponent does not have an instance variable of the name
    > showMenuTopRight or _showMenuTopRight, nor a method of the name
    > showMenuTopRight, _showMenuTopRight, getShowMenuTopRight, or
    > _getShowMenuTopRight
    > at
    > com.webobjects.appserver.WOComponent.handleQueryWithUnboundKey(WOComponent.j
    > ava:1566)
    > at
    > com.webobjects.foundation.NSKeyValueCoding$Utility.handleQueryWithUnboundKey
    > (NSKeyValueCoding.java:544)
    > at
    > com.webobjects.foundation.NSKeyValueCoding$_KeyBinding.valueInObject(NSKeyVa
    > lueCoding.java:920)
    > at
    > com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey
    > (NSKeyValueCoding.java:1268)
    > at
    > com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java:1539)
    > at
    > com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCod
    > ing.java:498)
    > at
    > com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.va
    > lueForKeyPath(NSKeyValueCodingAdditions.java:212)
    > at
    > com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1600)
    > at
    > com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOK
    > eyValueAssociation.java:46)
    > at
    > com.webobjects.appserver.WOAssociation.booleanValueInComponent(WOAssociation
    > ..java:278)
    > at
    > com.webobjects.appserver._private.WOConditional.appendToResponse(WOCondition
    > al.java:62)
    > at
    > com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WO
    > DynamicGroup.java:121)
    > at
    > com.webobjects.appserver._private.WODynamicGroup.appendToResponse(WODynamicG
    > roup.java:130)
    > at
    > com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:992)
    > at
    > com.webobjects.appserver.WOSession.appendToResponse(WOSession.java:1198)
    > at er.extensions.ERXSession.appendToResponse(ERXSession.java:510)
    > at
    > com.webobjects.appserver.WOApplication.appendToResponse(WOApplication.java:1
    > 418)
    > at
    > er.extensions.ERXApplication.appendToResponse(ERXApplication.java:606)
    > at
    > com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPre
    > paredPage(WOComponentRequestHandler.java:230)
    > at
    > com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPre
    > paredSession(WOComponentRequestHandler.java:287)
    > at
    > com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPre
    > paredApplication(WOComponentRequestHandler.java:322)
    > at
    > com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(W
    > OComponentRequestHandler.java:358)
    > at
    > com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WO
    > ComponentRequestHandler.java:432)
    > at
    > com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:13
    > 06)
    > at
    > er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:638)
    > at
    > com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java
    > :173)
    > at
    > com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254
    > )
    > at java.lang.Thread.run(Unknown Source)
    >



    This archive was generated by hypermail 2.0.0 : Thu Oct 21 2004 - 03:49:14 EDT