Re: error while connecting to EOModel from Eclipse

From: Chuck Hill (chil..lobal-village.net)
Date: Sat Apr 08 2006 - 22:07:54 EDT

  • Next message: Miguel Arroz: "Re: Unit testing"

    On Apr 8, 2006, at 8:10 AM, Alexander Trofimchouk wrote:

    > Hi!
    > I use eclipse 3.2 on Windows XP. I decided to run an example from
    > WebApplications.pdf from WebObjects, it's rather simple but: when
    > I'm trying to execute the following code I get an error
    > private EOEditingContext editingContext;
    > private EOFetchSpecification fetchSpec;
    > public NSMutableArray authorList;
    > public Main(WOContext context) {
    > super(context);
    > fetchSpec = new EOFetchSpecification("Author",null,null);
    > editingContext = session().defaultEditingContext();
    > authorList = new NSMutableArray
    > (editingContext.objectsWithFetchSpecification(fetchSpec));}
    > Application: authors
    > Error: java.lang.NullPointerException
    > Reason:
    > Stack trace: File Line# Method Package
    > ----------------------------------------------------------------------
    > ----------
    > EOModel.java 725 <init> com.webobjects.eoaccess
    >
    That usually means the model is corrupted. The index.eomodeld or one
    of the .plists has something wrong with it

    > error occurs while executing the last string : authorList = new
    > NSMutableArray(editingContext.objectsWithFetchSpecification
    > (fetchSpec));
    > Then, I've decided to create a new model from eomodeld file instead:
    > EOModel m = new EOModel("file://C:/prjs/authors/Authors.eomodeld");
    > and that's what I've got:
    > Application: authors
    > Error: java.lang.IllegalArgumentException: File not found file://C:/
    > prjs/authors/Authors.eomodeld/index.eomodeld
    >
    Is that file in fact not found? Is there anything at C:/prjs/authors/
    Authors.eomodeld/index.eomodeld

    Loading models manually is not something that is usually done.

    > Reason: File not found file://C:/prjs/authors/Authors.eomodeld
    > Stack trace: File Line# Method Package
    > ----------------------------------------------------------------------
    > ----------
    > EOModel.java 690 <init> com.webobjects.eoaccess
    > Main.java 49 <init> Main
    > and so on...
    > adding /index.eomodeld to eomodel url changes nothing.
    >
    Again, either the model is missing or damaged.

    > Actually, I don't know what to do. For more than a week I try my
    > best to run even simple WO-EO-Application on my WinXP and the only
    > thing that I'm sure is that list of WO exceptions bugs and
    > "features" is very very long..

    You might have a bad install, but the error above look more like bad
    data errors.

    Chuck

    -- 
    Coming in 2006 - an introduction to web applications using WebObjects  
    and Xcode     http://www.global-village.net/wointro
    

    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 : Sat Apr 08 2006 - 22:08:29 EDT