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 12:30 Go to next message
No real name is currently offline No real name
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 12:53 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 268
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 16:15 Go to previous messageGo to next message
No real name is currently offline No real name
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 04:32 Go to previous message
Glyn Normington is currently offline Glyn Normington
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:Problems deploying war file
Next Topic:ClassNotFoundException inside PAR
Goto Forum:
  


Current Time: Thu Apr 17 21:04:57 EDT 2014

Powered by FUDForum. Page generated in 0.03716 seconds