Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » trouble with this bug(IllegalArgumentException)
trouble with this bug [message #699657] Fri, 22 July 2011 02:48 Go to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
does anybody know how to fix this problem caused by the bug described here https://bugs.eclipse.org/bugs/show_bug.cgi?id=322758
i have been trapped by this problem for several days~~ now i am waiting on line for somebody to help sincerely:-) could anyone be helpful here?? thanks a lot~
Re: trouble with this bug [message #699661 is a reply to message #699657] Fri, 22 July 2011 03:12 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
additional remarks about above:
i meet the same problem which says: Diagnostic ERROR source=org.eclipse.m2m.qvt.oml.execution code=120 Unexpected runtime exception caught during execution data=[java.lang.IllegalArgumentException]
i am confused about this because my code is quite simple,so i can not find where the problem is. now i paste my code here and hope someone can help:-P
modeltype PIM 'strict' uses 'http:///PIM.ecore';
modeltype PSMInteraction 'strict' uses 'http:///PSMInteraction.ecore';
transformation InteractionTran(in inModel:PIM, out outModel:PSMInteraction);

main() {
inModel.objectsOfType(Role)-> map toPSMRole();
}

mapping PIM::Role::toPSMRole():PSMInteraction::Role
{
Name := self.Name;//when i run here (i this self.name attributes to bug) the program crashes
}


could anyone be helpful and give a direction for me?
Re: trouble with this bug [message #699731 is a reply to message #699661] Fri, 22 July 2011 08:00 Go to previous messageGo to next message
Eclipse User
Originally posted by: Koen Yskout

My first guess would be that the exception is not thrown by the
transformation, but by code from the PIM model. Is there any kind of
check on the validity of the name in there?


On 22/07/11 05:12, Cindy wrote:
> additional remarks about above:
> i meet the same problem which says: Diagnostic ERROR
> source=org.eclipse.m2m.qvt.oml.execution code=120 Unexpected runtime
> exception caught during execution data=[java.lang.IllegalArgumentException]
> i am confused about this because my code is quite simple,so i can not
> find where the problem is. now i paste my code here and hope someone can
> help:-P
> modeltype PIM 'strict' uses 'http:///PIM.ecore';
> modeltype PSMInteraction 'strict' uses 'http:///PSMInteraction.ecore';
> transformation InteractionTran(in inModel:PIM, out
> outModel:PSMInteraction);
>
> main() {
> inModel.objectsOfType(Role)-> map toPSMRole();
> }
>
> mapping PIM::Role::toPSMRole():PSMInteraction::Role
> {
> Name := self.Name;//when i run here (i this self.name attributes to
> bug) the program crashes
> }
>
>
> could anyone be helpful and give a direction for me?
Re: trouble with this bug [message #699736 is a reply to message #699731] Fri, 22 July 2011 08:15 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
First thank you for your reply~~ while i do have some validity on the pim.ecore but not on the name there~~ does this affact the result?
will it be the version of the m2m or something like this? actually , i download gmf here with all the m2m included ..
Re: trouble with this bug [message #699781 is a reply to message #699736] Fri, 22 July 2011 09:36 Go to previous messageGo to next message
Eclipse User
Originally posted by: Koen Yskout

The transformation code you provided is so simple that I would expect it
to work on any version... I tested it using a set of dummy models and it
works as expected, so the transformation code itself is OK.

I think it will be hard to find the cause for this without more
information. Can you find a strack trace somewhere with more details
about the exception?

On 22/07/11 10:15, Cindy wrote:
> First thank you for your reply~~ while i do have some validity on the
> pim.ecore but not on the name there~~ does this affact the result?
> will it be the version of the m2m or something like this? actually , i
> download gmf here with all the m2m included ..
Re: trouble with this bug [message #699866 is a reply to message #699781] Fri, 22 July 2011 13:59 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
hey the exception stack trace is as follows:
java.lang.IllegalArgumentException
at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(EcoreEvaluationEnvironment.java:226)
at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvaluationEnv.navigateProperty(QvtOperationalEvaluationEnv.java:198)
at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(EcoreEvaluationEnvironment.java:1)
at org.eclipse.ocl.EvaluationVisitorImpl.visitPropertyCallExp(EvaluationVisitorImpl.java:1925)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitPropertyCallExp(EvaluationVisitorDecorator.java:276)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitPropertyCallExp(QvtGenericEvaluationVisitor.java:271)
at org.eclipse.ocl.ecore.impl.PropertyCallExpImpl.accept(PropertyCallExpImpl.java:238)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVisitorImpl.java:353)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:341)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpImpl.accept(AssignExpImpl.java:404)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVisitorImpl.java:948)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:406)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpImpl.accept(ObjectExpImpl.java:176)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationBody(QvtOperationalEvaluationVisitorImpl.java:983)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingBody(QvtOperationalEvaluationVisitorImpl.java:569)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java:376)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBodyImpl.accept(MappingBodyImpl.java:122)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingOperation(QvtOperationalEvaluationVisitorImpl.java:732)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingOperation(QvtGenericEvaluationVisitor.java:386)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOperationImpl.accept(MappingOperationImpl.java:220)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.executeImperativeOperation(QvtOperationalEvaluationVisitorImpl.java:1613)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.doVisitOperationCallExp(QvtOperationalEvaluationVisitorImpl.java:638)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationCallExp(QvtOperationalEvaluationVisitorImpl.java:597)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluationVisitorImpl.java:587)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.java:381)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCallExpImpl.accept(MappingCallExpImpl.java:112)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitExpression(QvtOperationalEvaluationVisitorImpl.java:328)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:156)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitExpression(QvtGenericEvaluationVisitor.java:205)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtImperativeIteratorTemplate.evaluateResultTemplate(QvtImperativeIteratorTemplate.java:50)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtIterationTemplate.evaluate(QvtIterationTemplate.java:84)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitImperativeIterateExp(QvtOperationalEvaluationVisitorImpl.java:1338)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitImperativeIterateExp(QvtGenericEvaluationVisitor.java:475)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.ImperativeIterateExpImpl.accept(ImperativeIterateExpImpl.java:210)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationBody(QvtOperationalEvaluationVisitorImpl.java:983)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitEntryOperation(QvtOperationalEvaluationVisitorImpl.java:458)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitEntryOperation(QvtGenericEvaluationVisitor.java:485)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.EntryOperationImpl.accept(EntryOperationImpl.java:67)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.executeImperativeOperation(QvtOperationalEvaluationVisitorImpl.java:1613)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.runMainEntry(QvtOperationalEvaluationVisitorImpl.java:2126)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl$1.invoke(QvtOperationalEvaluationVisitorImpl.java:922)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.doVisitTransformation(QvtOperationalEvaluationVisitorImpl.java:896)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.execute(QvtOperationalEvaluationVisitorImpl.java:738)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTODebugEvaluator$DebugInterceptor.execute(QVTODebugEvaluator.java:491)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doExecute(InternalTransformationExecutor.java:196)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:171)
at org.eclipse.m2m.internal.qvt.oml.TransformationRunner.execute(TransformationRunner.java:176)
at org.eclipse.m2m.qvt.oml.debug.core.app.DebugTransformationRunner$2.execute(DebugTransformationRunner.java:109)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine.execute(QVTOVirtualMachine.java:225)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine.access$10(QVTOVirtualMachine.java:222)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine$1.run(QVTOVirtualMachine.java:212)
at java.lang.Thread.run(Unknown Source)


but i can not find anything useful here.. could you ?
Re: trouble with this bug [message #699886 is a reply to message #699781] Fri, 22 July 2011 14:39 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
hi could you tell me how did you set your m2m environment? maybe i could follow your setting and have a try again..Smile
Re: trouble with this bug [message #701029 is a reply to message #699886] Sun, 24 July 2011 13:21 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
And i find another wierd phenomenon that when i set Instance Type Name in the property of ecore model, i will get an error like above when i call self.Name in both run and debug mode; but when i unset Instance Type Name ,the method of objectsOfType() could not work anymore in debug mode while i could get a right result in run mode.. this is really wierd and i cannot figure out why.. could anyone give me some direction about this?

[Updated on: Mon, 25 July 2011 01:16]

Report message to a moderator

Re: trouble with this bug [message #701551 is a reply to message #699886] Mon, 25 July 2011 08:40 Go to previous messageGo to next message
Eclipse User
Originally posted by: Koen Yskout

Cindy,

It's probably not a matter of environment setup, but has something to do
with your model and/or model implementation. I tested with the simple
models below, i.e., only roles in the model, with a single attribute
'Name' of type string, and all other settings left to the default, which
worked perfectly well.

From the exception trace, the exception is trown by
EcoreEvaluationEnvironment.navigateProperty. This requires that the
target (i.e., the Role class in your case) is an EObject, and contains a
property 'Name'. Is this the case in your implementation? As I see in
another post that you have overridden the Instance Type Name, does your
implementation class still implement EObject?


## pim.ecore

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="pim"
nsURI="http://pim.ecore" nsPrefix="pim">
<eClassifiers xsi:type="ecore:EClass" name="Role">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>



## psm.ecore

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="psm"
nsURI="http://psm.ecore" nsPrefix="psm">
<eClassifiers xsi:type="ecore:EClass" name="Role">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>


On 22/07/11 16:39, Cindy wrote:
> hi could you tell me how did you set your m2m environment? maybe i could
> follow your setting and have a try again..:)
Re: trouble with this bug [message #701722 is a reply to message #701551] Mon, 25 July 2011 13:42 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
While in my case, role is a subclass of a more generalized class which has the attribute of Name, in which case i do think role has the same attribute of Name.
As for Instance Type Name, i set it to Role ,for example, for the class of Role in my ecore model ,but when i try to generate the model code i got many errors in the interface package... i donot know why.. should i make some implementation manually?

at last , i have a new question about the graphic transformation.. i mean does this qvto support graphic transformation ,ie, when i transform pim to psm can i get an graphic model of psm or only get a xml-format file...?

Thank you for all your attention really:-)
best wishes!
Re: trouble with this bug [message #702350 is a reply to message #701722] Tue, 26 July 2011 08:55 Go to previous messageGo to next message
Eclipse User
Originally posted by: Koen Yskout

On 25/07/11 15:42, Cindy wrote:
> While in my case, role is a subclass of a more generalized class which
> has the attribute of Name, in which case i do think role has the same
> attribute of Name.

That should be the case.

> As for Instance Type Name, i set it to Role ,for example, for the class
> of Role in my ecore model ,but when i try to generate the model code i
> got many errors in the interface package... i donot know why.. should i
> make some implementation manually?

As long as you get errors in the generated code, it's unlikely that the
transformation will work, so you should first fix those errors.

In general, you don't need to set the Instance Type Name attribute; a
Java class with the same name as your model element will be generated
automatically.

>
> at last , i have a new question about the graphic transformation.. i
> mean does this qvto support graphic transformation ,ie, when i transform
> pim to psm can i get an graphic model of psm or only get a xml-format
> file...?

Graphical representations of your models are not within scope of EMF nor
M2M. You could look at GEF, GMF or Graphiti for this.

>
> Thank you for all your attention really:-)
> best wishes!
Re: trouble with this bug [message #702453 is a reply to message #702350] Tue, 26 July 2011 11:49 Go to previous messageGo to next message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
hey Koen Yskout, I've made progress in this transformation work thanks to your help all the way . thank you very much!
as to the graphic transformation, i will refer to GMF for the solution..
however i am faced with new problems right now..
the problem I have is about flow transition in activity-alike diagram, for example ,i have an one to one transformation from PIM.ecore to PSM.ecore ..
in pim model , i have action a,b and flow c whose source is a and target b, now i can successfully transform a,b and c respectively to a1, b1 and c1, but i loss the relationship among them , ie i cannot make a1 to be c1's source and b1 target..

i failed to find a function in QVT to achieve this:-(
So do you have any idea how to realize this?
Re: trouble with this bug [message #703017 is a reply to message #702350] Wed, 27 July 2011 04:23 Go to previous message
Cindy  is currently offline Cindy
Messages: 59
Registered: May 2011
Member
i succeeded in doing this by late resolveoneIn() and resolveone() function.. thanks all the same..
kind of excited after trapped by these days:-)
however problems seem to never stop..
i created dynamic instance from the pim.ecore in which way i got an input.xmi as input of this transformation.. now i can transform the element from input.xmi to output.psm(psm is the modeltype of my output model).. but i got an different structure from the input,and the example as fllows:
input xmi format:
<role RoleName="role1">
<activity xsi:type="www.org.eclipse.PIM:Action" ActName="act1"/>
</role>

output psm format:

<cog CogName="role1">
<activity NodeName="act1"/>
</cog>

ie, i lost [xsi:type="www.org.eclipse.PIM:Action"] this type information.. i was supposed to have [xsi:type="www.org.eclipse.PSM:Node"] here..
do you know how to prevent this type loss..
Previous Topic:[QVTo] Debugging in a second eclipse instance
Next Topic:[XTend] Couldn' t resolve type for....
Goto Forum:
  


Current Time: Tue Oct 21 04:03:17 GMT 2014

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

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