Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340125 - [Query2] Error while Deserializing
Summary: [Query2] Error while Deserializing
Status: NEW
Alias: None
Product: EMF
Classification: Modeling
Component: Query2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 05:15 EDT by saurav sarkar CLA
Modified: 2011-06-01 11:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description saurav sarkar CLA 2011-03-16 05:15:07 EDT
Error appears while a resource is deserilazed and appears in the FURCAS workspace.

Please check the stacktrace below

[code]


java.lang.RuntimeException: invoking method main() on parser class class com.sap.furcas.parser.tcs.stable.TCSParser caused an exception.
	at com.sap.furcas.runtime.parser.wrapper.GeneratedParserWrapper.parse(GeneratedParserWrapper.java:233)
	at com.sap.furcas.runtime.parser.ParserFacade.parseProductionRule(ParserFacade.java:117)
	at com.sap.furcas.runtime.parser.ParserFacade.parseProductionRule(ParserFacade.java:63)
	at com.sap.furcas.parsergenerator.emf.tcs.inject.TCSSpecificEMFModelInjector.parseSyntaxDefinition(TCSSpecificEMFModelInjector.java:57)
	at com.sap.furcas.parsergenerator.emf.tcs.inject.TCSSpecificEMFModelInjector.parseSyntaxDefinition(TCSSpecificEMFModelInjector.java:43)
	at com.sap.furcas.parsergenerator.tcs.generator.SyntaxParser.parse(SyntaxParser.java:39)
	at com.sap.furcas.parsergenerator.tcs.generator.TCSParserGeneratorImpl.parseSyntax(TCSParserGeneratorImpl.java:64)
	at com.sap.furcas.ide.dslproject.builder.SyntaxBuilder.buildGrammar(SyntaxBuilder.java:217)
	at com.sap.furcas.ide.dslproject.builder.SyntaxBuilder$TCSBuildVisitor.visit(SyntaxBuilder.java:64)
	at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:112)
	at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:64)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:74)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:110)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
	at com.sap.furcas.ide.dslproject.builder.SyntaxBuilder.build(SyntaxBuilder.java:134)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:362)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
	at org.eclipse.core.internal.resources.Project.build(Project.java:115)
	at com.sap.furcas.ide.projectwizard.wizards.FurcasWizard.generateSpecific(FurcasWizard.java:342)
	at com.sap.furcas.ide.projectwizard.wizards.FurcasWizard.structuredProcess(FurcasWizard.java:410)
	at com.sap.furcas.ide.projectwizard.wizards.FurcasWizard$2.runInUIThread(FurcasWizard.java:183)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
	at com.sap.furcas.ide.projectwizard.wizards.FurcasWizard.performFinish(FurcasWizard.java:152)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	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:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	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:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: java.lang.reflect.InvocationTargetException
	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 com.sap.furcas.runtime.parser.wrapper.GeneratedParserWrapper.parse(GeneratedParserWrapper.java:220)
	... 84 more
Caused by: java.lang.RuntimeException: Failed to query element with name [ecore, EClassifier]
	at com.sap.furcas.modeladaptation.emf.adaptation.EMFModelAdapter.queryElement(EMFModelAdapter.java:254)
	at com.sap.furcas.parsergenerator.emf.tcs.inject.TCSSpecificEMFModelAdapter.queryElement(TCSSpecificEMFModelAdapter.java:200)
	at com.sap.furcas.runtime.parser.impl.DefaultTextAwareModelAdapter.createOrResolveElement(DefaultTextAwareModelAdapter.java:60)
	at com.sap.furcas.runtime.parser.impl.ModelInjector.createOrResolve(ModelInjector.java:75)
	at com.sap.furcas.runtime.parser.impl.ObservableInjectingParser.createOrResolve(ObservableInjectingParser.java:292)
	at com.sap.furcas.runtime.parser.impl.ObservableInjectingParser.commitCreation(ObservableInjectingParser.java:409)
	at com.sap.furcas.parser.tcs.stable.TCSParser.ecore_eclassifier(TCSParser.java:3261)
	at com.sap.furcas.parser.tcs.stable.TCSParser.reference(TCSParser.java:4993)
	at com.sap.furcas.parser.tcs.stable.TCSParser.furcas_tcs_classtemplate(TCSParser.java:6293)
	at com.sap.furcas.parser.tcs.stable.TCSParser.furcas_tcs_contexttemplate(TCSParser.java:5297)
	at com.sap.furcas.parser.tcs.stable.TCSParser.furcas_tcs_template(TCSParser.java:5195)
	at com.sap.furcas.parser.tcs.stable.TCSParser.furcas_tcs_concretesyntax(TCSParser.java:4279)
	at com.sap.furcas.parser.tcs.stable.TCSParser.main(TCSParser.java:4058)
	... 89 more
Caused by: java.lang.NullPointerException: while trying to invoke the method org.eclipse.emf.query.index.internal.impl.PageableResourceDescriptorImpl.getURI() of an object returned from org.eclipse.emf.query.index.internal.maps.SingleMap.getEqual(java.lang.Object)
	at org.eclipse.emf.query.index.internal.impl.SerializationStrategyFactory$OutgoingLinkMapStrategy.readElement(SerializationStrategyFactory.java:602)
	at org.eclipse.emf.query.index.internal.impl.SerializationStrategyFactory$OutgoingLinkMapStrategy.readElement(SerializationStrategyFactory.java:1)
	at org.eclipse.emf.query.index.internal.maps.ListMap.deserialize(ListMap.java:414)
	at org.eclipse.emf.query.index.internal.impl.PageableResourceDescriptorImpl.deserialize(PageableResourceDescriptorImpl.java:252)
	at org.eclipse.emf.query.index.internal.impl.PageableResourceDescriptorImpl.pageIn(PageableResourceDescriptorImpl.java:287)
	at org.eclipse.emf.query.index.internal.impl.PagingStrategyImpl.loadElement(PagingStrategyImpl.java:270)
	at org.eclipse.emf.query.index.internal.impl.PagingStrategyImpl.lock(PagingStrategyImpl.java:313)
	at org.eclipse.emf.query.index.internal.impl.PagingResourceDescriptorMap.acquire(PagingResourceDescriptorMap.java:68)
	at org.eclipse.emf.query.index.internal.impl.query.EObjectQueryImpl$1.getNextIterator(EObjectQueryImpl.java:107)
	at org.eclipse.emf.query.index.internal.util.FilteredIterableMulti$2.hasNext(FilteredIterableMulti.java:55)
	at org.eclipse.emf.query.index.internal.impl.query.QueryResultImpl$1.hasNext(QueryResultImpl.java:40)
	at org.eclipse.emf.query2.IndexQueryService$5.execute(IndexQueryService.java:250)
	at org.eclipse.emf.query.index.internal.impl.PageableIndexImpl.executeQueryCommand(PageableIndexImpl.java:95)
	at org.eclipse.emf.query2.IndexQueryService.getResourcesOfInstances(IndexQueryService.java:246)
	at org.eclipse.emf.query2.internal.bql.engine.BasicQueryProcessorMemoryEstimationImpl.adaptScopeForInstancesOfTypesInMee(BasicQueryProcessorMemoryEstimationImpl.java:377)
	at org.eclipse.emf.query2.internal.bql.engine.BasicQueryProcessorMemoryEstimationImpl.adaptScopeForInstancesOfTypes(BasicQueryProcessorMemoryEstimationImpl.java:345)
	at org.eclipse.emf.query2.internal.bql.engine.BasicQueryProcessorMemoryEstimationImpl.estimate(BasicQueryProcessorMemoryEstimationImpl.java:296)
	at org.eclipse.emf.query2.internal.bql.engine.BasicQueryProcessorMemoryEstimationImpl.execute(BasicQueryProcessorMemoryEstimationImpl.java:100)
	at org.eclipse.emf.query2.internal.moinql.engine.InterpreterImpl.executeLeafQuery(InterpreterImpl.java:399)
	at org.eclipse.emf.query2.internal.moinql.engine.InterpreterImpl.executeInternalQuery(InterpreterImpl.java:259)
	at org.eclipse.emf.query2.internal.moinql.engine.InterpreterImpl.executeResultUnion(InterpreterImpl.java:288)
	at org.eclipse.emf.query2.internal.moinql.engine.InterpreterImpl.executeInternalQuery(InterpreterImpl.java:246)
	at org.eclipse.emf.query2.internal.moinql.engine.InterpreterImpl.execute(InterpreterImpl.java:136)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl.executeSecuredInternal(QueryProcessorImpl.java:520)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl.access$0(QueryProcessorImpl.java:479)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl$1.execute(QueryProcessorImpl.java:466)
	at org.eclipse.emf.query.index.internal.impl.PageableIndexImpl.executeQueryCommand(PageableIndexImpl.java:95)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl.executeInternal(QueryProcessorImpl.java:471)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl.execute(QueryProcessorImpl.java:682)
	at org.eclipse.emf.query2.internal.moinql.controller.QueryProcessorImpl.execute(QueryProcessorImpl.java:633)
	at com.sap.furcas.modeladaptation.emf.lookup.QueryBasedEcoreMetaModelLookUp.executeQuery(QueryBasedEcoreMetaModelLookUp.java:170)
	at com.sap.furcas.modeladaptation.emf.lookup.QueryBasedEcoreMetaModelLookUp.findClassifiersByUnqualifiedName(QueryBasedEcoreMetaModelLookUp.java:111)
	at com.sap.furcas.modeladaptation.emf.lookup.QueryBasedEcoreMetaModelLookUp.findClassifiersByQualifiedName(QueryBasedEcoreMetaModelLookUp.java:86)
	at com.sap.furcas.modeladaptation.emf.lookup.AbstractEcoreMetaModelLookup.resolveReference(AbstractEcoreMetaModelLookup.java:281)
	at com.sap.furcas.modeladaptation.emf.adaptation.EcoreModelElementFinder.findMetaClassOfType(EcoreModelElementFinder.java:217)
	at com.sap.furcas.modeladaptation.emf.adaptation.EcoreModelElementFinder.findEObjectsOfTypeWithProperties(EcoreModelElementFinder.java:145)
	at com.sap.furcas.modeladaptation.emf.adaptation.EMFModelAdapterDelegate.queryElement(EMFModelAdapterDelegate.java:406)
	at com.sap.furcas.modeladaptation.emf.adaptation.EMFModelAdapter.queryElement(EMFModelAdapter.java:252)
	... 101 more

[/code]
Comment 1 Animesh Kumar CLA 2011-04-25 06:50:12 EDT
Cause of this Exception is As Follows:-
When trying to load (the dumped indices), for some Resource Descriptor, it tries to load the Reference Tables (Outgoing Links table in this case) and it is unable to retrieve the target resource for a particular reference URI. Due to which its throwing a null pointer exception. 
This maybe because you are trying to retrieve some resource inside a jar or some other location which is not resolvable using the given uri and hence it is throwing the exception.

One Possible way to overcome this problem is that, a check for null can be done in the Query 2 code and then try to retrieve the URIs, but its not recommended, as it will ignore all Incorrect Data or access to some restricted data.
Whereas the existing code does not allow you to pass incorrect data.