cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rigel <>
Subject Loading cayenne mapped class from URLClassLoader
Date Mon, 24 Nov 2008 02:48:13 GMT


I am trying to load some "jarred" class mappings generated by Cayenne using
the URLClassLoader,
of course if I load all libs into the starting classloader all goes well,
but when I use the URLClassLoader
I receive the following error message suddenly after invoking
"context.performQuery(select1)" :

[v.2.0.4 October 8 2007] No DataMap found, can't route query
org.apache.cayenne.query.SelectQuery@1764be1[root=class ...]

My code:

		DataContext context = DataContext.createDataContext();
		URLClassLoader urlClassLoader = new URLClassLoader(remoteLibs);
		try {
			//Class<?> clzz =
			Class<?> clzz = urlClassLoader.loadClass("org.someproject.SomeClass");
			Method m = clzz.getDeclaredMethod("executeCustom", new
			m.invoke(null, new Object[]{context});
		} catch (Throwable e) {

Just to run it, where can I declare some local filesystem position to search
for XML data mappings?

I noticed FileConfiguration.addResourcePath & co. but it works only if all
libraries are loaded
by the starting classloader

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message