Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » registered resource factory is needed
registered resource factory is needed [message #923020] Tue, 25 September 2012 10:43
Laigle jérôme is currently offline Laigle jérôme
Messages: 26
Registered: August 2012
Junior Member
Hi,

I have this error when i generate my dsl i don't understand why

0 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Cannot create a resource for 'src/fr/alliancesoftware/abal/Language.xtext'; a registered resource factory is needed
java.lang.RuntimeException: Cannot create a resource for 'src/fr/alliancesoftware/abal/Language.xtext'; a registered resource factory is needed
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:394)
at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:23)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:59)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
my generatelanguage.mwe2:


module fr.alliancesoftware.abal.GenerateLanguage

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

var grammarURI = "classpath:/fr/alliancesoftware/abal/Language.xtext"
var file.extensions = "s"
var projectName = "fr.alliancesoftware.abal.language"
var runtimeProject = "../${projectName}"

Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
// The following two lines can be removed, if Xbase is not used.
registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.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 {
generateStub = false
}

// 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
//}
// }
// the Antlr parser
fragment = parser.antlr.XtextAntlrGeneratorFragment {
options = {
backtrack = true
classSplitting=true
fieldsPerClass = "500"
methodsPerClass= "200"
}
}


// 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 {}
fragment = exporting.QualifiedNamesFragment {}
fragment = builder.BuilderIntegrationFragment {}

// generator API
fragment = generator.GeneratorFragment {
generateMwe = false
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 {}
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
options = {
// backtrack = true
classSplitting=true
fieldsPerClass = "500"
methodsPerClass= "200"
}
}


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

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

// rename refactoring
fragment = refactoring.RefactorElementNameFragment {}

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

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

// provides a preference page for template proposals
fragment = templates.CodetemplatesGeneratorFragment {}

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

}
}
}


Maybe somebody has an idea or can point me into the right direction? Thanks in advance!

Best regards,
Jérôme
Previous Topic:Can XText compile to bytecode without generating java source
Next Topic:Saving model in DSL format
Goto Forum:
  


Current Time: Fri Aug 22 12:00:29 EDT 2014

Powered by FUDForum. Page generated in 0.01514 seconds