Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Problems with blackboxing
[QVTO] Problems with blackboxing [message #84761] Thu, 19 June 2008 06:14 Go to next message
Eclipse UserFriend
Originally posted by: stenzel.informatik.uni-augsburg.de

Hi Radek,

I tried to use the blackboxing example that you gave in this newsgroup,
but it doesn't work for me. The QVT editor/compiler can load the library,
and shows the type of the dumpErr method correctly as

dumpErr(String : String) : oclstdlib::OclAny - oclstdlib::OclAny

However, when I run the transformation I get a NullPointerException in
org.eclipse.m2m.internal.qvt.oml.ocl.transformations.Library OperationImpl.isMethodApplicable(LibraryOperationImpl.java:1 44)

(complete stack trace below). Do you have any idea what could be wrong?
I also tried to create a library method without invoking argument (with
OclVoid), but I couldn't load the library. No matter what I tried I got an
ArrayIndexOutOfBoundsException (perhaps related to argument parsing). Can
you give an example how it should work?

Thanks in advance,

Kurt
Re: [QVTO] Problems with blackboxing [message #84776 is a reply to message #84761] Thu, 19 June 2008 06:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stenzel.informatik.uni-augsburg.de

... and here the stack trace ... (btw. I using build 1.0.0RC4a)

java.lang.NullPointerException
at
org.eclipse.m2m.internal.qvt.oml.ocl.transformations.Library OperationImpl.isMethodApplicable(LibraryOperationImpl.java:1 44)
at
org.eclipse.m2m.internal.qvt.oml.ocl.transformations.Library OperationImpl.run(LibraryOperationImpl.java:74)
at
org.eclipse.m2m.internal.qvt.oml.stdlib.LegacyNativeLibSuppo rt.callOperation(LegacyNativeLibSupport.java:105)
at
org.eclipse.m2m.internal.qvt.oml.stdlib.LegacyNativeLibSuppo rt.access$0(LegacyNativeLibSupport.java:83)
at
org.eclipse.m2m.internal.qvt.oml.stdlib.LegacyNativeLibSuppo rt$Handler.invoke(LegacyNativeLibSupport.java:78)
at
org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvalu ationEnv.callOperation(QvtOperationalEvaluationEnv.java:158)
at
org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.callOperati on(EcoreEvaluationEnvironment.java:1)
at
org.eclipse.ocl.internal.evaluation.EvaluationVisitorImpl.vi sitOperationCallExp(EvaluationVisitorImpl.java:184)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.doVisitOperationCallExp(QvtOperationalEva luationVisitorImpl.java:486)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitOperationCallExp(QvtOperationalEvalu ationVisitorImpl.java:441)
at
org.eclipse.ocl.EvaluationVisitorDecorator.visitOperationCal lExp(EvaluationVisitorDecorator.java:269)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitOperationCallExp(QvtGenericEvaluationVisitor .java:240)
at
org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(Opera tionCallExpImpl.java:359)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingBody(QvtOperationalEvaluation VisitorImpl.java:393)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java :347)
at
org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBod yImpl.accept(MappingBodyImpl.java:120)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitMappingOperation(QvtOperationalEvalu ationVisitorImpl.java:542)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitMappingOperation(QvtGenericEvaluationVisitor .java:355)
at
org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOpe rationImpl.accept(MappingOperationImpl.java:164)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.executeImperativeOperation(QvtOperational EvaluationVisitorImpl.java:1284)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.doVisitModule(QvtOperationalEvaluationVis itorImpl.java:590)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEva luationVisitorImpl.visitModule(QvtOperationalEvaluationVisit orImpl.java:548)
at
org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluat ionVisitor.visitModule(QvtGenericEvaluationVisitor.java:363)
at
org.eclipse.m2m.internal.qvt.oml.expressions.impl.ModuleImpl .accept(ModuleImpl.java:568)
at
org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre tedTransformation.evaluate(QvtInterpretedTransformation.java :160)
at
org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpre tedTransformation.run(QvtInterpretedTransformation.java:105)
at
org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega teBase.java:195)
at
org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegateBase.doLaunch(QvtLaunchConfigurationDelega teBase.java:144)
at
org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegate$1.run(QvtLaunchConfigurationDelegate.java :64)
at
org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$Sa meThreadRunner.run(SafeRunner.java:38)
at
org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$1. run(SafeRunner.java:27)
at
org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces s.run(ShallowProcess.java:41)
at
org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProces s.run(ShallowProcess.java:32)
at
org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchCon figurationDelegate$3.run(QvtLaunchConfigurationDelegate.java :95)
at java.lang.Thread.run(Thread.java:619)
Re: [QVTO] Problems with blackboxing [message #84790 is a reply to message #84761] Thu, 19 June 2008 13:33 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Kurt,

Unfortunately, there is nothing that you do wrong, but we do.
You have found a bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D23=
7781

The problem appears if the return type is OclAny, OclVoid.
See the java lib example bellow to support your usecase.
It just gets arround this by using a correctly handled return type and
may be called like bellow.

main {
dumpError('HELP!!!!');
}

.....

public class HelperLibrary {
=

public Boolean dumpError(String argStr) {
System.err.println(argStr);
return Boolean.TRUE;
}
=

public static class Metainfo {
/**
* array[0] - Context classifier
* array[n] - Classifier corresponds to the n-th operation =
=

parameter
* array[n+1] - Return type classifier
*/ =

private static final String[] DUMP_ERROR_INFO =3D new String[] =
{
"oclstdlib::OclVoid", // Void context -> module owned =

(context-less) operation
// imported library module is the =

implicit source object of the call
"oclstdlib::String", // your string argument
"oclstdlib::Boolean" // return type
};
=

public static final String[] dumpError(String str) {
return DUMP_ERROR_INFO;
}
}

Regards,
/Radek


On Thu, 19 Jun 2008 08:14:50 +0200, Kurt Stenzel =

<stenzel@informatik.uni-augsburg.de> wrote:

> Hi Radek,
>
> I tried to use the blackboxing example that you gave in this newsgroup=
,
> but it doesn't work for me. The QVT editor/compiler can load the libra=
ry,
> and shows the type of the dumpErr method correctly as dumpErr(String :=
=

> String) : oclstdlib::OclAny - oclstdlib::OclAny
>
> However, when I run the transformation I get a NullPointerException in=

> org.eclipse.m2m.internal.qvt.oml.ocl.transformations.Library OperationI=
mpl.isMethodApplicable(LibraryOperationImpl.java:144)
>
> (complete stack trace below). Do you have any idea what could be wrong=
?
> I also tried to create a library method without invoking argument (wit=
h =

> OclVoid), but I couldn't load the library. No matter what I tried I go=
t =

> an
> ArrayIndexOutOfBoundsException (perhaps related to argument parsing). =
Can
> you give an example how it should work?
>
> Thanks in advance,
>
> Kurt
>



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [QVTO] Problems with blackboxing [message #84928 is a reply to message #84790] Mon, 23 June 2008 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stenzel.informatik.uni-augsburg.de

Hi Radek,

thanks for your help. Now my method is called. However, System.out and
System.err seem to be directed somewhere. At least my output does not
appear on the Console.

Thanks again,

Kurt
Re: [QVTO] Problems with blackboxing [message #84942 is a reply to message #84928] Mon, 23 June 2008 11:36 Go to previous message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Kurt,

Sorry, If I confused you a bit here, System.err was just a simple example
and
I assumed you would have a specific redirection of the output.

If you are OK with using the default console of your running launch
configuration,
you could use the standard QVT log expression. See the example bellow:


helper dumpError(in msg : String) : OclVoid {
log('[ERROR] ' + msg); -- std QVT log expression
}

mapping UML::Model::model2RsdsdDBModel() : RDB::Model {
init {
dumpError('My error message...');

}
}


The code above causes the following output in the console associated with
your QVT launch configuration.

[ERROR] My error message...



So far, we do not provide any access to a QVT dedicated console but you
still can add your own console implementation
to be used by your error reporting written in Java.
For sure, we plan to implement a better support for console logging after
Ganymede release.

Regards,
/Radek



On Mon, 23 Jun 2008 12:20:15 +0200, Kurt Stenzel
<stenzel@informatik.uni-augsburg.de> wrote:

> Hi Radek,
>
> thanks for your help. Now my method is called. However, System.out and
> System.err seem to be directed somewhere. At least my output does not
> appear on the Console.
>
> Thanks again,
>
> Kurt
>
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Previous Topic:[ATL] parameterizing metamodel elements
Next Topic:[ATL] java.lang.ClassCastException while running transformation
Goto Forum:
  


Current Time: Thu Apr 25 04:33:54 GMT 2024

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

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

Back to the top