Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » DiscoverSourceModelFromJavaProject
DiscoverSourceModelFromJavaProject [message #576143] Tue, 14 September 2010 09:36 Go to next message
Björn is currently offline Björn
Messages: 29
Registered: August 2010
Junior Member
hi,

currently I am working with the KDMSourceDiscoverer.

this is what I do with it:


Resource sourceModel = new XMIResourceImpl();
Map<DiscoveryParameter, Object> parameters = null;

DiscoverSourceModelFromJavaProject discoverer = new DiscoverSourceModelFromJavaProject()

parameters = new HashMap<DiscoveryParameter, Object>();
parameters.put(PARAMETER_SILENT_MODE, true);
parameters.put(PARAMETER_BROWSE_RESULT, false);
parameters.put(PARAMETER_TARGET_RESOURCE, sourceModel);

discoverer.discoverElement(project, parameters);


but then I get this strange exception:


!MESSAGE org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmFactoryImpl cannot be cast to org.eclipse.gmt.modisco.omg.kdm.kdm.KdmFactory
!STACK 0
java.lang.ClassCastException: org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmFactoryImpl cannot be cast to org.eclipse.gmt.modisco.omg.kdm.kdm.KdmFactory
at org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmFactoryImpl.init (KdmFactoryImpl.java:49)
at org.eclipse.gmt.modisco.omg.kdm.kdm.KdmFactory.<clinit>(KdmFactory.java:34)
at org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmPackageImpl.<init >(KdmPackageImpl.java:166)
at org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmPackageImpl.init (KdmPackageImpl.java:192)
at org.eclipse.gmt.modisco.omg.kdm.kdm.KdmPackage.<clinit>(KdmPackage.java:69)
at org.eclipse.gmt.modisco.omg.kdm.core.impl.CorePackageImpl.in it(CorePackageImpl.java:164)
at org.eclipse.gmt.modisco.omg.kdm.core.CorePackage.<clinit>(CorePackage.java:74)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unsa feFieldAccessorFactory.java:25)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFac tory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.get(Field.java:358)
at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:274)
at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
at org.eclipse.gmt.modisco.omg.kdm.kdm.impl.KdmPackageImpl.init (KdmPackageImpl.java:197)
at org.eclipse.gmt.modisco.omg.kdm.kdm.KdmPackage.<clinit>(KdmPackage.java:69)
at org.eclipse.gmt.modisco.omg.kdm.kdm.KdmPackage$Literals.<clinit >(KdmPackage.java:1232)
at org.eclipse.gmt.modisco.omg.kdm.kdm.impl.SegmentImpl.eStatic Class(SegmentImpl.java:80)
at org.eclipse.emf.ecore.impl.EObjectImpl.eClass(EObjectImpl.ja va:269)
at org.eclipse.emf.ecore.util.EContentsEList.createEContentsELi st(EContentsEList.java:55)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContents(BasicE ObjectImpl.java:821)
at org.eclipse.emf.ecore.util.EcoreUtil$ProperContentIterator.<init >(EcoreUtil.java:1246)
at org.eclipse.emf.ecore.util.EcoreUtil$4.getChildren(EcoreUtil .java:1157)
at org.eclipse.emf.ecore.util.EcoreUtil$ContentTreeIterator.has Next(EcoreUtil.java:1408)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.attached(Re sourceImpl.java:860)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl$ContentsELi st.inverseAdd(ResourceImpl.java:416)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:318)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList. java:307)
at org.eclipse.gmt.modisco.kdm.source.discoverer.KDMSourceDisco verer.createKDMModelFromFile(KDMSourceDiscoverer.java:158)
at org.eclipse.gmt.modisco.kdm.source.discoverer.KDMSourceDisco verer.getKDMModelFromJavaProject(KDMSourceDiscoverer.java:12 0)
at org.eclipse.gmt.modisco.kdm.source.discoverer.actions.Discov erSourceModelFromJavaProject.discoverElement(DiscoverSourceM odelFromJavaProject.java:126)
at org.eclipse.gmt.modisco.kdm.source.discoverer.actions.Discov erSourceModelFromJavaProject.discoverElement(DiscoverSourceM odelFromJavaProject.java:192)
at kdmextractor.KDMExtractor.extractKDMSourceModel(KDMExtractor .java:427)
at kdmextractor.KDMExtractor.extractKDMModel(KDMExtractor.java: 316)
at kdmextractor.KDMExtractor.convertKDMModel(KDMExtractor.java: 281)
at kdmextractor.KDMExtractor.getKdmModel(KDMExtractor.java:256)
at kdmextractor.views.KDMExtractorView$2.run(KDMExtractorView.j ava:172)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


and it seems to be that line 49 in the KdmFactoryImpl class

KdmFactory theKdmFactory = (KdmFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/MoDisco/kdm/kdm");

seems to be causing the problem.

Does anyone have an idea why this could be?
Thanx in advance.

Cheers Björn
Re: DiscoverSourceModelFromJavaProject [message #576173 is a reply to message #576143] Tue, 14 September 2010 10:11 Go to previous message
Nicolas Bros is currently offline Nicolas Bros
Messages: 49
Registered: July 2009
Member
Hi,

Which version of Eclipse and MoDisco are you using?
Have you installed a new version of MoDisco over a previous one?
Previous Topic:Clean of SVN repository
Next Topic:DiscoverSourceModelFromJavaProject
Goto Forum:
  


Current Time: Fri Jul 25 07:20:32 EDT 2014

Powered by FUDForum. Page generated in 0.11584 seconds