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:
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:
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.