cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mporru <matteo.po...@abodata.com>
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:
https://github.com/andrus/cayenne-osgi-example

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,
vpp-2.2.1.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 =
OsgiModuleBuilder.forProject(Activator.class).withDriver(Driver.class).module();
        myRuntime = ServerRuntime("cayenne-osgi-example.xml", osgiModule);

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

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
follows:
*
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,
Matteo



--
View this message in context: http://cayenne.195.n3.nabble.com/Cayenne-4-0-M2-and-OSGi-classloading-issue-tp4026812.html
Sent from the Cayenne - Dev mailing list archive at Nabble.com.

Mime
View raw message