Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL standard library error : no viable alternative at input 'validating'
OCL standard library error : no viable alternative at input 'validating' [message #1220510] Thu, 12 December 2013 09:23 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I have cloned the ocl repository and when i open "OCL-2.5.oclstdlib" it contains few error at "validating" keyword. The error text is "no viable alternative at input 'validating'". Can you please explain why it is so? and how i can solve this?

if i remove "validating" keywords then there is no error.

index.php/fa/17012/0/

I am also trying to extend OCL library and i have created new file. but it shows me error at import statement "No 'OclAny' type in the OCL Standard Library"

import 'OCL-2.5.oclstdlib';
library ocl : ocl = 'http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib'{
type Integer : PrimitiveType conformsTo Real {
operation test() : Integer =>'org.eclipse.ocl.examples.library.numeric.TestNumericOperation';

}

}

thanks!

[Updated on: Thu, 12 December 2013 09:45]

Report message to a moderator

Re: OCL standard library error : no viable alternative at input 'validating' [message #1220522 is a reply to message #1220510] Thu, 12 December 2013 10:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

You are not using consistent tooling.

The 'validating' keyword was introduced by

commit 3c715ddb11d8f316ec9e8748423204d85f1ca594 on 2012-11-28 15:54:04

to identify non-strict library functions that could turn invalid into
non-invalid.

You must use an OCLstdlib editor later than that. e.g. Kepler.

Regards

Ed Willink

On 12/12/2013 09:23, ModelGeek Mising name wrote:
> I have cloned the ocl repository and when i open "OCL-2.5.oclstdlib" it contains few error at "validating" keyword. The error text is "no viable alternative at input 'validating'". Can you please explain why it is so? and how i can solve this?
>
> thannks!
>
>
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220538 is a reply to message #1220522] Thu, 12 December 2013 12:22 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I am using kepler. I am also trying to do updates using "http://download.eclipse.org/releases/kepler" and it says no update found...

index.php/fa/17013/0/

Can you please explain which plugin needs to updated and from where(URL)?


thanks for the help!

Regards,
  • Attachment: kepler.png
    (Size: 79.27KB, Downloaded 205 times)
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220556 is a reply to message #1220522] Thu, 12 December 2013 14:20 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
HI

Ah! But the support for validating iterations was added by

commit 7f7a2b6b6533e6901b54b90a76dfc8ee514f04ad on 2013-09-05 12:39:55

so you need to install the Luna M2 or M3 milestones (or M4 Monday).
THese can be installed on Kepler.

Regards

Ed Willink

On 12/12/2013 10:30, Ed Willink wrote:
> Hi
>
> You are not using consistent tooling.
>
> The 'validating' keyword was introduced by
>
> commit 3c715ddb11d8f316ec9e8748423204d85f1ca594 on 2012-11-28 15:54:04
>
> to identify non-strict library functions that could turn invalid into
> non-invalid.
>
> You must use an OCLstdlib editor later than that. e.g. Kepler.
>
> Regards
>
> Ed Willink
>
> On 12/12/2013 09:23, ModelGeek Mising name wrote:
>> I have cloned the ocl repository and when i open "OCL-2.5.oclstdlib"
>> it contains few error at "validating" keyword. The error text is "no
>> viable alternative at input 'validating'". Can you please explain why
>> it is so? and how i can solve this?
>>
>> thannks!
>>
>>
>
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220581 is a reply to message #1220556] Thu, 12 December 2013 15:52 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I have updated kepler to Luna and have restarted Eclipse and now it does not load.... it gets stuck in splash screen.

I have also tried to downlaod Luna and install modeling components. Same problem, After installing, it does not get loaded. It is stuck in splash screen.....

[Updated on: Thu, 12 December 2013 15:52]

Report message to a moderator

Re: OCL standard library error : no viable alternative at input 'validating' [message #1220620 is a reply to message #1220581] Thu, 12 December 2013 18:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

You give no details as to what you call 'Luna'.

There was a problem in M3 with Ecore Tools pulling in Sirius that had a
dependency on self causing a stack overflow and grey screen.

Either skip Ecore Tools/Sirius of get a post M3.

Regards

Ed Willink

On 12/12/2013 15:52, ModelGeek Mising name wrote:
> I have updated kepler to Luna and have restarted Eclipse and now it
> does not load.... it get stuck in splash screen.
> I have also tried to downlaod Luna and install modeling components.
> Same problem, After installing, it does not get loaded. It is stuck in
> splash screen.....
>
>
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220714 is a reply to message #1220620] Fri, 13 December 2013 09:11 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I have downloaded "eclipse-standard-luna-M3-win32.zip" and then i have tried to use luna releases site to install modeling components.
This time i have skipped sirius related options in install dialog but after installation of modeling components it is again stuck at splash screen.


should i download any other version?

Re: OCL standard library error : no viable alternative at input 'validating' [message #1220734 is a reply to message #1220714] Fri, 13 December 2013 10:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

You may have skipped explicit Sirius components, but you may get
implicit ones. Check the plugins folder of you installation and/or
Help->Help About Eclipse SDK->Installation->Plugins to confirm that you
do not have Sirius installed implicitly.

The relevant Bugzilla
is:https://bugs.eclipse.org/bugs/show_bug.cgi?id=421706

Another possible hazard is two versions of com.google.guava.

I'm using Luna M3 successfully with
GEF+EMF+UML+MWE+Xtend+Xtext+OCL+QVTo+QVTd+GIT+SVN and sometimes +Papyrus.

Regards

Ed Willink

On 13/12/2013 09:11, ModelGeek Mising name wrote:
> I have downloaded "eclipse-standard-luna-M3-win32.zip" and then i have
> tried to use luna releases site to install modeling components.
> This time i have skipped sirius related options in install dialog but
> after installation of modeling components it is again stuck at splash
> screen.
>
>
> should i download any other version?
>
>
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220928 is a reply to message #1220734] Mon, 16 December 2013 08:34 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
Hi,

it is fixed, now i am able to run luna and "validating" keyword is no more problematic. but still when i am writing the extension for the OCL library then editor shows very strange error "No 'OclAny' type in the OCL Standard Library" at import statement

import 'OCL-2.5.oclstdlib';
library ocl : ocl = 'http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib' {


}

do you know why it is the case?

cheers,
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220951 is a reply to message #1220928] Mon, 16 December 2013 10:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

If you want to extend the existing library, do not respecify the nsURI.

The diagnostic is that your new library replaces the imported one but
has (at least) one deficiency with respect to the minimum requirements
on a library. e.g. there must be an OclAny type.

Regards

Ed Willink

On 16/12/2013 08:34, ModelGeek Mising name wrote:
> Hi,
>
> it is fixed, now i am able to run luna and "validating" keyword is no
> more problematic. but still when i am writing the extension for the OCL
> library then editor shows very strange error "No 'OclAny' type in the
> OCL Standard Library" at import statement
>
> import 'OCL-2.5.oclstdlib';
> library ocl : ocl = 'http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib' {
>
>
> }
>
> do you know why it is the case?
>
> cheers,
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220952 is a reply to message #1220951] Mon, 16 December 2013 10:44 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I have removed nsURI and now editor does not show any error. I have changed the GenerateOCLstdlibModel.mwe2 to point to my newly extened oclstdlib file but when i run GenerateOCLstdlibModel.mwe2 script then i get following error

5677 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow GenerateOCLstdlibModel:
[ERROR]: OCLstdlib parse failure
1: The first library must have a URI(Element: -UNKNOWN-; Reported by: GenerateOCLstdlibXtend)
java.lang.RuntimeException: Problems running workflow GenerateOCLstdlibModel:
[ERROR]: OCLstdlib parse failure
1: The first library must have a URI(Element: -UNKNOWN-; Reported by: GenerateOCLstdlibXtend)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: java.lang.RuntimeException:
[ERROR]: OCLstdlib parse failure
1: The first library must have a URI(Element: -UNKNOWN-; Reported by: GenerateOCLstdlibXtend)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:56)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:48)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
... 4 more


The code for GenerateOCLstdlibModel.mwe2 script is


Workflow {
bean = ResourceSetImpl : resourceSet {}
bean = StandaloneSetup { resourceSet = resourceSet
platformUri = ".."
}
component = GenerateOCLstdlibXtend { resourceSet = resourceSet
projectName = "${sourceName}"
//modelFile = "model/OCL-2.5.oclstdlib"
modelFile = "model/extendedOCL.oclstdlib"
uri = "http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib"
javaFolder = "/${targetName}/emf-gen"
javaPackageName = "${targetName}.model"
javaClassName = "OCLstdlib"
}
component = Model2tablesGenerator { resourceSet = resourceSet
genModelFile = "/${sourceName}/model/oclstdlib.genmodel"
genOCLstdlib = true
}
}

Code for extendedOCL.oclstdlib is
import 'OCL-2.5.oclstdlib';
library ocl {

}

Do you any idea why the above mention execption occurs?

thanks!

cheers
Re: OCL standard library error : no viable alternative at input 'validating' [message #1220955 is a reply to message #1220952] Mon, 16 December 2013 10:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

I've not tried generating a custom library, so you're on your own.

However you should look at the tests for extending the library dymamically,

e.g.
org.eclipse.ocl.examples.test.xtext.ImportTests.testImport_CompleteOCL_custom_OCLstdlib

Regards

Ed Willink


On 16/12/2013 10:44, ModelGeek Mising name wrote:
> I have removed nsURI and now editor does not show any error. I have
> changed the GenerateOCLstdlibModel.mwe2 to point to my newly extened
> oclstdlib file but when i run GenerateOCLstdlibModel.mwe2 script then i
> get following error
>
> 5677 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems
> running workflow GenerateOCLstdlibModel: [ERROR]: OCLstdlib parse failure
> 1: The first library must have a URI(Element: -UNKNOWN-; Reported by:
> GenerateOCLstdlibXtend)
> java.lang.RuntimeException: Problems running workflow
> GenerateOCLstdlibModel: [ERROR]: OCLstdlib parse failure
> 1: The first library must have a URI(Element: -UNKNOWN-; Reported by:
> GenerateOCLstdlibXtend)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
> Caused by: java.lang.RuntimeException: [ERROR]: OCLstdlib parse failure
> 1: The first library must have a URI(Element: -UNKNOWN-; Reported by:
> GenerateOCLstdlibXtend)
> at
> org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:56)
> at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:48)
> at
> org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
>
> at
> org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
>
> at
> org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
> at
> org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
> ... 4 more
>
>
> The code for GenerateOCLstdlibModel.mwe2 script is
>
>
> Workflow {
> bean = ResourceSetImpl : resourceSet {}
> bean = StandaloneSetup { resourceSet = resourceSet
> platformUri = ".."
> }
> component = GenerateOCLstdlibXtend { resourceSet = resourceSet
> projectName = "${sourceName}"
> //modelFile = "model/OCL-2.5.oclstdlib"
> modelFile = "model/extendedOCL.oclstdlib"
> uri = "http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib"
> javaFolder = "/${targetName}/emf-gen"
> javaPackageName = "${targetName}.model"
> javaClassName = "OCLstdlib"
> }
> component = Model2tablesGenerator { resourceSet = resourceSet
> genModelFile = "/${sourceName}/model/oclstdlib.genmodel"
> genOCLstdlib = true
> }
> }
>
> Code for extendedOCL.oclstdlib is import 'OCL-2.5.oclstdlib';
> library ocl {
>
> }
>
> Do you any idea why the above mention execption occurs?
>
> thanks!
>
> cheers
>
Re: OCL standard library error : no viable alternative at input 'validating' [message #1221349 is a reply to message #1220955] Tue, 17 December 2013 13:41 Go to previous message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 520
Registered: June 2011
Senior Member
I have looked at test case. It is to load library dynamically. But my problem is code generation for customized library and i am using GenerateOCLstdlibModel.mwe2.
If i just GenerateOCLstdlibModel.mwe2 to point to customized library file instead of default(OCL-2.5.oclstdlib) and execute GenerateOCLstdlibModel.mwe2 file then i get the following error

367 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Unresolved compilation problem:
orphans cannot be resolved

java.lang.Error: Unresolved compilation problem:
orphans cannot be resolved

at org.eclipse.ocl.examples.pivot.model.OCLstdlib$Contents.installLambdaTypes(OCLstdlib.java:236)
at org.eclipse.ocl.examples.pivot.model.OCLstdlib$Contents.create(OCLstdlib.java:178)
at org.eclipse.ocl.examples.pivot.model.OCLstdlib.getDefault(OCLstdlib.java:82)
at org.eclipse.ocl.examples.pivot.model.OCLstdlib$Loader.getResource(OCLstdlib.java:137)
at org.eclipse.ocl.examples.pivot.manager.MetaModelManager.loadDefaultLibrary(MetaModelManager.java:2595)
at org.eclipse.ocl.examples.pivot.manager.PivotStandardLibrary.getLibraryType(PivotStandardLibrary.java:169)
at org.eclipse.ocl.examples.pivot.manager.PivotStandardLibrary.getRequiredLibraryType(PivotStandardLibrary.java:283)
at org.eclipse.ocl.examples.pivot.manager.PivotStandardLibrary.resolveRequiredSimpleType(PivotStandardLibrary.java:388)
at org.eclipse.ocl.examples.pivot.manager.PivotStandardLibrary.getOclElementType(PivotStandardLibrary.java:201)
at org.eclipse.ocl.examples.xtext.base.cs2as.BaseCSPreOrderVisitor$ClassSupersContinuation.execute(BaseCSPreOrderVisitor.java:98)
at org.eclipse.ocl.examples.xtext.base.cs2as.CS2PivotConversion.progressContinuations(CS2PivotConversion.java:819)
at org.eclipse.ocl.examples.xtext.base.cs2as.CS2PivotConversion.update(CS2PivotConversion.java:1312)
at org.eclipse.ocl.examples.xtext.base.cs2as.CS2Pivot.update(CS2Pivot.java:519)
at org.eclipse.ocl.examples.xtext.oclstdlib.cs2as.OCLstdlibCS2Pivot.update(OCLstdlibCS2Pivot.java:67)
at org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotResourceAdapter.refreshPivotMappings(CS2PivotResourceAdapter.java:107)
at org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotLinker.afterModelLinked(CS2PivotLinker.java:75)
at org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(AbstractCleaningLinker.java:49)
at org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:294)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:88)
at org.eclipse.ocl.examples.xtext.essentialocl.utilities.EssentialOCLCSResource.doLinking(EssentialOCLCSResource.java:169)
at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:262)
at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:252)
at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:165)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:81)
at org.eclipse.ocl.examples.xtext.essentialocl.utilities.EssentialOCLCSResource.doLoad(EssentialOCLCSResource.java:177)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.ocl.examples.build.xtend.GenerateOCLstdlib.invokeInternal(GenerateOCLstdlib.java:77)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)


It seems a bug in library's import functionality as if would have imported properly then it should have worked fine as it works fine with defaul library (OCL-2.5.oclstdlib).

May be you could identify the bug and register a bug report so this can resolved for future.

thanks for the help!

Cheers,
Previous Topic:Checking if the ecore model is valid in code
Next Topic:OCL Set Function to Java Code
Goto Forum:
  


Current Time: Fri Oct 31 04:03:34 GMT 2014

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

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