Re: Converting woa to eclipse, have the strangest of errors...

From: Chuck Hill (chil..lobal-village.net)
Date: Tue Jul 17 2007 - 18:40:58 EDT

  • Next message: Chuck Hill: "Re: Eclipse 3.2.2, WOLips 2.0.0.4118 and SybasePlugin not generating primary key"

    On Jul 17, 2007, at 3:36 PM, Joshua Archer wrote:

    >
    > On Jul 17, 2007, at 3:04 PM, Chuck Hill wrote:
    >
    >>> REALLY STUPID QUESTION: Where is the launcher?
    >>
    >> Choose Run... under the Run menu. That will probably be an eye
    >> opener. :-) Check the classpath tab.
    >
    > OH HEY! LOOK AT THAT! :)
    >
    >>> I'm just using the Package explorer to run the app. What file
    >>> should I delete?
    >>
    >> You should only need to do that once per project. Use the run
    >> icon (green arrow) or debug icon (green bug) after that. Or the
    >> Run menu.
    >
    > That's what I get for not RTFM and just clicking at buttons, eh?

    Grin. Lots to look at in Eclipse. Years from now you will think you
    know it all, turn a corner, and be in strange territory.

    >>>>> which it never used to do (and which is set in the project
    >>>>> settings).
    >>>>
    >>>> Which "project settings"?
    >>>
    >>> Sorry, not being precise in my language. I meant the Properties
    >>> settings for 'WOLips Build'
    >>>
    >>> <Picture 1.png>
    >>
    >> That looks OK, assuming your Application.java is not in a package.
    >
    > Looks like the Application.java *is* in a package:
    >
    > package org.nmc.pachyderm.authoring;
    >
    > Guess I should pull that, and move Application.java to the default
    > package?

    Having classes in the default package is just a Bad Idea. I don't
    know how that setting got out of synch with reality, but that is at
    least part of your problem. Add the package in there.

    >>>>> I select the main class, 'Application', and hit okay. It churns
    >>>>> for a few seconds, and then gives me this error:
    >>>>>
    >>>>> [2007-07-17 12:49:01 PDT] <main> A fatal exception occurred: null
    >>>>> [2007-07-17 12:49:01 PDT] <main>
    >>>>> java.lang.ExceptionInInitializerError
    >>>>> at
    >>>>> com.webobjects.appserver._private.WOProperties.initUserDefaultsKey
    >>>>> s(WOProperties.java:187)
    >>>>> at com.webobjects.appserver.WOApplication._initWOApp
    >>>>> (WOApplication.java:5081)
    >>>>> at com.webobjects.appserver.WOApplication.<init>
    >>>>> (WOApplication.java:551)
    >>>>> at org.nmc.pachyderm.authoring.Application.<init>
    >>>>> (Application.java:76)
    >>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0
    >>>>> (Native Method)
    >>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance
    >>>>> (NativeConstructorAccessorImpl.java:39)
    >>>>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
    >>>>> (DelegatingConstructorAccessorImpl.java:27)
    >>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:
    >>>>> 494)
    >>>>> at java.lang.Class.newInstance0(Class.java:350)
    >>>>> at java.lang.Class.newInstance(Class.java:303)
    >>>>> at com.webobjects.appserver.WOApplication.main
    >>>>> (WOApplication.java:323)
    >>>>> at org.nmc.pachyderm.authoring.Application.main
    >>>>> (Application.java:62)
    >>>>> Caused by: java.lang.IllegalStateException:
    >>>>> <com.webobjects.foundation.NSBundle> warning: There is already
    >>>>> a unique instance for Bundle named 'PXFoundation'.
    >>>>
    >>>> Your classpath is messed up. pxfoundation.jar is on it twice.
    >>>> Once installed and once in a local project?
    >>>
    >>> I'll take a look as to what's going on. PXFoundation is a local
    >>> project I use, and I've also added the project to the classpath,
    >>> and there's a link to the jar in /Library/Frameworks.
    >>
    >> The jar or the .framework?
    >
    > I had added the jar to the build path in the 'Libraries' tab, and
    > the framework to the "required projects on the build path" under
    > Projects. I've removed them from the latter, and things are moving
    > along differently now...

    Um, no. You should check / select the framework in the WebObjects
    Frameworks library and add the project in Eclipse to Required Projects.

    >
    >>> Which is the preferred location? I thought this worked before,
    >>> but maybe I 'fixed' something and broke it in the process :).
    >>
    >> Both together, when things are working right. But I think we can
    >> discount that for now. :-)
    >
    > We'll get there :).
    >
    >>>>> [snip]
    >>>>
    >>>> You have installed or moved something. Again, check Java
    >>>> Extensions. Is the Application in a package? Is that
    >>>> information getting built into the .woa?
    >>>
    >>> No doubt that's what I've done. The application is set up as a
    >>> WonderApplication, imported from an old XCode project from
    >>> subversion. Application.java is a class in the application,
    >>> subclassing WOApplication.java
    >>>
    >>> I'll look around and see if I'm duplicating my listings of jars/
    >>> frameworks, and report.
    >>
    >> Yeah, I am not too sure what is going on. I am guess some
    >> classpath badness somewhere.
    >>
    >> Chuck
    >
    > I've gone through my tree, and cleaned up the paths a bit. My
    > errors have now shifted to a new place in the code, so that's
    > success. Now to debug farther down the chain :).
    >
    > Thanks for the help,

    You are welcome, we are probably getting close.

    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 : Tue Jul 17 2007 - 18:42:12 EDT