[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: Equinox weaving configuration - Clasloading issue

Thomas Haskes wrote:
...
Now when I start my application, I get a ClassNotFoundException on my
entity classes, but only when I start the fragments
org.eclipse.persistence.equinox and org.eclipse.equinox.weaving (which
are required to start to get lazy loading working as mentioned in [1]).

You don't have to start those fragments; I don't think you can really. In the example you deploy those fragments and start the javax.persistence bundle and then the org.eclipse.persistence.jpa bundle. Finally you start your client bundle.


If I dont start those fragments, everything works, but then theres no
weaving at all(which is clear as the fragment are not started). It seems
that I have to configure some more Bundle-Requirements or
Buddy-Classloading directives, but I don't know where and what.

You don't have to use an Equinox specific buddy loading with EclipseLink. If it works without weaving then your config is probably ok.


One of the key issues for weaving is the requirement that framework fragments be co-located with the org.eclipse.osgi bundle. In the example [1], all the bundles are in the same folder so the fragment loads properly. The way Equinox is launched is key to this working and the config I describe is critical to success. If you're running inside PDE then you need to checkout the source for Equinox (org.eclipse.osgi) from CVS. See the comments on the Adaptor Hook [2] page for details. By having the Equinox source in your dev environment when you deploy org.eclipse.osgi and the framework extension fragment org.eclipse.persistence.equinox.weaving are in the same folder. Luckily, PDE launches Equinox in such a way that the fragments are loaded correctly--when I went outside PDE I soon discovered that launching Equinox with "java -jar org.eclipse.osgi_<version>" did not work, the framework extensions are loaded after the Adapter Hook framework has looked for extensions! So, as I said, *luckily* PDE launches Equinox in a way that works.

Any Ideas?

I've thrown out a bunch of background and hopefully this helps. In my experience, the most common problem is the weaving extension either not being attached to org.eclipse.osgi or being attached after the Adaptor Hook framework has looked for extensions. Making sure you launch Equinox as described should solve these issues. If this doesn't help can you post your short status (ss) which will show if the fragments are properly attached?


--Shaun

Tom

[1]
http://wiki.eclipse.org/EclipseLink/Examples/OSGi/Equinox_Byte_Code_Weaving
[2] http://wiki.eclipse.org/Adaptor_Hooks