Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EMF-IncQuery » IncQuery for RCP Applications
IncQuery for RCP Applications [message #1686262] Thu, 19 March 2015 05:41 Go to next message
Harkirat Singh Lamba is currently offline Harkirat Singh LambaFriend
Messages: 8
Registered: March 2015
Junior Member
Hello,
I am working on project where I have several ecore model files. The ecore files are used to create model instances called artifacts which make up the core part of an RCP application. My objective is to query the artifacts of a running RCP application using Incquery.
I followed the following URLs on how to use Incquery for RCP applications.
incquery.net/node/110
wiki.eclipse.org/EMFIncQuery/UserDocumentation/API

Following is the code snippet which causes the error

URI fileURI = URI.createFileURI(modelPath);
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(fileURI, true);
IncQueryEngine engine = IncQueryEngine.on(resource);
PicklistObjectMatcher matcher = PicklistObjectMatcher.on(engine);

PicklistObjectMatcher is the auto-generated class.
modelpath variable = Tried by passing the path ecore file and the path of the xml file of the ecore instance.


However, as soon as I run the above code I face the following Exception.
77890 [main] FATAL org.eclipse.incquery.runtime.1079648883  - EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information. 
org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:59)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:1)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.construct(ReteBoundary.java:524)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessProduction(ReteBoundary.java:456)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:177)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:1)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.coalesceTraversals(NavigationHelperImpl.java:938)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.coalesceTraversals(EMFPatternMatcherRuntimeContext.java:194)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.constructionWrapper(ReteEngine.java:225)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.accessMatcher(ReteEngine.java:173)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.accessMatcher(BaseMatcher.java:76)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.<init>(BaseMatcher.java:65)
	at uitemplate.PicklistObjectMatcher.<init>(PicklistObjectMatcher.java:91)
	at uitemplate.PicklistObjectMatcher.on(PicklistObjectMatcher.java:55)
	at com.emc.xcp.query.engine.plugin.IncQueryHeadless.executeDemo(IncQueryHeadless.java:70)
	at com.emc.xcp.query.engine.plugin.RunnerHandler.execute(RunnerHandler.java:58)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at internal.com.emc.xcp.builder.ui.workbench.XcpApplication.start(XcpApplication.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)




I have tried various ways to create the matcher but unfortunately did not succeed.
I have the following doubts:
(1). Can you help me understand why am I not able to instantiate the matcher and facing these exceptions ?
(2).
URI fileURI = URI.createFileURI(modelPath);
 Resource resource = resourceSet.getResource(fileURI, true);

In the above snippet, modelPath refers to the ecore file of the model or the model instance i.e. the xml file ?
(3). In the example found in the documentation, a parameter called patternFNQ is used.
Can you tell what is parameter is ?
And why pattern explicitly needs to be passed since the autogenerated matcher class is created out of the pattern only ?
Link of example where pattern is used: incquery.net/node/110
Re: IncQuery for RCP Applications [message #1687038 is a reply to message #1686262] Thu, 19 March 2015 13:18 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

(1) in general, the code snippet you have shown should be working, unless there is something unexpected in either the (compiled) pattern definition or the model. I would like you to look whether there is anything the either EMF-IncQuery itself reports in the development environment, or there is some more detailed log available from your application. There can be multiple causes that might result in this feature not working, but it is almost certainly either a configuration or compilation error. I can try helping figuring out, what happened, but I need some additional information, e.g. more detailed log, or source code that reproduces the issue itself, the version of EMF-IncQuery used.

(2) Yes, modelPath refers to the instance model file.

(3) In the incquery.net page, that uses an older version of EMF-IncQuery, the example there is not up-to-date. Use instead the Headless example from the wiki, that uses the generated patterns. The goal of using the fqn is to define generic code that handles different queries together generically; but if you want only to use specific queries, the generated API is a much better solution.

Cheers,
Zoltán
Re: IncQuery for RCP Applications [message #1687222 is a reply to message #1687038] Thu, 19 March 2015 15:07 Go to previous messageGo to next message
Harkirat Singh Lamba is currently offline Harkirat Singh LambaFriend
Messages: 8
Registered: March 2015
Junior Member
Hi,

Thank you for the prompt reply Smile

(1) While trying to rectify the errors, I came across a similar discussion thread on a Google Group in which you had mentioned that the EMF-IncQuery has to be run inside the OSGi RCP application. Right now, my EMF-IncQuery is incorporated as one of the plugins in the RCP Framework. My RCP framework is built on top of Eclipse. Can you please clarify. Am I doing it right? How should I go about it?

Link to the thread: groups.google.com/forum/#!topic/incquery-users/-6twcOvollE

(2)The pattern defined is very trivial and has no error. What I am able to figure out is that it is not able to create instance of the auto-generated matcher class. I am also not sure if the Engine created is a valid one. Version of Emf-Incquery used: 0.7.0. The error log is as follows:

264504 [main] FATAL org.eclipse.incquery.runtime.101392574  - EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information. 
org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:59)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:1)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.construct(ReteBoundary.java:524)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessProduction(ReteBoundary.java:456)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:177)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:1)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.coalesceTraversals(NavigationHelperImpl.java:938)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.coalesceTraversals(EMFPatternMatcherRuntimeContext.java:194)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.constructionWrapper(ReteEngine.java:225)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.accessMatcher(ReteEngine.java:173)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.accessMatcher(BaseMatcher.java:76)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.<init>(BaseMatcher.java:65)
	at uitemplate.PicklistObjectMatcher.<init>(PicklistObjectMatcher.java:91)
	at uitemplate.PicklistObjectMatcher.on(PicklistObjectMatcher.java:55)
	at com.emc.xcp.query.engine.plugin.IncQueryHeadless.executeDemo(IncQueryHeadless.java:70)
	at com.emc.xcp.query.engine.plugin.RunnerHandler.execute(RunnerHandler.java:64)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at internal.com.emc.xcp.builder.ui.workbench.XcpApplication.start(XcpApplication.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.checkEPackage(NavigationHelperContentAdapter.java:587)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.maintainMetamodel(NavigationHelperContentAdapter.java:563)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.toKey(NavigationHelperContentAdapter.java:146)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.toKey(NavigationHelperImpl.java:376)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.resolveClassifiersToKey(NavigationHelperImpl.java:133)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.registerEClasses(NavigationHelperImpl.java:831)
	at org.eclipse.incquery.runtime.internal.BaseIndexListener.ensure(BaseIndexListener.java:70)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.enumerateAllUnaryInstances(EMFPatternMatcherRuntimeContext.java:383)
	at org.eclipse.incquery.runtime.rete.boundary.EntityFeeder.feed(EntityFeeder.java:42)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessUnaryRoot(ReteBoundary.java:201)
	at org.eclipse.incquery.runtime.rete.construction.ReteContainerBuildable.unaryTypeStub(ReteContainerBuildable.java:179)
	at org.eclipse.incquery.runtime.rete.construction.psystem.basicenumerables.TypeUnary.doCreateStub(TypeUnary.java:38)
	at org.eclipse.incquery.runtime.rete.construction.psystem.EnumerablePConstraint.getStub(EnumerablePConstraint.java:39)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout$Scaffold.run(QuasiTreeLayout.java:90)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout.layout(QuasiTreeLayout.java:44)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuildScaffold.construct(EPMBuildScaffold.java:58)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:57)
	... 48 more
!SESSION 2015-03-19 20:15:08.776 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_45
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product com.emc.xcp.builder.ui.product
Command-line arguments:  -product com.emc.xcp.builder.ui.product -data C:\Users\Administrator\Eclipse WS_HFX2/../runtime-xCP-Designer.product -dev file:C:/Users/Administrator/Eclipse WS_HFX2/.metadata/.plugins/org.eclipse.pde.core/xCP-Designer (Eclipse Perspective)/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -data @noDefault

!ENTRY org.eclipse.incquery.patternlanguage.emf.ui 4 0 2015-03-19 20:19:40.176
!MESSAGE EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information. 

!STACK 0
org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:59)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:1)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.construct(ReteBoundary.java:524)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessProduction(ReteBoundary.java:456)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:177)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:1)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.coalesceTraversals(NavigationHelperImpl.java:938)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.coalesceTraversals(EMFPatternMatcherRuntimeContext.java:194)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.constructionWrapper(ReteEngine.java:225)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.accessMatcher(ReteEngine.java:173)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.accessMatcher(BaseMatcher.java:76)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.<init>(BaseMatcher.java:65)
	at uitemplate.PicklistObjectMatcher.<init>(PicklistObjectMatcher.java:91)
	at uitemplate.PicklistObjectMatcher.on(PicklistObjectMatcher.java:55)
	at com.emc.xcp.query.engine.plugin.IncQueryHeadless.executeDemo(IncQueryHeadless.java:70)
	at com.emc.xcp.query.engine.plugin.RunnerHandler.execute(RunnerHandler.java:64)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at internal.com.emc.xcp.builder.ui.workbench.XcpApplication.start(XcpApplication.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.checkEPackage(NavigationHelperContentAdapter.java:587)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.maintainMetamodel(NavigationHelperContentAdapter.java:563)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.toKey(NavigationHelperContentAdapter.java:146)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.toKey(NavigationHelperImpl.java:376)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.resolveClassifiersToKey(NavigationHelperImpl.java:133)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.registerEClasses(NavigationHelperImpl.java:831)
	at org.eclipse.incquery.runtime.internal.BaseIndexListener.ensure(BaseIndexListener.java:70)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.enumerateAllUnaryInstances(EMFPatternMatcherRuntimeContext.java:383)
	at org.eclipse.incquery.runtime.rete.boundary.EntityFeeder.feed(EntityFeeder.java:42)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessUnaryRoot(ReteBoundary.java:201)
	at org.eclipse.incquery.runtime.rete.construction.ReteContainerBuildable.unaryTypeStub(ReteContainerBuildable.java:179)
	at org.eclipse.incquery.runtime.rete.construction.psystem.basicenumerables.TypeUnary.doCreateStub(TypeUnary.java:38)
	at org.eclipse.incquery.runtime.rete.construction.psystem.EnumerablePConstraint.getStub(EnumerablePConstraint.java:39)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout$Scaffold.run(QuasiTreeLayout.java:90)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout.layout(QuasiTreeLayout.java:44)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuildScaffold.construct(EPMBuildScaffold.java:58)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:57)
	... 48 more
org.eclipse.incquery.runtime.exception.IncQueryException: The following error occurred during the preparation of an EMF-IncQuery pattern matcher: Error during constructing Rete pattern matcher; please review Error Log and consult developers
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.accessMatcher(BaseMatcher.java:78)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.<init>(BaseMatcher.java:65)
	at uitemplate.PicklistObjectMatcher.<init>(PicklistObjectMatcher.java:91)
	at uitemplate.PicklistObjectMatcher.on(PicklistObjectMatcher.java:55)
	at com.emc.xcp.query.engine.plugin.IncQueryHeadless.executeDemo(IncQueryHeadless.java:70)
	at com.emc.xcp.query.engine.plugin.RunnerHandler.execute(RunnerHandler.java:64)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at internal.com.emc.xcp.builder.ui.workbench.XcpApplication.start(XcpApplication.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: org.eclipse.incquery.runtime.rete.construction.RetePatternBuildException: Error during constructing Rete pattern matcher; please review Error Log and consult developers
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:59)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:1)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.construct(ReteBoundary.java:524)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessProduction(ReteBoundary.java:456)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:177)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine$1.call(ReteEngine.java:1)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.coalesceTraversals(NavigationHelperImpl.java:938)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.coalesceTraversals(EMFPatternMatcherRuntimeContext.java:194)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.constructionWrapper(ReteEngine.java:225)
	at org.eclipse.incquery.runtime.rete.matcher.ReteEngine.accessMatcher(ReteEngine.java:173)
	at org.eclipse.incquery.runtime.api.impl.BaseMatcher.accessMatcher(BaseMatcher.java:76)
	... 38 more
Caused by: java.lang.NullPointerException
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.checkEPackage(NavigationHelperContentAdapter.java:587)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.maintainMetamodel(NavigationHelperContentAdapter.java:563)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperContentAdapter.toKey(NavigationHelperContentAdapter.java:146)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.toKey(NavigationHelperImpl.java:376)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.resolveClassifiersToKey(NavigationHelperImpl.java:133)
	at org.eclipse.incquery.runtime.base.core.NavigationHelperImpl.registerEClasses(NavigationHelperImpl.java:831)
	at org.eclipse.incquery.runtime.internal.BaseIndexListener.ensure(BaseIndexListener.java:70)
	at org.eclipse.incquery.runtime.internal.EMFPatternMatcherRuntimeContext.enumerateAllUnaryInstances(EMFPatternMatcherRuntimeContext.java:383)
	at org.eclipse.incquery.runtime.rete.boundary.EntityFeeder.feed(EntityFeeder.java:42)
	at org.eclipse.incquery.runtime.rete.boundary.ReteBoundary.accessUnaryRoot(ReteBoundary.java:201)
	at org.eclipse.incquery.runtime.rete.construction.ReteContainerBuildable.unaryTypeStub(ReteContainerBuildable.java:179)
	at org.eclipse.incquery.runtime.rete.construction.psystem.basicenumerables.TypeUnary.doCreateStub(TypeUnary.java:38)
	at org.eclipse.incquery.runtime.rete.construction.psystem.EnumerablePConstraint.getStub(EnumerablePConstraint.java:39)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout$Scaffold.run(QuasiTreeLayout.java:90)
	at org.eclipse.incquery.runtime.rete.construction.quasitree.QuasiTreeLayout.layout(QuasiTreeLayout.java:44)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuildScaffold.construct(EPMBuildScaffold.java:58)
	at org.eclipse.incquery.runtime.internal.matcherbuilder.EPMBuilder.construct(EPMBuilder.java:57)
	... 48 more


Re: IncQuery for RCP Applications [message #1687262 is a reply to message #1687222] Thu, 19 March 2015 15:29 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

(1) that discussion concerns with EMF-IncQuery versions prior to 0.8.0, as since that release it is possible to execute queries with EMF-IncQuery; however in case of RCP applications it should work out-of-the-box with EMF-IncQuery 0.7.0 as well.

(2) This trace is much more helpful, as it contains the root cause: for some reason, an EReference is found that has no EPackage attribute set, which means more than likely there is an issue with accessing the metamodel. I would check the following things:

a) Is the metamodel project added to your RCP application?
b) Is your metamodel correctly registered? More specifically, in the plugin.xml of your metamodel project, there should be an extension of the extension point "org.eclipse.emf.ecore.generated_package"; please check whether its parameters are set up correctly, e.g. in synch with the metamodel itself (in case of moving the generated metamodel code, or changing the nsURI this often gets incorrect).
c) Is there any error message present in the log related to unloadable plug-ins (e.g. missing dependencies).

Finally, I would like to ask whether there is a reason for using version 0.7.0 of EMF-IncQuery, instead of 0.8 (released in June 2014) or 0.9 (relesed in Feb 2015), that feature several performance and usability enhancements over the 0.7 series (relesed in June 2013). If not, I would recommend updating it to a more current version.

Cheers,
Zoltán
Re: IncQuery for RCP Applications [message #1689430 is a reply to message #1687262] Mon, 23 March 2015 15:11 Go to previous messageGo to next message
Harkirat Singh Lamba is currently offline Harkirat Singh LambaFriend
Messages: 8
Registered: March 2015
Junior Member
Hi,
(a). The metamodel project was added to the RCP application.
(b). Yes, it was correctly registered.
(c). No, there was no error message.

There's was no specific reason to use 0.7.0. I got it from the Eclipse marketplace.

(1). I upgraded from 0.7.0 to Emf-IncQuery 0.8.0 using the zip download option available on the site. However, after resolving all the required dependencies I'm not able to create Incquery project.
The following error occurs in the auto-generated PicklistsQuerySpecification.java file. (Here Picklists is the name of my Pattern)
Multiple markers at this line

- The type PicklistsQuerySpecification must implement the inherited abstract 

method PQuery.getParameters()

- The type PicklistsQuerySpecification must implement the inherited abstract 

method IQuerySpecification<PicklistsMatcher>.newEmptyMatch()

- The type PicklistsQuerySpecification must implement the inherited abstract 

method PQuery.getFullyQualifiedName()

- The type PicklistsQuerySpecification must implement the inherited abstract 

method IQuerySpecification<PicklistsMatcher>.newMatch(Object...)

- The type PicklistsQuerySpecification must implement the inherited abstract 

method BaseQuerySpecification<PicklistsMatcher>.doGetContainedBodies()


Even if we add the unimplemented methods and write some logic in the methods, it will be overridden in the next build workspace since it is an auto-generated file. According to me implementing these methods should not be left to the developer.

(2). Also, an error is reported in the problems tab :
The type org.apache.log4j.Logger cannot be resolved. It is indirectly referenced from required .class files

If I add this dependency then the methods become undefined and the error log shows the following errors:
1. org.eclipse.incquery.patternlanguage cannot be resolved to a type.
2. org.eclipse.incquery.runtime.rete.tuple. Tuple cannot be resolved to a type.
3. The method getLogger() is undefined for the type IncQueryEngine.
and so on.

Please help with the same.

Thanks!
Re: IncQuery for RCP Applications [message #1689441 is a reply to message #1689430] Mon, 23 March 2015 15:33 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

about the original problem, I am out of ideas without seeing/debugging the code, sorry. However, if you could either provide me with the code, or give a reproducible example, I would be glad to look into it.

About the update issues, we changed the runtime API quite a bit in 0.8.0, but provided an updater tool for existing projects. Basically, right-click your IncQuery project, and select "Update/Add EMF-IncQuery Nature" from the "Configure" submenu. See also https://wiki.eclipse.org/EMFIncQuery/Releases/MigrateTo0.8

Cheers,
Zoltán
Re: IncQuery for RCP Applications [message #1690085 is a reply to message #1689441] Wed, 25 March 2015 08:01 Go to previous messageGo to next message
Harkirat Singh Lamba is currently offline Harkirat Singh LambaFriend
Messages: 8
Registered: March 2015
Junior Member
Hi,
I am using Incquery 0.8.1 with xText 2.6 and Eclipse Emf 2.10.2
The problem is the same as described above. As soon as I create a pattern, there are errors in the generated code.
I used the updater tool. But I created the project in Incquery 0.8.1 only and updater tool is used to migrate projects written using 0.7 version to 0.8 version. (Correct me if I'm wrong here)

Below is the link to the Incquey Project and ecore model.
github.com/Harkirat94/query-rcp-app

I have some doubts:
(1). Is generated class <patternname>QuerySpecification.java supposed to implement these methods ?
public IPatternMatch newEmptyMatch() { }

public IPatternMatch newMatch(Object... parameters) { }

public String getFullyQualifiedName() { }

public List<PParameter> getParameters() { }

protected Set<PBody> doGetContainedBodies() throws IncQueryException { }


If yes, then why they are not implemented ?
If it is not supposed to implement them, why the methods are declared in the base class?

(2). Methods getBundleName() and patternName() in the <patternname>QuerySpecification.java have @Override annotation but they are not declared in any of the Base classes. So they are reported as errors.

(3). I checked, the reference to the Base classes are done from proper Jars. (as in all base classes are referenced from jars of version 0.8.1).
I was not able to find the 0.9 version on the site. The integration build in the Eclipse site: www.eclipse.org/incquery/download.php is still an older version: 0.7.1
Could you suggest any particular stable working version I could use ?

Note 1: The same errors are reported in version 0.8.0 and 0.8.1. Only when these errors are resolved I will be able to proceed further to create the IncqueryEngine in which I faced the problem due to which I started this discussion.
Note 2: The RCP application I am working on is licensed. So, I have made a sample ecore model. Since, the problem concerns at the time of writing the pattern and at the time of auto-generated classes and ecore model is not traversed at this moment, so I don't think the complexity of ecore model is of concern. Correct me if I am wrong.

It would be very grateful if you could look into this matter and help me so that I could start working on querying model from within an RCP application.

Thank you.

[Updated on: Wed, 25 March 2015 08:05]

Report message to a moderator

Re: IncQuery for RCP Applications [message #1690737 is a reply to message #1690085] Mon, 30 March 2015 22:48 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

first of all, I want to apologize for not getting back earlier, but I had some things to do in the meanwhile, and I almost forgotten about your post.

I downloaded your example in a new environment with EMF-IncQuery 0.8.1, and I was able to notice your issues. The missing method issues can be fixed by running the project updater: right click on the project, and select Configure/Update EMF-IncQuery nature. It changes the dependencies and builder settings a bit to accomodate for the new changes in version 0.8.0; for projects created in (or after) version 0.8.0, the new layout is used.

However, after that, some issues still remain: the code generator was having issues with the main EMF Package having the same name as the class referred by the query; more specifically, it was having trouble with the class 'Picklist.model.picklist.Picklist'. I have opened a bug for it in bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463525; as a workaround I'd suggest renaming the 'base package' in the EMF generator model to 'picklist.model'; that solved the compile errors to me.

After compiling the project, I have adapted the headless application from the incquery example to run this single query, and it worked to me as expected. I have put my version of the projects online in a clone of your repository: https://github.com/ujhelyiz/query-rcp-app

Finally, thank you for reminding me of not putting out a downloadable zip file for IncQuery 0.9.0 onto the download site. We will get it out shortly.

I hope, these results are helpful, and sorry again for the answer to take this long.

Cheers,
Zoltán
Re: IncQuery for RCP Applications [message #1692089 is a reply to message #1690737] Mon, 13 April 2015 11:19 Go to previous messageGo to next message
Pulkit Manocha is currently offline Pulkit ManochaFriend
Messages: 7
Registered: April 2015
Junior Member
This was immensely helpful.

We're currently working with incquery 0.9.1 which seems to be running fine now.

Thank you so much for the help!

[Updated on: Tue, 14 April 2015 12:03]

Report message to a moderator

Re: IncQuery for RCP Applications [message #1692228 is a reply to message #1692089] Tue, 14 April 2015 12:12 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

sorry again for being slow; I have put out zipped update sites for version 0.9.1 (retroactively creating one for 0.9.0 requires even more work, so I am not planning to do it) on https://www.eclipse.org/incquery/download.php

Thanks for your interest and the reminder for the zipped file.

Cheers,
Zoltán
Previous Topic:Extract transitive closure path from match
Next Topic:Find and count elements of certain type inside a element
Goto Forum:
  


Current Time: Fri Apr 19 19:26:13 GMT 2024

Powered by FUDForum. Page generated in 0.04280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top