Re: runtime error - can't find generated class

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Oct 23 2003 - 12:01:00 EDT

  • Next message: Andrus Adamchik: "Aggregate Functions Demo [Was: Re: Help with ExpressionFactory needed]"

    ... Moving this to cayenne-user ....

    Hi Steve,

    This is indeed strange... If both cayenne.jar and your custom Java code
    are *not* under /Library/Java/Home/lib/ext and you are setting
    CLASSPATH for both instead, there shouldn't be a problem... A few
    random questions:

    1. Is this application command line? I know you've mentioned you can
    run command line tutorial, but you haven't said anything about the
    nature of the new app that causes the problems.
    2. If it command line, are you running the code from the Terminal using
    CLASSPATH, or using apps produced by JarBundler? Just checking, since
    both ways should work ok....
    3. Is SampleEvent located in a package?

    The suggestion below is also rather random, since I don't have enough
    info... In any event it won't hurt.... Try explicitly bootstrapping the
    ClassLoader in your code (before anything "cayenne" is loaded, e.g. in
    the "main" method:

         
    org.objectstyle.cayenne.conf.Configuration.bootstrapSharedConfiguration(
    SampleEvent.class);

    Regards
    Andrus

    On Wednesday, October 22, 2003, at 11:30 PM, Steve Steinitz wrote:
    > Hello,
    >
    > We are excited about the possibility of using Cayenne in our
    > project. We have successfully built and run the command line
    > tutorial on Mac OS X. However, when we execute
    >
    > SelectQuery query = new SelectQuery(SampleEvent.class, qual);
    >
    > We get: CayenneRuntimeException - cannot find class SampleEvent.
    >
    > If, on the other hand, we do a simple
    >
    > SampleEvent testSampleEvent = new SampleEvent();
    >
    > The object is successfully instantiated.
    >
    > We have followed your suggestion to not mix up the java extension
    > and application classpath -- the SampleEvent class is in our
    > application classpath.
    >
    > Best regards
    >
    > Steve Steinitz



    This archive was generated by hypermail 2.0.0 : Thu Oct 23 2003 - 12:00:59 EDT