Re: "Cannot use rapid turnaround." when projectbuilder is not running

From: Harald Niesche (haral..heco.de)
Date: Mon Jul 28 2003 - 18:08:14 EDT

  • Next message: Kaj Hejer: "Re: "Cannot use rapid turnaround." when projectbuilder is not running"

    [I have appended a short list of instructions at the end, that is what I
    do to run WO applications in Eclipse. Other answers are inline.
    -- Harald]

    Kaj Hejer wrote:
    >>> [2003-07-25 13:33:03 CEST] <main> NSProjectSearchPath=("..")
    >> Is this the correct value for NSProjectSearchPath when staring an
    >> application for eclipse?
    >>
    >> Is it correct that in earlier versions of WOLips the .woa directory
    >> was directly under the projectdirectory while it now (1.0.4) is under
    >> a "build"? Can it be that NSProjectSearchPath should be "../.."?

    Yes, if you are using the incremental builder (which always creates the
    *.woa / *.framework in a folder called build), you should set the
    NSProjectSearchPath to "../..".

    >> In the WO tab in the run-window I have
    >>
    >> -NSProjectSearchPath "(GeneratedByWOLips)"

    I am unsure, I don't use rapid turnaround mode, since I am using
    Windows, where the braindamaged Apple tools can't deal with folders (I
    hear one of my colleagues has a fix for that, which unfortunately
    involves "reengineering for compatibility", which used to be legal under
    european law, but I am unsure whether it still is...).

    Anyways, I found it to be unnecessary with the incremental builder,
    since resources are copied to the "build" folder directly after you
    saved them. There seems to be a problem with certain WebServer Resources
    (*.js, *.css etc.) which seem to be held open by WebObjects. I am
    working on a fix for that (can't reproduce reliably, yet).

    > Now I tried to change workingdirectory in the run-settings, under the
    > argument tab from
    > /Users/kajh/src/webobjects/nettskjema/build/nettskjema.woa to
    > /Users/kajh/src/webobjects/nettskjema.
    >
    > NOW rapid turnaround started to work!

    It may look like it does -- what is the Application name reported by the
    standard boilerplate "Welcome to <Bundlename>!" code?

    > But... Now the following statement does not find the wod-file and
    > returns nothing.
    >
    > NSBundle.mainBundle().bytesForResourcePath(
    > "ProfilContainer.wo/ProfilContainer.wod"));
    >
    > When I change the workingdirectory back to
    > /Users/kajh/src/webobjects/nettskjema/build/nettskjema.woa
    > bytesForResourcePath work again but then I have no rapid turnaround.

    The documentation for the incremental builder explicitly mentions
    setting the current directory to the *.woa folder, because the
    WebObjects Bundle recognition magic will not find the bundle unless you
    have the current directory set to that folder (okay, there is another
    way, it's documented and I have forgotten what it is, some WOSomething
    option, or was it -Duser.dir=? -- it used to be in the WOLips help).

    > I got a tip from Chuck (ref. the email I incluce bellow) that I might
    > have to add the jar for the project to the classpath. Since I use
    > incremental builder I added the following as a folder in the
    > run->classpath tab:
    >
    > /Users/kajh/src/webobjects/nettskjema/build/nettlogg.woa/Contents/Resources/Java

    That's also important, if you leave out this or the current directory
    stuff above, the MainBundle will simply be called "MainBundle" and
    resources (as well as WebServer Resources) will not be found.

    > Any ideas on how to get BOTH rapid turnaround and
    > NSBundle.mainBundle().bytesForResourcePath to work at the same time? :)

    I suggest using either the -NSProjectSearchPath "../.." as mentioned
    above or the -WOSomething switch mentioned in the documentation.

    I just checked the docs and couldn't find the correct options, I guess
    my rather lengthy list of things to do in order to launch an
    incrementally built application has been moved somewhere, I'll append an
    older version of it to this mail.

    ----------------------------------------------------------------------
    10 Steps to successful launching of incrementally built WebObjects
    applications in Eclipse:

    0. import your application into Eclipse and set it use the incremental
    builder (under <Project>|Properties|WOLips)

    1. create a launch configuration using the Run ... menu, use Java
    Application, if in doubt

    2. change the runtime classpath and the source path to not be the
    default paths (uncheck both checkboxes)

    3. *do this only after unchecking both checkboxes in step 2.*

    change the Runtime Classpath by adding the
    build/<projectname>.woa/Contents/Resources/Java Folder to the classpath
    before or instead of the Project itself

    4.(do the same for all not-yet-installed WO-Frameworks in your
    Workspace, using the appropriate Resources/Java folders, this enables
    you to use JDK1.4 hot code replacements for frameworks, I think).

    5. add the parameters
    -Duser.dir=<path_to_the_.woa_directory_under_build> (or better: set this
    folder as the working directory for the application) and
    -DWORootDirectory=>$NEXT_ROOT< (replacing >$NEXT_ROOT< with the
    installation path of your WebObjects installation)

    6. turn on reloading of templates with -WODebuggingEnabled true
    (At least I think this is what the switch does, anyone care to correct me?)

    7. turn on rapid-turnaround mode (not strictly necessary if you use
    WODebuggingEnabled) with -NSProjectSearchPath ("../..")

    8. optional: set the port the application listens on with (e.g.)
    -WOPort 6666

    9. run the application

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



    This archive was generated by hypermail 2.0.0 : Mon Jul 28 2003 - 18:04:49 EDT