I have a swing app with hibernate (EntityManager). There is posibility to add some extra functionality by plugins. But here is a problem. Plugins are added dynamicaly and there arent in classpath or manifest.
This is the way i start plugin:
(...)
URL[] urls = new URL[] { new URL("file:".concat(jarFile.getAbsolutePath())) };
URLClassLoader classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
InputStream is = new BufferedInputStream(new FileInputStream(jarFile));
JarInputStream jis = new JarInputStream(is);
JarEntry entry;
(...)
Class<Object> pc = (Class<Object>) classLoader.loadClass(nazwa klasy);
IMainController i = (IMainController)pc.newInstance();
(...)
Hibernate can see them when he is checking mapping, but cant when tries to load object. I got classNotFoundException on factory = Ejb3Configuration.buildEntityManagerFactory();
So how I use clases from plugins in hibernate ?
Thx.
(sry for poor english)
|