Re: Solved: cayenne.jar as Eclipse plug-in - problems with cayenne.xml

From: noban (noba..andex.ru)
Date: Mon Oct 31 2005 - 02:44:56 EST

  • Next message: Korbinian Bachl: "AW: How exact do we want it ? / Best Practice Design ?"

    Hi!

      Sorry about delay with answer. But everithing is working fine with Cayenne nighty build from 27th oct. Thank you Andrus!

    > 1. Put "bootstrap..." line BEFORE "initialize.."
    seems do nothing.

       Actually a`ve had similar problems with classloader in JasperReports (which was used as jar).
    At that point, to solve problem, I`ve made some changes in the eclipse core, but that chanege isn`t working with Cayenne (which now I`m using as plugin-from-jar). Anyway I don`t like this solution.
       So, seems that`s really a problem. But at eclipse newsgroups they sad that in latest Eclipse releases (can`t say now which release, maybe 3.1.1) is introduced
    "buddy classloading mechanism". Can`t say anymore, as I haven`t looked at this thing yet, but that`s a key for such problems with plugins, as I understand.

    --- Forwarded message --
    From: Mike Kienenberger <mkienen..mail.com>
    To: <cayenne-use..bjectstyle.org>
    Date: 25.10.05 18:08
    Subject: Re: Solved: cayenne.jar as Eclipse plug-in - problems with cayenne.xml

    Hi Noban,

    I hope you'll keep us informed with your progress in combining Cayenne
    and Eclipse RCP. I was working on an RCP project in my spare time to
    which I will probably try to add Cayenne at some point. Not sure
    when I'll get back to that project, but any insights you come up with
    will be helpful.

    Thanks!

    On 10/25/05, noban <noba..andex.ru> wrote:
    > Thank you Andrus.
    >
    > BootstrapConfiguration before initalization didn`t worked. But nighty build from 23rd, with "..setContextClassLoader.." did well.
    > Looks like its working now, but I had to test it deeper (I don't have DB right now), but configuration is loading now.
    >
    >
    >
    >
    > >I am not sure how Eclipse ClassLoaders are structured, so I can't
    > >pinpoint the exact problem, but here is a few ideas:
    > >
    > >1. Put "bootstrap..." line BEFORE "initialize.."
    > >
    > >or..
    > >
    > >2. Coincidentally I did some refactoring of ClassLoader stuff in CVS
    > >recently to use thread context ClassLoader as default. You can try
    > >the newest stuff from the latest nightly build:
    > >
    > >http://objectstyle.org/downloads/cayenne/nightly/?M=D
    > >
    > >It no longer uses "bootstrapSharedConfiguration". Instead (if it
    > >doesn't work) you may do something like this BEFORE loading
    > >Configuration:
    > >
    > >Thread.currentThread().setContextClassLoader(this.getClass
    > >().getClassLoader());
    > >
    > >Andrus
    > >
    > >
    > >On Oct 24, 2005, at 5:18 AM, noban wrote:
    > >
    > >> Hi!
    > >>
    > >> I`m writing Eclispe RCP, so now I`ve moving all third-party jars
    > >> within my RCP to plugins. I`ve successfully created plugin from
    > >> cayenne.jar, but once I did that I've recieving msg in console :
    > >>
    > >> Unhandled event loop exception
    > >> Reason:
    > >> [v.1.2M5 July 22 2005] Error during Configuration initialization.
    > >> [v.1.2M5 July 22 2005]
    > >> [org.objectstyle.cayenne.conf.DefaultConfiguration] : Domain
    > >> configuration file "cayenne.xml" is not found.
    > >>
    > >> my configuration file isn`t located at the root directory, I'm
    > >> loading it with this code:
    > >>
    > >> DefaultConfiguration conf = new DefaultConfiguration();
    > >> conf.addClassPath(ResourceLogin.CAYENNE_XML_CONFIGURATIUON_PATH);
    > >> Configuration.initializeSharedConfiguration(conf);
    > >> Configuration.bootstrapSharedConfiguration(this.getClass());
    > >>
    > >> actually I have an idea, that cayenne isn`t loading because new
    > >> cayenne plugin is separate project and can`t look into my main RCP
    > >> plugin - project for specified dir/cayenne.xml.
    > >> As well putting cayenne.xml in my RCP`s root dir seems doing nothing.
    > >>
    > >> I've tried to include my project in dependancy list of cayenne
    > >> plugin, but as my own plugin also require cayenne plugin I`ve got
    > >> dependancy cycle.
    > >>
    > >> Does anybody have done something similar? Any hints?
    > >>
    > >>
    > >
    >
    >
    > --
    > Сегодня удачный день, чтобы завести почту на Яндексе http://mail.yandex.ru
    >

    --- End of forwarded message --

    -- 
    Яндекс.Почта: объем почтового ящика не ограничен! http://mail.yandex.ru/monitoring/
    



    This archive was generated by hypermail 2.0.0 : Mon Oct 31 2005 - 02:45:06 EST