We recently discussed this on the woproject-dev mail list.

I found by ensuring Main.java was in the same package as
Application.java, My Main was used and not another one.

-------------------------
Chuck Hill said:

Add the following code to Application.java constructor

Class mainClass = _NSUtilities.classWithName("Main");
NSLog.out.appendln("Main class is " + mainClass.getName());

To find out which Main class it is actually using.

-------------------------
Andrew Lindesay said:

I just renamed my Main to be "XYZMain" where "XYZ" was the prefix used
over the whole project.  I now use "XYZMain" as the default page.  This
seemed to "get around" the problem.

-------------------------
Lachlan Deck said:

Another option (if the above doesn't always succeed)...

public Application()
{
        <....>

        findMeFirstClasses = ERXProperties.dictionaryForKey( <..> );
        for ( Enumeration en = findMeFirstClasses.allKeys().objectEnumerator();
en.hasMoreElements(); )
        {
                String key = ( String )en.nextElement();
                String className = ( String )findMeFirstClasses.valueForKey( 
key );
                _NSUtilities.setClassForName( Class.forName( className ), key );
        }
}

And in your Properties file:
NSUtilities.shortNames={\
        Main = "my.proj.package.Main";\
        <...>
}

-------------------------

Regards

D Tim Cummings


Quoting Chris Meyer <[EMAIL PROTECTED]>:

> I've recently upgraded to Eclipse 3.3.1.1 and the nightly WOLips and
> nightly
> Wonder.
> 
> If I run my application using WOApplication, it runs OK and opens in
> Safari.
> 
> 
> 
> If I do the Ant build and run it from the command line, the
> application
> launches but I get the error below (in Terminal and a similar error
> in
> Safari).
> 
> My frameworks are all set to embed="true" in the Ant build... but
> I've tried
> it with and without embedding without any success.
> 
> 
> Any idea why this is occurring? What other information can I provide
> or
> examine to help debug this problem?
> 
> 
> 
> 
> 
> 
> 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:414)
>         at
> com.webobjects.appserver._private.WOComponentDefinition.componentClass
> (
> WOComponentDefinition.java:422)
>         at
>
com.webobjects.appserver._private.WOComponentDefinition._componentInstanceInContext
> (WOComponentDefinition.java:428)
>         at
>
com.webobjects.appserver._private.WOComponentDefinition.componentInstanceInContext(
> WOComponentDefinition.java:573)
>         at com.webobjects.appserver.WOApplication.pageWithName(
> WOApplication.java:1954)
>         at
>
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(
> WOComponentRequestHandler.java:273)
>         at
>
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication
> (WOComponentRequestHandler.java:322)
>         at
> com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest
> (
> WOComponentRequestHandler.java:358)
>         at
> com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(
> WOComponentRequestHandler.java:432)
>         at com.webobjects.appserver.WOApplication.dispatchRequest (
> WOApplication.java:1306)
>         at
> er.extensions.ERXApplication.dispatchRequest(ERXApplication.java
> :1160)
>         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(Thread.java:613)
> 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to