cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mporru <>
Subject Cayenne 4.0 M2 and OSGi classloading issue
Date Tue, 21 Apr 2015 12:50:45 GMT
Hi all,
I'm trying version 4.0.0.M2 under OSGi (Equinox). Following the example I
found here:

I have added to my workspace three bundles:
- org.apache.cayenne.server, 
- org.apache.cayenne.di 
- and finally the third-parties jars included into the package:
commons-collections-3.2.1.jar, commons-logging-1.1.jar, velocity-1.6.3.jar,
These has been added also as dependencies to the previous two bundles.

I'm able to compile and properly start all the bundles above. Initialization
is done as follows:
        Module osgiModule =
        myRuntime = ServerRuntime("cayenne-osgi-example.xml", osgiModule);

When I invoke: *myRuntime.newContext();* the following exception is thrown:
*java.lang.reflect.InvocationTargetException - Error instantiating class

Digging in a little bit with the source code I can see the that the erro is
thrown at org.apache.cayenne.di.spi.ConstructorInjectingProvider<T>.get() as
org.apache.velocity.exception.VelocityException: The specified class for
ResourceManager (org.apache.cayenne.velocity.SQLTemplateResourceManager)
does not exist or is not accessible to the current classloader.*

If I'm reading this correctly the environment is missing
SQLTemplateResourceManager... but double checking it, I see the class is
inside the org.apache.cayenne.server package itself (which apprently is
started correctly).  

Can anyone please give me some hints?
Thanks and BR,

View this message in context:
Sent from the Cayenne - Dev mailing list archive at

View raw message