Moving pages/components out of default packages for WebObjects 5.2.4

From: Mike Kienenberger (mkienen..mail.com)
Date: Wed Mar 07 2007 - 12:03:47 EST

  • Next message: Pierre Frisch: "Re: Newsworthy Changes"

    I hope this is an appropriate question for this list.

    I'm using WebObjects 5.2.4. I'm working with a project originally
    developed in 5.0. I've successfully built and deployed the project
    as a j2ee application. Now, I'm trying clean up the code.
    Originally everything was in the default package. I've used Eclipse
    to repackage everything.

    For the most part, I've been successful at this task. I updated the
    class entries in the entity plist files, so EOF is working fine with
    the new packages.

    However, the page and component classes have me stumped. I've
    updated the Resources/*.api files with the fully-qualified class
    names, but the application still tries reading the Main.class out of
    the default package. I verified this by copying the class back to the
    default package, and it was found.

    If I update Application.pageWithName() to fully-qualify the name, then
    my pages can be found, but the components aren't.

                return
    super.pageWithName(fullyQualifiedPageName(pageName), context);

        private String fullyQualifiedPageName(String pageName)
        {
            if (null == pageName)
            {
                pageName = "Main";
            }
            pageName = "<mypackage>." + pageName;
            return pageName;
        }

    By using FileMon, I can tell that the file attributes for
    Resources\Main.api are queried, but the file is never opened or read.
     Resources\Main.wo\Main.html, wod, and woo are all opened and read. I
    can also see that the Main.class is read before any of the Main.wo
    files are opened.

    If I switch back to the non-fully-qualified name, FileMon shows that
    the Main.class is scanned for in a great number of places in
    WEB-INF\classes, but not in my own packages:

    WEB-INF\classes\Main.class
    WEB-INF\classes\java\lang\Main.class
    WEB-INF\classes\com\webobjects\*
    WEB-INF\classes\java\math\Main.class
    WEB-INF\classes\org\apache\*
    and so on.

    This makes me think that I need to configure something to tell WO what
    my packages are.

    I've searched through the old archives, but I haven't found anything
    that seems relevent:

    http://objectstyle.org/woproject-old/lists/woproject-dev/2004/10/0084.html
    http://lists.apple.com/archives/webobjects-dev/2006/Sep/msg00196.html
    http://lists.apple.com/archives/webobjects-dev/2006/Sep/msg00197.html
    http://lists.apple.com/archives/webobjects-dev/2006/Sep/msg00193.html

    I did find useful information reminding me that instance variable need
    to be changed from protected to public.

    It also seems like this issue may have been solved for WO 5.3, but
    that's not currently an option.



    This archive was generated by hypermail 2.0.0 : Wed Mar 07 2007 - 12:10:26 EST