Home » Modeling » TMF (Xtext) » errors while exporting to Repository
errors while exporting to Repository [message #782343] |
Mon, 23 January 2012 15:16 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
I have a DSL working ok when I test with
I want to incorporate int main eclipse.
I go into "Deployable plug-ins and fragments", select all plug-ins (rpc, rpc.tests & rpc.ui) and then "Install into host,
Repository."
Operation fails:
=========================================
Problem during export
Errors occurred during the export operation. The ant tasks generated log files
which can e found at /srv/devel/install/logs.zip
=========================================
I do attach the complete zip file, but errors are all the same:
=========================================
1. ERROR in /srv/devel/parser.WS/com.softin.rpc/src/com/softin/rpc/MyIntegerConverterImplementation.java (at line 10)
public Integer toValue(String string, INode node)
throws ValueConverterException {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method toValue(String, INode) of type MyIntegerConverterImplementation must override a superclass method
=========================================
Which is strange.
MyIntegerConverterImplementation.java is trivial:
=========================================
package com.softin.rpc;
import org.eclipse.xtext.conversion.IValueConverter;
import org.eclipse.xtext.conversion.ValueConverterException;
import org.eclipse.xtext.nodemodel.INode;
public class MyIntegerConverterImplementation implements IValueConverter<Integer> {
@Override
public Integer toValue(String string, INode node)
throws ValueConverterException {
return Integer.decode(string);
}
@Override
public String toString(Integer value) throws ValueConverterException {
return value.toString();
}
}
=========================================
I also tried commenting out the offending "@Override" and the export seems to succeed, but the same errors pops up again when the editor is actually instantiated.
What am I doing wrong?
TiA
Mauro
-
Attachment: logs.zip
(Size: 1.44KB, Downloaded 346 times)
|
|
|
Re: errors while exporting to Repository [message #782368 is a reply to message #782343] |
Mon, 23 January 2012 15:57 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Mauro,
it looks like your export uses another compatibility level for the Java
compiler, e.g. 1.5 vs 1.6. Unfortunately I don't know why this could happen.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 23.01.12 16:16, schrieb Mauro Condarelli:
> I have a DSL working ok when I test with
> I want to incorporate int main eclipse.
> I go into "Deployable plug-ins and fragments", select all plug-ins (rpc, rpc.tests& rpc.ui) and then "Install into host,
> Repository."
>
> Operation fails:
>
> =========================================
> Problem during export
> Errors occurred during the export operation. The ant tasks generated log files
> which can e found at /srv/devel/install/logs.zip
> =========================================
>
> I do attach the complete zip file, but errors are all the same:
> =========================================
> 1. ERROR in /srv/devel/parser.WS/com.softin.rpc/src/com/softin/rpc/MyIntegerConverterImplementation.java (at line 10)
> public Integer toValue(String string, INode node)
> throws ValueConverterException {
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The method toValue(String, INode) of type MyIntegerConverterImplementation must override a superclass method
> =========================================
>
> Which is strange.
> MyIntegerConverterImplementation.java is trivial:
>
> =========================================
> package com.softin.rpc;
>
> import org.eclipse.xtext.conversion.IValueConverter;
> import org.eclipse.xtext.conversion.ValueConverterException;
> import org.eclipse.xtext.nodemodel.INode;
>
> public class MyIntegerConverterImplementation implements IValueConverter<Integer> {
>
> @Override
> public Integer toValue(String string, INode node)
> throws ValueConverterException {
> return Integer.decode(string);
> }
>
> @Override
> public String toString(Integer value) throws ValueConverterException {
> return value.toString();
> }
>
> }
> =========================================
>
> I also tried commenting out the offending "@Override" and the export seems to succeed, but the same errors pops up again when the editor is actually instantiated.
>
> What am I doing wrong?
>
> TiA
> Mauro
|
|
| |
Re: errors while exporting to Repository [message #782518 is a reply to message #782402] |
Mon, 23 January 2012 21:47 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Thanks for the answers.
Unfortunately I still need some help
(please see the LAST error listing).
Il 23/01/2012 17:45, Tom Schindl ha scritto:
> Well if you happen to modify the settings in your project and don't keep
> them in sync with your Required-Execution-Env in your MANIFEST.MF this
> happens because the PDE-Build has no idea about the project-settings it
> only knows about the MANIFEST information.
It may have happened because I created the workspace (containing a single xtext project rpc, rpc.tests and rpc.ui) on one machine (Win7-SunJava_1.7) and then I moved it to another one (ubuntu_11.04/OpenJDK_1.6) and proceeded to continue development there.
>
> To resync them you need open your MANIFEST.MF-Overview and hit "update
> the classpath settings" (maybe you want to set a higher before).
Unfortunately this doesn't appear to be true.
I proceeded to correct the error (I now have "JavaSE-1.6" consistently everywhere, but I had to manually edit several files), to regenerate the project (cleaning it and then re-running GenerateSIDL.mwe2).
=======================================
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/srv/devel/parser.WS'
68 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
368 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
370 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
382 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
382 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
818 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning /srv/devel/parser.WS/com.softin.rpc/../com.softin.rpc/src-gen
821 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning /srv/devel/parser.WS/com.softin.rpc/../com.softin.rpc.ui/src-gen
957 [main] INFO ipse.xtext.generator.LanguageConfig - generating infrastructure for com.softin.rpc.SIDL with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, SerializerFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, GeneratorFragment, FormatterFragment, LabelProviderFragment, OutlineTreeProviderFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment, Junit4Fragment, RefactorElementNameFragment, TypesGeneratorFragment, XbaseGeneratorFragment, CodetemplatesGeneratorFragment, CompareFragment
2635 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.softin.com/rpc/SIDL' from 'platform:/resource/com.softin.rpc/src-gen/com/softin/rpc/SIDL.genmodel'
5056 [main] INFO or.validation.JavaValidatorFragment - generating Java-based EValidator API
6408 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
6419 [main] INFO text.generator.junit.Junit4Fragment - generating Compare Framework infrastructure
6538 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
=======================================
I see nothing wrong here.
This leads to a working executable if I run "Launch Runtime Eclipse" (as before!).
When I run the "Export Wizard" (checked rpc & rpc.ui; Install into host. Repository.; pointer to empty dir) I only get the expected "You will need to restart Eclipse..." message (I select "Restart Now").
Everything seems ok, but if I open an example file for my SDL I get: "could not open the editor: An unexpected exception was thrown.";
details are:
=======================================
java.lang.NullPointerException
at org.eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider.handleProjectionEnabled(DefaultFoldingStructureProvider.java:100)
at org.eclipse.xtext.ui.editor.folding.DefaultFoldingStructureProvider$ProjectionChangeListener.projectionEnabled(DefaultFoldingStructureProvider.java:186)
at org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:489)
at org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:537)
at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1441)
at org.eclipse.xtext.ui.editor.XtextEditor.installFoldingSupport(XtextEditor.java:471)
at org.eclipse.xtext.ui.editor.XtextEditor.createPartControl(XtextEditor.java:453)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
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:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
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:344)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
=======================================
And the following on the command line where I started eclipse:
=======================================
1 [main] ERROR org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback - Was configured with another client or not configured at all.
java.lang.IllegalStateException: Was configured with another client or not configured at all.
at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.removeDirtyStateSupport(DirtyStateEditorSupport.java:336)
at org.eclipse.xtext.ui.editor.AbstractDirtyStateAwareEditorCallback.beforeDispose(AbstractDirtyStateAwareEditorCallback.java:38)
at org.eclipse.xtext.ui.editor.CompoundXtextEditorCallback.beforeDispose(CompoundXtextEditorCallback.java:69)
at org.eclipse.xtext.ui.editor.XtextEditor.dispose(XtextEditor.java:501)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:705)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:107)
at org.eclipse.ui.internal.ide.actions.OpenLocalFileAction.run(OpenLocalFileAction.java:76)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
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:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
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:344)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
=======================================
Which seemds interesting, but I'm really out of my depth here :(
Please help!
Mauro
>
> Tom
>
> Am 23.01.12 16:57, schrieb Sebastian Zarnekow:
>> Hi Mauro,
>>
>> it looks like your export uses another compatibility level for the Java
>> compiler, e.g. 1.5 vs 1.6. Unfortunately I don't know why this could
>> happen.
>>
>> Regards,
>> Sebastian
>
|
|
| |
Re: errors while exporting to Repository [message #785229 is a reply to message #782537] |
Sat, 28 January 2012 17:42 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Hi,
I still need to solve this.
Can someone help, please?
Regards
Mauro
Il 23/01/2012 23:47, Mauro Condarelli ha scritto:
> Il 23/01/2012 22:47, Mauro Condarelli ha scritto:
>> Thanks for the answers.
>> Unfortunately I still need some help
>> (please see the LAST error listing).
>>
>> Il 23/01/2012 17:45, Tom Schindl ha scritto:
>>> Well if you happen to modify the settings in your project and don't keep
>>> them in sync with your Required-Execution-Env in your MANIFEST.MF this
>>> happens because the PDE-Build has no idea about the project-settings it
>>> only knows about the MANIFEST information.
>> It may have happened because I created the workspace (containing a single xtext project rpc, rpc.tests and rpc.ui) on one machine (Win7-SunJava_1.7) and then I moved it to another one (ubuntu_11.04/OpenJDK_1.6) and proceeded to continue development there.
>>>
>>> To resync them you need open your MANIFEST.MF-Overview and hit "update
>>> the classpath settings" (maybe you want to set a higher before).
>> Unfortunately this doesn't appear to be true.
> ...
>
> UPDATE:
>
> I created another xtext project on this machine (from scratch, in a brand new workspace) and I immediately get the following three errors:
> Description Resource Path Location Type
> Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. com.softin.rpc Build path JRE System Library Problem
> Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. com.softin.rpc.tests Build path JRE System Library Problem
> Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. com.softin.rpc.ui Build path JRE System Library Problem
>
> Anyways, if I copy over just the grammar (.xtext) and code generation files (.xtend) everything seems to work fine and I can create a new .sidl file and edit it (after eclipse restart, of course).
>
> But if I include also the three converter files (MyIntegerConverterImplementation.java, MyStringConverterImplementation.java and MyValueConverterService.java) and re-run the Export Wizard with the same parameters it complains (Errors occurred...) with exactly the same errors.
>
> This IMHO means the fact I created the old project in another machine is not relevant.
>
> If it matters: I'm using the "Complete Eclipse Indigo Distribution" from xtext.itemis.com (http://download.itemis.com/distros/eclipse-SDK-3.7.1-Xtext-2.2.1-linux-gtk.tar.gz), augmented with CDT-SDK.
>
> I can send over the complete project if it is useful.
>
> Thanks again
> Mauro
|
|
| | | |
Re: errors while exporting to Repository [message #1011615 is a reply to message #785715] |
Tue, 19 February 2013 22:40 |
Alan Alberghini Messages: 19 Registered: January 2013 |
Junior Member |
|
|
I keep getting the same kind of message as Mauro when trying to open my editor after having installed the plugin:
org.eclipse.xtext.parser.ParseException: java.lang.Error: Unresolved compilation problem:
The method toValue(String, INode) of type DOUBLEValueConverter must override a superclass method
DOUBLEValueConverter is my value converter class for decimal literals:
package it.unibo.xtext.myvalueconv;
import org.eclipse.xtext.conversion.ValueConverterException;
import org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter;
import org.eclipse.xtext.nodemodel.INode;
public class DOUBLEValueConverter extends AbstractLexerBasedConverter<Double> {
public DOUBLEValueConverter() {
super();
}
@Override
public Double toValue(String string, INode node)
throws ValueConverterException {
if (string == null)
return null;
try {
return Double.parseDouble(string);
}catch (NumberFormatException e){
throw new ValueConverterException(e.getMessage(), node, e);
}
}
}
How come the message says that I should override the method that I overrode? Is it because of generics?
The bundles were configured for J2SE 1.5, but switching to 1.6 and rebuilding everything didn't do the trick.
Any suggestions?
EDIT: I keep getting the same error even removing the @Override annotation from the "toValue" method...
[Updated on: Wed, 20 February 2013 09:32] Report message to a moderator
|
|
|
Re: errors while exporting to Repository [message #1011813 is a reply to message #1011615] |
Wed, 20 February 2013 09:56 |
|
I think it's because toValue comes from the interface IValueConverter
thus it is an abstract method and Java 5 does not accept @Override
annotation for abstract methods...
you should make sure to set the compiler settings in your workspace to
use J2SE 1.5 so that you are notified about these errors in your
developer workspace so that you can fix them and export the plugins
again and reinstall them...
hope this helps
Lorenzo
On 02/19/2013 11:40 PM, Alan Alberghini wrote:
> I keep getting the same kind of message as Mauro when trying to open my
> editor after having installed the plugin:
> org.eclipse.xtext.parser.ParseException: java.lang.Error: Unresolved
> compilation problem: The method toValue(String, INode) of type
> DOUBLEValueConverter must override a superclass method
> DOUBLEValueConverter is my value converter class for decimal literals:
>
> package it.unibo.xtext.myvalueconv;
>
> import org.eclipse.xtext.conversion.ValueConverterException;
> import org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter;
> import org.eclipse.xtext.nodemodel.INode;
>
> public class DOUBLEValueConverter extends
> AbstractLexerBasedConverter<Double> {
>
> public DOUBLEValueConverter() {
> super();
> }
> @Override
> public Double toValue(String string, INode node)
> throws ValueConverterException {
> if (string == null)
> return null;
> try {
> return Double.parseDouble(string);
> }catch (NumberFormatException e){
> throw new ValueConverterException(e.getMessage(), node, e);
> }
> }
> }
>
> How come the message says that I should override the method that I
> overrode? Is it because of generics?
> The bundles were configured for J2SE 1.5, but switching to 1.6 and
> rebuilding everything didn't do the trick.
> Any suggestions?
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: errors while exporting to Repository [message #1012064 is a reply to message #1011876] |
Wed, 20 February 2013 20:18 |
|
On 02/20/2013 01:08 PM, Alan Alberghini wrote:
> Lorenzo Bettini wrote on Wed, 20 February 2013 10:56
>> I think it's because toValue comes from the interface IValueConverter
>> thus it is an abstract method and Java 5 does not accept @Override
>> annotation for abstract methods...
>>
>> you should make sure to set the compiler settings in your workspace to
>> use J2SE 1.5 so that you are notified about these errors in your
>> developer workspace so that you can fix them and export the plugins
>> again and reinstall them...
>>
>> hope this helps
>> Lorenzo
>
> Thanks for your suggestion, but I tried removing the @Override
> annotation too (which should remove the problem altogether in Java 5)
> and it didn't change anything...
mh... you mean you removed the @Override from
public class DOUBLEValueConverter extends
AbstractLexerBasedConverter<Double> {
public DOUBLEValueConverter() {
super();
}
@Override
public Double toValue(String string, INode node)
and you still get this error
org.eclipse.xtext.parser.ParseException: java.lang.Error: Unresolved
compilation problem: The method toValue(String, INode) of type
DOUBLEValueConverter must override a superclass method
that makes no sense :)
it means it's still using the old code
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| | | | |
Goto Forum:
Current Time: Wed Sep 25 17:08:38 GMT 2024
Powered by FUDForum. Page generated in 0.08198 seconds
|