Re: Build problems for Windows [Solved]

From: timc..pg.com.au
Date: Thu Nov 01 2007 - 21:28:17 EDT

  • Next message: Chuck Hill: "Re: Build problems for Windows [Solved]"

    Thanks Chuck

    I changed this to

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

    and got

    Main class is org.apache.log4j.chainsaw.Main

    The problem is happening when I deploy to Mac as well as Windows, but
    doesn't show itself when I run from within eclipse in deployment mode.

    Main class is au.com.triptera.weblink.form.Main

    So I moved Main into the same package as Application and now it works
    deployed on Mac (probably Windows too)

    Main class is au.com.triptera.weblink.Main

    I had added the following method last week to Application.java so maybe
    this was responsible for not finding Main.java combined with the Wonder
    frameworks change.

            private Class _ourSessionClass;

            /* (non-Javadoc)
             *..ee com.webobjects.appserver.WOApplication#_sessionClass()
             * WebObjects searches the classpath and uses the first class it finds with
             * the name Session ... crazy huh? This ensures that Session from the
    same package as the
             * Application class is used
             */
    ..verride
            protected Class _sessionClass()
            {
                    if (_ourSessionClass == null) {
                            String ourSessionClassName = null;
                            try {
                                    ourSessionClassName = getClass().getPackage().getName() + ".Session";
                                    System.out.println("Using " + ourSessionClassName + " as the
    application's Session class.");
                                    _ourSessionClass = Class.forName( ourSessionClassName );
                            } catch ( Exception e ) {
                                    System.err.println( "What have you done with your " +
    ourSessionClassName + " class?!\n" + e.getStackTrace() );
                            }
                    } //~ if (_ourSessionClass == null)
                    return _ourSessionClass;
            }

    Thanks for your help.

    Regards

    Tim Cummings

    Quoting Chuck Hill <chil..lobal-village.net>:

    > That sounds like a classpath problem, it is picking up some other
    > Main.java. You can try this as a diagnostic:
    >
    > Class mainClass = _NSUtilities.classWithName("Main");
    > NSLog.out.appendln("Main class is " + mainClass.getClass().getName());
    >
    > That may provide a clue.
    >
    > Chuck
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Nov 01 2007 - 21:29:28 EDT