RE: How do you create a custom DB Adapter?

From: Gentry, Michael (michael_gentr..anniemae.com)
Date: Fri Nov 19 2004 - 12:00:41 EST

  • Next message: Andrus Adamchik: "Re: Very strange behavior of my cayenne application"

    Gah!!!! I've been foiled by NeXTstep! (Well, and maybe my cold, too.)

    I had named part of the class "Adaptor" (the NeXT spelling), but was
    typing "Adapter" into the Modeler. I changed the class name. It all
    works now. I still would've been stumped by the types.xml, though.
    Thanks for that tip. Sorry about the other clutter, though.

    On the bright side, I learned how to run the Modeler in the debugger --
    I'll be dangerous, now! :-)

    Thanks!

    /dev/mrg

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Friday, November 19, 2004 11:51 AM
    To: cayenne-use..bjectstyle.org
    Subject: RE: How do you create a custom DB Adapter?

    Yeah, ClassNotFoundException (and your debug trace) indicate that this
    has
    nothing to do with the instance creation, and is still likely a
    classpath
    issue... Another idea - forget the preferences for a while, and set your
    own classpath in modeler.bat. Does it change anything?

    If this doesn't work, I guess you need to debug FileClassLoadingService
    itself (when there is an exception, is there an underlying cause, etc.).

    > Also, on a side note, should (or is?) the CLASSPATH preference
    > be user-specific? Mine is currently pointing down into a project
    under
    > my home directory. In a multi-user development environment, that
    could
    > get pretty awkward if it isn't user-specific.

    Well, class path is just a regular Modeler preference, so it is stored
    in
    HSQL DB per user. BTW, maybe you are running into CAY-220 bug
    (http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-220), that is
    fixed in CVS, but not released yet? Is any of CLASSPATH entries longer
    than 100 chars?

    Andrus

    > Well, I didn't have types.xml there, but after I copied it in, it
    still
    > doesn't work.
    >
    > I ran the modeler in the debugger and in DataNodeEditor.java's
    > setAdapterName(), it is throwing a ClassNotFoundException, which seems
    > to be out of the loadClass(name) call. It doesn't make it to the next
    > line.
    >
    > getApplication() =>
    > an org.objectstyle.cayenne.modeler.Application instance
    > getApplication().getClassLoadingService() =>
    > an org.objectstyle.cayenne.modeler.FileClassLoadingService instance
    > getApplication().getClassLoadingService().loadClass(name) =>
    > ClassNotFoundException
    >
    > I've quadruple+ checked the CLASSPATH in preferences and it seems
    > correct. Also, on a side note, should (or is?) the CLASSPATH
    preference
    > be user-specific? Mine is currently pointing down into a project
    under
    > my home directory. In a multi-user development environment, that
    could
    > get pretty awkward if it isn't user-specific.
    >
    > Thanks,
    >
    > /dev/mrg
    >



    This archive was generated by hypermail 2.0.0 : Fri Nov 19 2004 - 12:00:45 EST