Re: runtime error - can't find generated class

From: Steve Steinitz (steinit..atatactics.com.au)
Date: Thu Oct 23 2003 - 20:24:52 EDT

  • Next message: Andrus Adamchik: "Re: Error generating PK for entity 'DbEntity:"

    Hi Andrus,

    Please forgive me for using a little bandwidth to compliment and
    thank you for your excellent contribution to the software
    development world with Cayenne. I'm a WebObjects afficianado and
    am relieved to be able to continue along those lines even in an
    open-source-based project. I remember, from the WO lists, when you
    were beginning Cayenne and am pleased to see it has blossomed.

    On Thursday, 23 October 2003 at 12:01pm, Andrus Adamchik wrote:

    >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,

    Neither were in /Library/Java/Home/lib/ext -- they were both in the
    same classpath, one which we set up for our app.

    Since I posted the email my colleague tried the project on his
    machine and it just worked! The only difference of which we are
    aware is that he used to Cayenne Modeler to create the Cayenne
    configuration files and I created them by hand. The two appear
    identical but there might be a gremlin evading our inspection.

    >...you haven't said anything about the nature of the new app
    >that causes the problems.

    Currently junit is running some methods from our class but in the
    long run it will live in an Apache Cocoon environment running as
    the result of a Cocoon 'action'.

    >3. Is SampleEvent located in a package?

    Yes, its in its own package. We tried, among other things, fully
    qualifying its class name, ie.

        query = new SelectQuery(com.acme.model.SampleEvent.class;
        
    but it didn't help.

    >Try explicitly bootstrapping the ClassLoader in your code (before
    >anything "cayenne" is loaded, e.g. in the "main" method:
    >org...Configuration.bootstrapSharedConfiguration(SampleEvent.class);

    Oddly, perhaps, that line worked fine even in my 'broken' environment
    but the new SelectQuery(...) still failed (might it have helped?).

    Anyway, all seems to be well at the moment. Thank you again for
    Cayenne and for your help.

    Best Regards,

    Steve Steinitz

    >On Wednesday, October 22, 2003, at 11:30 PM, Steve Steinitz wrote:

    >> 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.



    This archive was generated by hypermail 2.0.0 : Thu Oct 23 2003 - 20:23:14 EDT