[XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692393] |
Wed, 15 April 2015 12:53  |
Eclipse User |
|
|
|
Hi,
I am new to xtend and xpand. I am trying to access the model elements and element values in xpand template. while accessing the elements i am able to generating the output(source file) file. but when i am trying to access the element value i am getting java.net.MalformedURLException: unknown protocol: ar this exception.Please help me in this
Thank you in advance.
|
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692470 is a reply to message #1692466] |
Thu, 16 April 2015 06:28   |
Eclipse User |
|
|
|
my models are of .arxml type and yes model is having references to other model. but here as of now i am just trying to access the same model references, in future i will access the other model references from the current model in one template file.
NOTE: The exception is getting only in case of accessing element value or reference.
|
|
|
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692487 is a reply to message #1692482] |
Thu, 16 April 2015 08:50   |
Eclipse User |
|
|
|
Btw. the following code works nice for me: (requires org.artop.aal.examples.standalone)
module Test
Workflow {
bean = xxx.AutosarAwareStandaloneSetup {
platformUri = ".."
}
bean = org.artop.aal.examples.standalone.StandaloneResourceSet : rs {
}
component = org.eclipse.emf.mwe.utils.Reader {
modelSlot = "model"
uri = "platform:/resource/xxx/yyyy.arxml"
resourceSet = rs
}
...
}
with
import org.artop.aal.examples.standalone.AutosarStandaloneSetup;
import org.eclipse.emf.mwe.utils.StandaloneSetup;
public class AutosarAwareStandaloneSetup extends StandaloneSetup {
public AutosarAwareStandaloneSetup() {
super();
AutosarStandaloneSetup.doSetupForAutosar40();
}
}
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692488 is a reply to message #1692482] |
Thu, 16 April 2015 08:55   |
Eclipse User |
|
|
|
As per my understanding you are saying about the below one right?
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
<registerGeneratedEPackage
value="autosar40.util.Autosar40Package"/>
<extensionMap>
<from value="arxml" />
<to value="autosar40.util.Autosar40ResourceFactoryImpl" />
</extensionMap>
</bean>
if i am correct then i am registering this in the workflow.
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692493 is a reply to message #1692489] |
Thu, 16 April 2015 09:09   |
Eclipse User |
|
|
|
i am sharing my workflow... please look into it
<?xml version="1.0"?>
<workflow>
<property name="model" value="project/folder/abc.arxml" />
<property name="systemmodel" value="project/folder/xyz.arxml" />
<property name="genPath" value="src-gen" />
<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
<registerGeneratedEPackage
value="autosar40.util.Autosar40Package"/>
<extensionMap>
<from value="arxml" />
<to value="autosar40.util.Autosar40ResourceFactoryImpl" />
</extensionMap>
</bean>
<!-- instantiate metamodel -->
<bean id="mm_emf" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="systemmodel" />
<uri value="platform:/resource/${systemmodel}" />
</component>
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="model" />
<uri value="platform:/resource/${model}" />
</component>
<!-- Clear output directory -->
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value="${genPath}"/>
</component>
<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm_emf"/>
<expand
value="templates::Test::MainGenerate FOR systemmodel" />
<genPath value="${genPath}"/>
<!--<metaModel class="org.eclipse.xtend.type.impl.java.JavaBeansMetaModel" />-->
</component>
</workflow>
from here i am accessing the model in xpand template. Any modification needed here?
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692506 is a reply to message #1692503] |
Thu, 16 April 2015 09:47   |
Eclipse User |
|
|
|
Hi,
i have no mwe1 thus i cannot do the backport
what i posted before is my complete workflow. (what i do with the model does not matter)
so the only change you need is:
(1) you need that special standalonesetup that does the proper registration
(2) the xtext reader needs a special resourceset
so just from guessing:
<bean class="xxx.AutosarAwareStandaloneSetup" platformUri = ".." />
<bean id="myRS" class="org.artop.aal.examples.standalone.StandaloneResourceSet"/>
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="model" />
<uri value="platform:/resource/..." />
<resourceSet idRef="myRS"/>
</component>
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692512 is a reply to message #1692506] |
Thu, 16 April 2015 10:11   |
Eclipse User |
|
|
|
Thank you very much for the quick responses christian...
mwe1 file means mwe right?
I have both mwe and mwe2 workflow files. Both are independent files right?...Project will run even if i delete the mwe2 file. The code which you have shared first belongs to mwe2 file and the code u have shared in the previous post belongs to mwe file?
you want me to make changes in only one workflow file(mwe or mwe2) or both. And
i am bit confused with this christian.
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692542 is a reply to message #1692525] |
Thu, 16 April 2015 12:13   |
Eclipse User |
|
|
|
HI,
i have downloaded the plugin and imported. and the code which you have shared...i put in mwe file for reading the model.But while running the mwe file i am getting the below error.
Please help
0 INFO WorkflowEngine - --------------------------------------------------------------------------------------
0 INFO WorkflowEngine - EMF Modeling Workflow Engine 1.2.1, Build v201309030422
0 INFO WorkflowEngine - (c) 2005-2009 openarchitectureware.org and contributors
0 INFO WorkflowEngine - --------------------------------------------------------------------------------------
0 INFO WorkflowEngine - running workflow: D:/workspace_NDE2/Test_Rte/src/workflow/generator.mwe
0 INFO WorkflowEngine -
780 ERROR WorkflowEngine - [ERROR]: Class not found: 'org.artop.aal.examples.standalone.StandaloneResourceSet'(Element: bean bean class='org.artop.aal.examples.standalone.StandaloneResourceSet' id='myRS' in D:/workspace_NDE2/Test_Rte/src/workflow/generator.mwe:22; Reported by: -UNKNOWN-)
780 WARN WorkflowEngine - [WARNING]: The type of the referred bean (java.lang.Object) is not assignable to org.eclipse.emf.ecore.resource.ResourceSet(Element: -UNKNOWN-; Reported by: -UNKNOWN-)
780 ERROR WorkflowEngine - Workflow interrupted because of configuration errors.
And the java code you shared...where should i create the java file? and how does the mwe file will know it?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692671 is a reply to message #1692669] |
Fri, 17 April 2015 10:03   |
Eclipse User |
|
|
|
I am getting the following error:
ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'templates::Rte::RteGenerate(autosartoplevelstructure::AUTOSAR) for autosartoplevelstructure::AUTOSAR' found!
[23,57] on line 1 'EXPAND templates::Rte::RteGenerate(model) FOR systemmodel'
5339 ERROR WorkflowEngine - Workflow interrupted. Reason: No Definition 'templates::Rte::RteGenerate(autosartoplevelstructure::AUTOSAR) for autosartoplevelstructure::AUTOSAR' found!
5339 ERROR WorkflowEngine - [ERROR]: No Definition 'templates::Rte::RteGenerate(autosartoplevelstructure::AUTOSAR) for autosartoplevelstructure::AUTOSAR' found!(Element: EXPAND templates::Rte::RteGenerate(model) FOR systemmodel; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692681 is a reply to message #1692678] |
Fri, 17 April 2015 10:47   |
Eclipse User |
|
|
|
for clear idea....i am sharing my reader and generator code
please suggest me if ant changes needed in that area....
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="systemmodel" />
<uri value="platform:/resource/${systemmodel}" />
<resourceSet idRef="myRS"/>
</component>
<component class="org.eclipse.emf.mwe.utils.Reader">
<modelSlot value="model" />
<uri value="platform:/resource/${model}" />
</component>
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm_emf"/>
<expand
value="templates::Rte::RteGenerate FOR systemmodel" />
|
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1692706 is a reply to message #1692704] |
Fri, 17 April 2015 12:11   |
Eclipse User |
|
|
|
E.g <<DEFINE RteGenerate(AUTOSAR model) FOR AUTOSAR>> or E.g <<DEFINE RteGenerate(EObject model) FOR EObject>> or <<DEFINE RteGenerate(List model) FOR List>> or <<DEFINE RteGenerate(ABC model) FOR DEF>> or ....
if your cased the damn error message says:
templates::Rte::RteGenerate(autosartoplevelstructure::AUTOSAR) for autosartoplevelstructure::AUTOSAR'
thus o what a great wonder it might be <<DEFINE RteGenerate(autosartoplevelstructure::AUTOSAR model) FOR autosartoplevelstructure::AUTOSAR>>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [XPAND] java.net.MalformedURLException: unknown protocol: ar [message #1693627 is a reply to message #1692736] |
Mon, 27 April 2015 05:57   |
Eclipse User |
|
|
|
HI,
continuation to above...
while i am calling one model elements within another model...i am trying to print <<model.eAllContents>> in this case i am getting the list of all the elements/modules, but when i am calling the modules(i.e «EXPAND RTEMODULE FOREACH AUTOSAR::EcucDefs::Rte» or «model.eAllContents.typeSelect(AUTOSAR::EcucDefs::Rte)») it is showing error "unknown type"...
6727 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component of type org.eclipse.xpand2.Generator:
EvaluationException : Unknown type 'AUTOSAR::EcucDefs::Rte'
[318,22] on line 9 'AUTOSAR::EcucDefs::Rte'
templates::Rte.xpt[919,49] on line 39 'EXPAND Rte_Type_H::include_Type_H(model) FOR this'
templates::Rte.xpt[172,24] on line 7 'EXPAND Rte_Type_H(model)'
[23,57] on line 1 'EXPAND templates::Rte::RteGenerate(model) FOR systemmodel'
6727 ERROR WorkflowEngine - Workflow interrupted. Reason: Unknown type 'AUTOSAR::EcucDefs::Rte'
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: model.eAllContents.typeSelect(AUTOSAR::EcucDefs::Rte); Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: EXPRESSION: model.eAllContents.typeSelect(AUTOSAR::EcucDefs::Rte); Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: include_Type_H(autosartoplevelstructure::AUTOSAR model) : autosartoplevelstructure::AUTOSAR; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: EXPAND Rte_Type_H::include_Type_H(model) FOR this; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: «FILE "Rte_Type.h"»...«ENDFILE»; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: Rte_Type_H(autosartoplevelstructure::AUTOSAR model) : autosartoplevelstructure::AUTOSAR; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: EXPAND Rte_Type_H(model); Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: RteGenerate(autosartoplevelstructure::AUTOSAR model) : autosartoplevelstructure::AUTOSAR; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
6727 ERROR WorkflowEngine - [ERROR]: Unknown type 'AUTOSAR::EcucDefs::Rte'(Element: EXPAND templates::Rte::RteGenerate(model) FOR systemmodel; Reported by: Generator: generating 'templates::Rte::RteGenerate(model) FOR systemmodel' => [APPEND:src-gen(overwrite=true,append=true,fileEncoding=Cp1252), src-gen/])
|
|
|
|