Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Issues and error when migrating to Juno and changing to GIT
Issues and error when migrating to Juno and changing to GIT [message #941180] Fri, 12 October 2012 09:21 Go to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 937
Registered: July 2009
Senior Member
Hello,

With previous release of Eclipse (Indigo), I had a smooth working build of .mwe2 workflow file.
Now I use Juno, with the same workspace.

1) First, I notice, there are warnings in my .xtext for the imports
"Packages should be imported by their namespace URI".
Fortunately there is a "fix", so I applied it to several imports.

When running my .mwe2, however I get errors, the imports can't be linked See [Ref1]
The plugin containing these model files didn't have the xtext nature, so I added it, and tried again. Unfortunately no luck.
I didn't notice any builders being activated, so I think the builders haven't run. Can I force it?

2) Next I reversed the imports, to the absolute references with the platform URI.
I run .mwe2 again, and get a different error, the workflow can't find the ui plugin. See [Ref2] (Which it could find perfectly in Indigo).
Then, I realized that in between my migration from Indigo -> Juno, I also started to use GIT. GIT, (To my surprise) moves the project plugin directories on the file system into the GIT repository location. in my case, the GIT repo is under the workspace. I went to Indigo, and indeed I can reproduce the same problem. Can a hard-reference to the UI plugin in the .mwe2 help? See [Ref3] for my current .mwe2.

Does anyone have a similar problem? What would be the best way to deal with this?


Thank you,
Christophe Bouhier


[Ref1]

Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/com/netxforge/Netxscript.xtext':[XtextLinkingDiagnostic: null:20 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/library'., XtextLinkingDiagnostic: null:21 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/operators'., XtextLinkingDiagnostic: null:22 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/metrics'., XtextLinkingDiagnostic: null:155 Couldn't resolve reference to EClassifier 'Parameter'., XtextLinkingDiagnostic: null:161 Couldn't resolve reference to EClassifier 'NodeType'., XtextLinkingDiagnostic: null:164 Couldn't resolve reference to EClassifier 'Node'., XtextLinkingDiagnostic: null:184 Couldn't resolve reference to EClassifier 'Function'., XtextLinkingDiagnostic: null:184 Couldn't resolve reference to EClassifier 'Equipment'., XtextLinkingDiagnostic: null:191 Couldn't resolve reference to EClassifier 'BaseResource'., XtextLinkingDiagnostic: null:225 Couldn't resolve reference to EClassifier 'Relationship'., TransformationDiagnostic: null:155 Cannot find type for '[library::Parameter|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:161 Cannot find type for '[library::NodeType]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:164 Cannot find type for '[operator::Node]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:184 Cannot find type for '[library::Function|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:184 Cannot find type for '[library::Equipment|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:191 Cannot find type for '[library::BaseResource|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:225 Cannot find type for '[operator::Relationship]'. (ErrorCode: NoSuchTypeAvailable)]
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:131)
... 43 more

[Ref2]

Caused by: java.io.FileNotFoundException: ../com.netxforge.netxscript.ui/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.eclipse.xtext.generator.Generator.mergeManifest(Generator.java:394)
... 13 more
17313 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.

[Ref3]

module com.netxforge.GenerateNetxscript

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/com/netxforge/Netxscript.xtext"
var file.extensions = "netxscript"
var projectName = "com.netxforge.netxscript"
var runtimeProject = "../${projectName}"

Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGenModelFile = "platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel"
}

component = DirectoryCleaner {
directory = "${runtimeProject}/src-gen"
}

component = DirectoryCleaner {
directory = "${runtimeProject}.ui/src-gen"
}

component = Generator {
pathRtProject = runtimeProject
pathUiProject = "${runtimeProject}.ui"
pathTestProject = "${runtimeProject}.tests"
projectNameRt = projectName
projectNameUi = "${projectName}.ui"
language = {
uri = grammarURI
fileExtensions = file.extensions

// Java API to access grammar elements (required by several other fragments)
fragment = grammarAccess.GrammarAccessFragment {}

// generates Java API for the generated EPackages
fragment = ecore.EcoreGeneratorFragment {
// referencedGenModels = "
// platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel,
// platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel
// "
}

// Serializer 2.0
fragment = serializer.SerializerFragment {}

// the serialization component (1.0)
// fragment = parseTreeConstructor.ParseTreeConstructorFragment {}

// a custom ResourceFactory for use with EMF
fragment = resourceFactory.ResourceFactoryFragment {
fileExtensions = file.extensions
}

// The antlr parser generator fragment.
fragment = parser.antlr.XtextAntlrGeneratorFragment {
// options = {
// backtrack = true
// }
}

// java-based API for validation
fragment = validation.JavaValidatorFragment {
composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}

// scoping and exporting API
// fragment = scoping.ImportURIScopingFragment {}
// fragment = exporting.SimpleNamesFragment {}

// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}

// CB We override the name provider, with a custom CDO name provider, so this doesn't really make sense.
//
fragment = exporting.QualifiedNamesFragment {}
fragment = builder.BuilderIntegrationFragment {}

// generator API
// CB JDT dependency: https://bugs.eclipse.org/bugs/show_bug.cgi?id=336217
// fragment = generator.GeneratorFragment {
// generateMwe = true
// generateJavaMain = true
// }

// formatter API
fragment = formatting.FormatterFragment {}

// labeling API
fragment = labeling.LabelProviderFragment {}

// outline API
fragment = outline.OutlineTreeProviderFragment {}
fragment = outline.QuickOutlineFragment {}

// quickfix API
fragment = quickfix.QuickfixProviderFragment {}

// content assist API
fragment = contentAssist.JavaBasedContentAssistFragment {}

// generates a more lightweight Antlr parser and lexer tailored for content assist
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}

// generates junit test support classes into Generator#pathTestProject
fragment = junit.Junit4Fragment {}

// project wizard (optional)
// fragment = projectWizard.SimpleProjectWizardFragment {
// generatorProjectName = "${projectName}"
// modelFileExtension = file.extensions
// }

// provides the necessary bindings for java types integration
// CB JDT Dependent.
// fragment = types.TypesGeneratorFragment {}

//CB JDT Dependent. generates the required bindings only if the grammar inherits from Xbase
// fragment = xbase.XbaseGeneratorFragment {}

// provides a preference page for template proposals
// CB JDT Dependent, but not with custom version, also not after 2.1
fragment = templates.CodetemplatesGeneratorFragment {}

// rename refactoring
// CB Not required.
// fragment = refactoring.RefactorElementNameFragment {}

// provides a compare view
// CB Not required.
// fragment = compare.CompareFragment {
// fileExtensions = file.extensions
// }

}
}
}



Re: Issues and error when migrating to Juno and changing to GIT [message #941265 is a reply to message #941180] Fri, 12 October 2012 10:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6385
Registered: July 2009
Senior Member
Did you try a registergeneratedepackage To the standalonesetup

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Issues and error when migrating to Juno and changing to GIT [message #941380 is a reply to message #941265] Fri, 12 October 2012 13:15 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 937
Registered: July 2009
Senior Member
Thanks for your response Christian.

I added packages, and went back with the nsURI as an import reference.
See log from .mwe run: So the packages are added, but still not found. Note that I moved the generated Packages into a separate plugin, to be able to manage model revisions. (In the EMF .genmodel, I change the date in the nsURI, and tell it to generate in a separate plugin, could this be the reason the packages aren't found ?

0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/Users/Christophe/Documents/Projects/GIT_netxstudio/model'
238 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'com.netxforge.netxstudio.library.LibraryPackage'
238 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'com.netxforge.netxstudio.operators.OperatorsPackage'
238 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'com.netxforge.netxstudio.metrics.MetricsPackage'
408 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/scheduling' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
435 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/generics' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
461 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/services' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
516 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/library' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
554 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/operators' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
587 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/metrics' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
594 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/protocols' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
602 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/geo' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
609 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.netxforge.com/13042011/netxstudio' from 'platform:/resource/com.netxforge.netxstudio.models/models/cdo/13042011/netxstudio.genmodel'
1873 [main] ERROR ipse.xtext.generator.LanguageConfig - [XtextLinkingDiagnostic: null:20 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/library'., XtextLinkingDiagnostic: null:21 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/operators'., XtextLinkingDiagnostic: null:22 Couldn't resolve reference to EPackage 'http://www.netxforge.com/13042011/metrics'., XtextLinkingDiagnostic: null:155 Couldn't resolve reference to EClassifier 'Parameter'., XtextLinkingDiagnostic: null:161 Couldn't resolve reference to EClassifier 'NodeType'., XtextLinkingDiagnostic: null:164 Couldn't resolve reference to EClassifier 'Node'., XtextLinkingDiagnostic: null:184 Couldn't resolve reference to EClassifier 'Function'., XtextLinkingDiagnostic: null:184 Couldn't resolve reference to EClassifier 'Equipment'., XtextLinkingDiagnostic: null:191 Couldn't resolve reference to EClassifier 'BaseResource'., XtextLinkingDiagnostic: null:225 Couldn't resolve reference to EClassifier 'Relationship'., TransformationDiagnostic: null:155 Cannot find type for '[library::Parameter|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:161 Cannot find type for '[library::NodeType]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:164 Cannot find type for '[operator::Node]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:184 Cannot find type for '[library::Function|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:184 Cannot find type for '[library::Equipment|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:191 Cannot find type for '[library::BaseResource|FQN]'. (ErrorCode: NoSuchTypeAvailable), TransformationDiagnostic: null:225 Cannot find type for '[operator::Relationship]'. (ErrorCode: NoSuchTypeAvailable)]
1875 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module com.netxforge.GenerateNetxscript: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module com.netxforge.GenerateNetxscript: java.lang.reflect.InvocationTargetException


Re: Issues and error when migrating to Juno and changing to GIT [message #941388 is a reply to message #941380] Fri, 12 October 2012 13:26 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 937
Registered: July 2009
Senior Member
BTW, Regarding my 2nd issue, I found the problem of the FileNotFound Exception.
In GIT, I store plugins in sub folders. As the path = ../project.ui reference it's not going to work for my case.

GIT Structure:
/git_repo/model/xtext.project
/git_repo/client/xtext.project.ui

So the ../ reference will result in FileNotFoundException..
bummer, I need to revisit my repo strategy.
Cheers Christophe
Re: Issues and error when migrating to Juno and changing to GIT [message #941399 is a reply to message #941380] Fri, 12 October 2012 13:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6385
Registered: July 2009
Senior Member
Hi since I don't know your packages I cannot say what the problems
are. Are you sure the nsuris are the correct ones?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Issues and error when migrating to Juno and changing to GIT [message #941413 is a reply to message #941399] Fri, 12 October 2012 13:50 Go to previous message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 937
Registered: July 2009
Senior Member
well... the nsuri's are OK. I somehow think that xtext linker get's confused as multiple with the same name exist in the workspace. I for example have packages which are CDO enabled,
and some which are not and have the same nsuri. Is it somehow possible to see, agains which workspace path, the linking occurs?

thx/ Christophe
Previous Topic:Xtext ecore cross references
Next Topic:NodeModelUtils and EcoreUtil.copy
Goto Forum:
  


Current Time: Thu Oct 23 14:47:52 GMT 2014

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

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