Hi,
The situation :
I've 2 eclipse plug-in
org.xxx.core (the plug-in contain all the stuff related to hibernate, SessionFactory, Library, etc...)
In this plug-in I've defined an extension-point, call "command".
In this plug-in you can find a RpsObjCommand.class and it RpsObjCommand.hbm.xml
org.xxx.core.command
In this plug-in I've created an extention base on the extention-point "command"
This extension define a sub-class of a basic class.
eg.: RpsObjCommandOs.class and if RpsObjCommand.hbm.xml
This method is in the org.xxx.core
public void buildSessionFactory(RpsDbms connectTo) throws Exception{
Configuration configuration = new Configuration();
configuration.setProperties(setConnectionProperties(connectTo));
configuration.addClass(RpsObjCommand.class);
IExtensionPoint[] extensionPoints = Platform.getExtensionRegistry().getExtensionPoints(CorePlugin.getDefault().getBundle().getSymbolicName());
for (int i = 0; i < extensionPoints.length; i++){
IExtension[] extensions = extensionPoints[i].getExtensions();
for (int j =0; j < extensions.length; j++){
IConfigurationElement[] configElement = extensions[j].getConfigurationElements();
String pluginLocation = Platform.getBundle(extensions[j].getNamespace()).getLocation().substring(8);
configuration.addFile(pluginLocation+ getAtributeValue(configElement));
}
}
}
Because this method is in the org.xxx.core when I want to add file dynamically I received this :
15:16:21,937 ERROR Configuration:252 - Could not compile the mapping document
net.sf.hibernate.MappingException: persistent class [com.agiledss.core.command.model.RpsObjCommandOs] not found
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
at net.sf.hibernate.cfg.Binder.bindJoinedSubclass(Binder.java:187)
at net.sf.hibernate.cfg.Binder.handleJoinedSubclass(Binder.java:1076)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1258)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
at com.agiledss.core.factory.HibernateConnectionFactory.buildSessionFactory(HibernateConnectionFactory.java:65)
at com.agiledss.core.dbms.RpsDbms.connect(RpsDbms.java:70)
at com.agiledss.core.command.test.CommandTest.testCommand(CommandTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:30)
at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:26)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
I don't want my org.xxx.core to know the org.xxx.core.command.
I need idea !!!!!!!!!!!!!!!!
Please help.
|