Community
Participate
Working Groups
Build Identifier: Xtext 2.0.1.v201106261503 causes => java.net.MalformedURLException: unknown protocol: classpath --------------- Workflow { bean = StandaloneSetup { platformUri = "${runtimeProject}/.." uriMap = { from="platform:/plugin/org.eclipse.xsd/model/XSD.ecore" to="classpath:/model/XSD.ecore" } uriMap = { from="platform:/plugin/org.eclipse.xsd/model/XSD.genmodel" to="classpath:/model/XSD.genmodel" } uriMap = { from="platform:/plugin/org.eclipse.wst.wsdl/model/WSDL.ecore" to="classpath:/model/WSDL.ecore" } uriMap = { from="platform:/plugin/org.eclipse.wst.wsdl/model/WSDL.genmodel" to="classpath:/model/WSDL.genmodel" } registerGenModelFile = "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel" registerGenModelFile = "platform:/resource/com.csg.cs.tools.mdgen.idl/src/com/csg/cs/tools/mdgen/idl/Idl.genmodel" registerGenModelFile = "classpath:/model/XSD.genmodel" registerGenModelFile = "classpath:/model/WSDL.genmodel" } this works fine, but it's obsolete: Workflow { ... component = Generator { ... language = { ... // Generate java classes for Ecore models fragment = ecore.EcoreGeneratorFragment { referencedGenModels = "classpath:/model/XSD.genmodel,classpath:/model/WSDL.genmodel" } ... } Reproducible: Always Steps to Reproduce: 1. see also attached mwe2 2. 3.
Created attachment 198638 [details] mwe2 file
please provide the stacktrace as well
...sorry, here it is: -----------------------------> 0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\Data\projects\workspaceIndigo\MDGEN\lib' 6796 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding URI mapping from 'platform:/plugin/org.eclipse.xsd/model/XSD.ecore' to 'classpath:/model/XSD.ecore' 6796 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding URI mapping from 'platform:/plugin/org.eclipse.xsd/model/XSD.genmodel' to 'classpath:/model/XSD.genmodel' 6796 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding URI mapping from 'platform:/plugin/org.eclipse.wst.wsdl/model/WSDL.ecore' to 'classpath:/model/WSDL.ecore' 6796 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding URI mapping from 'platform:/plugin/org.eclipse.wst.wsdl/model/WSDL.genmodel' to 'classpath:/model/WSDL.genmodel' 7327 [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' 7421 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.company.com/tools/mdgen/idl/Idl' from 'platform:/resource/tools.mdgen.idl/src/tools/mdgen/idl/Idl.genmodel' 7452 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module tools.mdgen.icm.IcmDsl: java.lang.reflect.InvocationTargetException java.lang.RuntimeException: Problems instantiating module <>.tools.mdgen.icm.IcmDsl: java.lang.reflect.InvocationTargetException at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:90) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64) 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) Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:137) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:112) 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.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:136) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:112) 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.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:78) 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.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:64) at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:60) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88) ... 5 more 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 org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54) ... 30 more Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.net.MalformedURLException: unknown protocol: classpath at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397) at org.eclipse.emf.mwe.utils.GenModelHelper.registerGenModel(GenModelHelper.java:34) at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterGenModelFile(StandaloneSetup.java:298) ... 35 more Caused by: java.net.MalformedURLException: unknown protocol: classpath at java.net.URL.<init>(URL.java:574) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createInputStream(URIHandlerImpl.java:176) at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:350) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1262) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270) ... 38 more
Seems to be just a problem of inconsistent classpath: support. The deprecated way works fragment = ecore.EcoreGeneratorFragment { referencedGenModels = "classpath:/model/Ecore.genmodel" } and the replacement crashes bean = StandaloneSetup { ... registerGenModelFile = "classpath:/model/Ecore.genmodel" }
Please add scanClassPath=true to the standalone setup and use platform:/resource uris instead of classpath uris. Please reopen if the problem persist.
Closing all bugs that were set to RESOLVED before Neon.0