Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works
[Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694088] Thu, 07 July 2011 19:15 Go to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
I need to lauch an Acceleo transformation from my own Plugin in Eclipse, but this does not work, it fails to produce output. There are no error messages on the console.

Interestingly the same transformation works in other setups, which I describe in the following:

When I launch Acceleo from the UI, it runs perfectly as Java Application, but not as Acceleo Plugin (fails to produce output, no message in the Console).
When I launch Acceleo programmatically from a POJO Java Application it works.
When I launch Acceleo programmatically from my own Plugin in Eclipse it does not work (fails to produce output, no message in the Console).

How do I get it to work?
Where could be the problem?

Thanks,
Matt
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694096 is a reply to message #694088] Thu, 07 July 2011 19:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Matt

You might have a case of meta-model schizophrenia; the same meta-model
loaded twice, so the transformation fails to match EClasses.

If you have any of your meta-models installed as plugins and loaded as
projects, try closing the projects.

Regards

Ed Willink

On 07/07/2011 20:15, Matt Biehl wrote:
> I need to lauch an Acceleo transformation from my own Plugin in
> Eclipse, but this does not work, it fails to produce output. There are
> no error messages on the console.
>
> Interestingly the same transformation works in other setups, which I
> describe in the following:
>
> When I launch Acceleo from the UI, it runs perfectly as Java
> Application, but not as Acceleo Plugin (fails to produce output, no
> message in the Console).
> When I launch Acceleo programmatically from a POJO Java Application it
> works. When I launch Acceleo programmatically from my own Plugin in
> Eclipse it does not work (fails to produce output, no message in the
> Console).
> How do I get it to work? Where could be the problem?
>
> Thanks,
> Matt
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694267 is a reply to message #694096] Fri, 08 July 2011 08:33 Go to previous messageGo to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
Thanks! I have tried it without success. I removed the installed metamodel plugin, so I only have the metamodel as a project in my workspace. That did not make a difference.

How can one debug "metamodel schizophrenia"? I used MODISCO, but there is only one metamodel with the relevant URI identifier loaded.

Maybe the problem is another one?

Any tips?
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694328 is a reply to message #694267] Fri, 08 July 2011 10:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Sometimes you can spot metamodel schizophrenia just be carefully reading
every single one of your URIs usages and seeing whether you have a
dangerous mix of
'http://....
'platform:/resource/....
'platform:/plugin/....
'file:/c:/....
'../../....
that not all tools will always recognize as synonyms. However you
usually miss one of your declarations so there is no substitute for
running As Java Application so that you can use the debugger to identify
the point at which two 'identical' classes are not identical. If you're
not familiar with the Acceleo or OCL code, I recommend using a Query
that invokes some Java code just before the problem so that you can set
a breakpoint on that Java code, possibly with useful arguments, but at
any rate allowing you to single step from somewhere close. Remember that
you are looking for a pair of EClasses with the same name and different
object ids. Tracing up the containment hierarchy will find the packages
and resource they came from and suddenly the URI stupidity is obvious.
NB eResource containment is in eStorage or eProperties, and that plugged
in Resources have no ResourceSet.

Regards

Ed Willink

On 08/07/2011 09:33, Matt Biehl wrote:
> Thanks! I have tried it without success. I removed the installed
> metamodel plugin, so I only have the metamodel as a project in my
> workspace. That did not make a difference.
>
> How can one debug "metamodel schizophrenia"? I used MODISCO, but there
> is only one metamodel with the relevant URI identifier loaded.
> Maybe the problem is another one?
>
> Any tips?
>
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694583 is a reply to message #694328] Fri, 08 July 2011 22:16 Go to previous messageGo to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
Hi Ed,

First, thanks for your answer. I am not sure I understood what piece of code I am supposed to debug.

Here is my attempt: I first looked at what goes wrong in (1) Plugin mode and then found the corresponding correct execution in (2) Java mode. Both test runs use the same input model and mtl transformation file.

The problem occurs in AcceleoService.doGenerate(..) when checking if the argumentType is an instance of the model. The if-test fails in (1) and succeeds in (2). In (1) the argumentType has a lot of null-Pointers and in (2) it is populated. Pictures showing the variables in debug mode are attached.

What can I learn from this? What do I need to change to make case (1) work?

Thanks,
Matt
  • Attachment: case (1).png
    (Size: 140.46KB, Downloaded 241 times)
  • Attachment: case (2).png
    (Size: 144.15KB, Downloaded 272 times)
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694670 is a reply to message #694583] Sat, 09 July 2011 06:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Matt

You've got close to the right point. You need to check whether
model.eClass() has argumentType in int inheritance. Single stepping
isInstance will do this for you.

However, I don't fully understand your comments. It seems that after
switching to Java Application launch the problem went away anyway. If so
this is clearly a bug, which may have already been reported. I only use
Java Application mode; perhaps this is one reason why.

Regards

Ed Willink


On 08/07/2011 23:16, Matt Biehl wrote:
> Hi Ed,
>
> First, thanks for your answer. I am not sure I understood what piece of code I am supposed to debug.
>
> Here is my attempt: I first looked at what goes wrong in (1) Plugin mode and then found the corresponding correct execution in (2) Java mode. Both test runs use the same input model and mtl transformation file.
>
> The problem occurs in AcceleoService.doGenerate(..) when checking if the argumentType is an instance of the model. The if-test fails in (1) and succeeds in (2). In (1) the argumentType has a lot of null-Pointers and in (2) it is populated. Pictures showing the variables in debug mode are attached.
>
> What can I learn from this? What do I need to change to make case (1) work?
>
> Thanks,
> Matt
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694709 is a reply to message #694670] Sat, 09 July 2011 12:01 Go to previous messageGo to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
Thanks!

You write that you dont fully understand my comments ... The big picture is the following: I am developing a plugin, which amongst other things, also calls an acceleo transformation. I am using the Java Code supplied with the acceleo project (Generate.java) to programmatically call the transformation. When this code is embedded in my plugin, no output is produced. Now when I run this exact same code (Generate.java) as java standalone, it works.


I am referring to AcceleoService.doGenerate(), and the line if (argumentType.isInstance(model))

I have continued debugging isInstance(): the problem is that all attributes of argumentType are null (so I cannot find which resource it belongs to). The model and its eClass seem to be ok.

When I run the same code as java, the attributes of argumentType are not-null.

I have also tried the same thing with another "self-made" metamodel with the same result.

Do I create my metamodels wrong? Is there some plugin conflict?

Thanks,
Matt

Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694715 is a reply to message #694709] Sat, 09 July 2011 12:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It sounds as if you have an unresolved proxy. The eStorage/eProperties
should tell you what wasn't resolved and so what you should help Acceleo
with by defining it in your registerPackages in your main Java file.

Regards

Ed Willink


On 09/07/2011 13:01, Matt Biehl wrote:
> Thanks!
>
> You write that you dont fully understand my comments ... The big
> picture is the following: I am developing a plugin, which amongst
> other things, also calls an acceleo transformation. I am using the
> Java Code supplied with the acceleo project (Generate.java) to
> programmatically call the transformation. When this code is embedded
> in my plugin, no output is produced. Now when I run this exact same
> code (Generate.java) as java standalone, it works.
>
>
> I am referring to AcceleoService.doGenerate(), and the line if
> (argumentType.isInstance(model))
> I have continued debugging isInstance(): the problem is that all
> attributes of argumentType are null (so I cannot find which resource
> it belongs to). The model and its eClass seem to be ok.
>
> When I run the same code as java, the attributes of argumentType are
> not-null.
>
> I have also tried the same thing with another "self-made" metamodel
> with the same result.
>
> Do I create my metamodels wrong? Is there some plugin conflict?
>
> Thanks,
> Matt
>
>
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #694909 is a reply to message #694715] Sun, 10 July 2011 07:47 Go to previous messageGo to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
Hi,

I tried that. I register the package in Generate.registerPackages(). The registered package has the same URI as the unresolved proxy.

Maybe this issue is related to Bug 335764 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=335764)?


Best Regards,
Matt
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #695013 is a reply to message #694909] Sun, 10 July 2011 17:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Matt

335764 was about finding too much, so I don;t think it's your problem,
but you could try both binary and ASCII EMTL to see if it helps.

You may think "The registered package has the same URI as the unresolved
proxy" but even when no magic typos are involved that is still only part
of the story. If there is indeed an unresolved proxy, there is no
substitute for single stepping the EcoreUtil.resolveProxy failure to get
an insight into what actually failed.

URI bugs, although usually user errors, are too common and too difficult
to improve. Acceleo 3.1 has significantly improved but as Bug 335764
indicates a Microsoft-style help 90% of the time but hinder 10% of the
time is no substitute for a sound documrnted resolution algorithm with
assoiciated diagnosis capabilities.

Today, you have to be an expert on debugging EcoreUtil.resolveProxy to
make progress on these issues. The Indigo implementation is slightly
restructured to eliminate a redundant recursion and facilitate debugging.

Regards

Ed Willink


On 10/07/2011 08:47, Matt Biehl wrote:
> Hi,
>
> I tried that. I register the package in Generate.registerPackages().
> The registered package has the same URI as the unresolved proxy.
>
> Maybe this issue is related to Bug 335764
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=335764)?
>
>
> Best Regards,
> Matt
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #695260 is a reply to message #695013] Mon, 11 July 2011 11:45 Go to previous messageGo to next message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
I debugged the proxy resolution.

There is a problem in
org.eclipse.acceleo.common.internal.utils.workspace.BundleURLConverter, line 194:
access to segments[pathStart] is out of bounds (see the attached screenshot).

This fails silently, due to an empty catch (RuntimeException exception) in EcoreUtil.resolve().

This problem seems to be not specific to my particular transformation/metamodel/setup. Any ideas for a workaround?

index.php/fa/3320/0/
  • Attachment: scrshot.png
    (Size: 124.23KB, Downloaded 953 times)
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #695361 is a reply to message #695260] Mon, 11 July 2011 14:51 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Matt,

Could you open a bug with your screenshot and reference to this forum
thread ?
We will have a look.
Thanks,

Regards,

Mariot

Le 11/07/2011 13:45, Matt Biehl a écrit :
> I debugged the proxy resolution.
>
> There is a problem in
> org.eclipse.acceleo.common.internal.utils.workspace.BundleURLConverter, line 194:
> access to segments[pathStart] is out of bounds (see the attached screenshot).
>
> This fails silently, due to an empty catch (RuntimeException exception) in EcoreUtil.resolve().
>
> This problem seems to be not specific to my particular transformation/metamodel/setup. Any ideas for a workaround?
>
>
>


--
Mariot Chauvin @ Obeo

Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
Re: [Acceleo] Launch as Acceleo Plugin does not work but Java Runner works [message #695397 is a reply to message #695361] Mon, 11 July 2011 16:38 Go to previous message
Matt Biehl is currently offline Matt BiehlFriend
Messages: 9
Registered: May 2011
Junior Member
Thanks,

posted as Bug 351733 https://bugs.eclipse.org/bugs/show_bug.cgi?id=351733

Best Regards,
/Matt
Previous Topic:Import different Toolchains in Eclipse
Next Topic:Webinar on Xtext 2.0
Goto Forum:
  


Current Time: Thu Mar 28 10:52:46 GMT 2024

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

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

Back to the top