Re: Problems with woapplication archetype, WO 5.3 and 5.4:

From: Lachlan Deck (lachlan.dec..mail.com)
Date: Sun Nov 23 2008 - 14:04:51 EST

  • Next message: Mike Schrag: "Re: Maclipse 3.4.1 [Solved]"

    On 22/11/2008, at 12:38 AM, Juergen Lorenz Simon wrote:

    > Next I re-imported the WebObjects installations. I removed the old
    > versions from the repository completely:
    >
    > rm -rf ~/.m2/repository/com/webobjects

    So all versions of WO are gone from your repository.

    > mvn wobootstrap:install
    > mvn wobootstrap:install -DwebObjectsLibFolder=/Developer/
    > WebObjects53/lib -DwebObjectsVersion=5.3.3

    Here you've re-imported 5.3.3, and 5.4.3 (I assume as you didn't
    provide the output of that).

    > Then I created a fresh project on command line, using the
    > woapplication archetype:
    >
    > mvn archetype:generate -
    > DarchetypeGroupId=org.objectstyle.woproject.maven2 -
    > DarchetypeArtifactId=woapplication-archetype -
    > DgroupId=com.webtecc.maven.test -DartifactId=BumClouds -Dversion=1.0
    > <...>
    > I have no idea what the warnings above are about.

    Nothing to worry about. It's just maven saying (I think) it couldn't
    replace those tokens -- which is good as you don't want them replaced.

    > The project however is created. Next
    > building the resulting project after changing woversion from 5.4.2
    > (as it is generated by the
    > archetype) to 5.4.3 in the pom.xml :
    >
    > asimov:BumClouds simon$ mvn install

    There's no need to install to test if it compiles or to run it. This
    will do just fine:
    $ mvn clean package

    > [INFO]
    > ------------------------------------------------------------------------
    > [INFO] BUILD SUCCESSFUL
    > [INFO]
    > ------------------------------------------------------------------------

    > asimov:BumClouds simon$ ./target/BumClouds.woa/BumClouds

    <...>

    > Welcome to BumClouds !
    > [2008-11-21 14:15:33 CET] <main> Opening application's URL in browser:
    > http://asimov.local:54966/cgi-bin/WebObjects/BumClouds.woa
    > [2008-11-21 14:15:33 CET] <main> null
    > [2008-11-21 14:15:33 CET] <main> Waiting for requests...
    > [2008-11-21 14:15:37 CET] <WorkerThread0>
    > <com.webobjects.appserver._private.WOComponentRequestHandler>:
    > Exception occurred while handling request:
    > java.lang.IllegalArgumentException:
    > <com.webobjects.appserver._private.WOComponentDefinition> Class
    > 'Main' exists but is not a subclass of WOComponent.
    > [2008-11-21 14:15:37 CET] <WorkerThread0>
    > java.lang.IllegalArgumentException:
    > <com.webobjects.appserver._private.WOComponentDefinition> Class
    > 'Main' exists but is not a subclass of WOComponent.
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentDefinition._componentClass(WOComponentDefinition.java:496)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentDefinition.componentClass(WOComponentDefinition.java:504)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentDefinition
    > ._componentInstanceInContext(WOComponentDefinition.java:510)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentDefinition
    > .componentInstanceInContext(WOComponentDefinition.java:642)
    > at
    > com
    > .webobjects.appserver.WOApplication.pageWithName(WOApplication.java:
    > 2332)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentRequestHandler
    > ._dispatchWithPreparedSession(WOComponentRequestHandler.java:284)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentRequestHandler
    > ._dispatchWithPreparedApplication(WOComponentRequestHandler.java:332)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentRequestHandler
    > ._handleRequest(WOComponentRequestHandler.java:369)
    > at
    > com
    > .webobjects
    > .appserver
    > ._private
    > .WOComponentRequestHandler
    > .handleRequest(WOComponentRequestHandler.java:442)
    > at
    > com
    > .webobjects
    > .appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
    > 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:637)
    >
    > As you can see, there is already a problem with locating the class
    > for the Main component or something.

    This is a normal WO problem now that people are putting classes into
    packages, NSBundle fails to look things up (at times) properly.
    Henrique's already mentioned how to fix this. There's numerous threads
    in the mailing list archive regarding this.

    So guess what..... you've successfully run the app.

    > Now going to WO5.3 by changing woversion from 5.4.3 to 5.3.3 in the
    > pom.xml and building again:
    >
    > asimov:BumClouds simon$ mvn install

    I'd be doing mvn clean install

    > [INFO] Scanning for projects...
    > [INFO]
    > ------------------------------------------------------------------------
    > [INFO] Building BumClouds WebObjects App
    > [INFO] task-segment: [install]
    > [INFO]
    > ------------------------------------------------------------------------
    > [WARNING] Attempting to build MavenProject instance for Artifact
    > (org.objectstyle.woproject.maven2:maven-wolifecycle-plugin:
    > 2.0.16-20080929.005203-4) of type: maven-plugin; constructing POM
    > artifact instead.

    It appears that your pom is referencing 2.0.16-SNAPSHOT. If that's
    right, please fix that. There were bug fixes.
    Or use 2.0.17-SNAPSHOT

    > [INFO]
    > ------------------------------------------------------------------------
    > [INFO] BUILD SUCCESSFUL
    > [INFO]
    > ------------------------------------------------------------------------

    with regards,

    --
    

    Lachlan Deck



    This archive was generated by hypermail 2.0.0 : Sun Nov 23 2008 - 14:05:47 EST