Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » ClassNotFoundException inside PAR
ClassNotFoundException inside PAR [message #588074] Tue, 13 July 2010 16:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 15
Registered: June 2010
Junior Member
We are trying to use Dozer in an OSGi application and are experiencing class path visibility issues. The objects are exported in one of our manifests; however, Dozer bundle does not import the object types being mapped (via it's manifest). According to some other threads on the Spring dm Server forum this should be addressed by using a PAR. We checked and the types are imported through the PAR's synthetic context; however, we still get a runtime exception:

org.dozer.MappingException: java.lang.ClassNotFoundException: ca.company.object.

What is the suggested way to address this?

Thanks in advance.

- Paul
Re: ClassNotFoundException inside PAR [message #588088 is a reply to message #588074] Tue, 13 July 2010 16:53 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
You might need to import dozer classes in your bundle similar to hibernate set-up

http://www.eclipse.org/virgo/documentation/virgo-documentati on-2.1.0.M02-incubation/docs/virgo-programmer-guide/html/ch0 8.html#common-libraries-hibernate

i.e. import-scope:=application should do the trick for you.
FIXED - Re: ClassNotFoundException inside PAR [message #590414 is a reply to message #588074] Tue, 13 July 2010 20:15 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 15
Registered: June 2010
Junior Member
K, I resolved my issue.

While debugging the issue I noticed that the BundleClassLoader that was being used to instantiate the object type inside the dozer bundle had visibility of only the webapp imported components even though it was located inside a PAR where the synthetic context should have caused all included bundle's exports to be imported. Further, the webapp was calling a service (inside a service bundle) that was using dozer and hence this should have been abstracted from the webapp. I'm not sure why this is the case, but adding the dozer (application scope) imports explicitly to the webapp manifest satisfied the classloader.

For reference, this is what I added to both the service and webapp bundle to resolve my issue:
org.dozer;import-scope:=application,
org.dozer.util;import-scope:=application,
ca.company.types;import-scope:=application

Thanks,
- Paul
Re: FIXED - Re: ClassNotFoundException inside PAR [message #590434 is a reply to message #590414] Wed, 14 July 2010 08:32 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I would be surprised if there was a bug in the synthetic context bundle. If you are interested, please examine the wiring in the failing case and see if the synthetic context bundle really is in error and raise a bug with details if so.

However glad to see you are in business now!
Previous Topic:ClassNotFoundException inside PAR
Next Topic:Virgo tooling for Eclipse
Goto Forum:
  


Current Time: Thu Apr 25 10:44:53 GMT 2024

Powered by FUDForum. Page generated in 0.06444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top