Re: Build problems for Windows [Solved]

From: timc..pg.com.au
Date: Fri Nov 02 2007 - 04:01:22 EDT

  • Next message: Ulrich Köster: "Looking for a volunteer to finish the api editor"

    No _sessionClass() was a red herring. It had nothing to do with the
    problem, which appears to be a bit intermittent. I have moved Main.java
    back into the same package as Application.java and all is good.

    Tim

    Quoting timc..pg.com.au:

    > Hi Chuck,
    >
    > I found a log4j in /Library/WebObjects/Extensions but I had the same
    > problem after removing it. My /Library/Java/Extensions only had my
    > jdbc
    > drivers in it.
    >
    > I removed the _sessionClass() method from Application.java, which I
    > didn't really need, and the problem went away. I was able to have
    > Main.java in a different package to Application.java again.
    >
    > Thanks
    >
    > Tim
    >
    > Quoting Chuck Hill <chil..lobal-village.net>:
    >
    > > That is all very odd. Adding that method should not have affected
    >
    > > finding the correct class. Changes to WOLips might be resulting in
    > a
    > >
    > > different load order for the jars causing this. Do you have
    > anything
    > >
    > > in /Library/Java/Extensions related to log4j?
    > >
    > > Chuck
    > >
    > >
    > > On Nov 1, 2007, at 6:28 PM, timc..pg.com.au wrote:
    > >
    > > > 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
    > > >>
    > > >>
    > > >
    > >
    > > --
    > >
    > > Practical WebObjects - for developers who want to increase their
    > > overall knowledge of WebObjects or who are trying to solve specific
    >
    > >
    > > problems.
    > > http://www.global-village.net/products/practical_webobjects
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Nov 02 2007 - 04:02:27 EDT