Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [acceleo] debug java code in "Acceleo Plug-in Application"
[acceleo] debug java code in "Acceleo Plug-in Application" [message #756852] Tue, 15 November 2011 10:58 Go to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Hello,

I have some problems with package registration, and I would like to debug the java code running as "Acceleo Plug-in Application".

The problem is that the debugger does not stop on the breakpoints set in java code, but only at the ones set in mtl files.

Is there a way to debug java code in "Acceleo Plug-in Application" configuration ?


Second issue - I've tried to run as Java Application, but i get "ClassNotFound" exceptions (for com.google.common.Predicate).

I've looked at tasks/generate.xml, and indeed com.google.collect jar is not listed there. Is that an error ?

Is tasks/generate.xml used for Java App only, or also for the stand-alone app ?


Regards,
Vlad Gheorghe



Re: [acceleo] debug java code in "Acceleo Plug-in Application" [message #757660 is a reply to message #756852] Mon, 21 November 2011 08:08 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Vlad,

Sorry for the delay with this answer.

The generate.xml file is not used for the "java application" launches. This "ClassNotFound" seem like a regression to me, but I could be wrong. I'll try and launch a standalone generation to see whether com.google.* package are properly retrieved on my end.

As for debugging, debugging the java code behind the generators can only be done if you launch a new Eclipse instance in debug and launch the generation from there. i.e :

a- Select the Run > Debug configurations... menu
b- Double-click "Eclipse application" (or select an existing Eclipe application), then hit "Debug"
c- From the new Eclipse, use File > Import
d- Select "Existing Projects into Workspace" and browse to your generator project
e- With the project imported, launch the generation from there. The runtime should stop on the breakpoints set in your first Eclipse.

Alternatively, you could use an Acceleo UI application in order not to import your project in the second Eclipse :

a- Select File > New... and select "Acceleo UI Launcher project" and follow the wizard for your generator.
b- Select the Run > Debug configurations... menu
c- Double-click "Eclipse application" (or select an existing Eclipe application), then hit "Debug"
d- In the new Eclipse, create the model that will be the input of your generation
e- Right-click the input model and select Acceleo > <name of your generator>

Laurent Goubet
Obeo
Re: [acceleo] debug java code in "Acceleo Plug-in Application" [message #757665 is a reply to message #757660] Mon, 21 November 2011 08:34 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Vlad,

The ClassNotFoundException is indeed a regression :s. I have tracked bug 364265 for it.

Seems like an API break we did not foresee when we decided to depend on google Guava. We'll most likely have to reexport this dependency from the Acceleo core in order not to break all previously existing generators.

Laurent Goubet
Obeo
Re: [acceleo] debug java code in "Acceleo Plug-in Application" [message #758360 is a reply to message #757665] Tue, 22 November 2011 21:23 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Hi Laurent,

Thank you for the answers.

I knew about the second variant you propose - run via Acceleo UI plugin in a debug target instance.

But it's still not clear to me what "Acceleo Plug-in Application" really does.
Does it run the acceleo engine in the *same* eclipse instance (the development instance) ?
(This is what I can deduce from the first variant that you describe).

If it is so, it follows that if
- I have a metamodel in the workspace
- I have an Acceleo generator plugin in the same workspace
- I run the generator as "Acceleo Plug-in Application" on a model also from the workspace
then the dynamic version of the metamodel is used during the generation.

Is that correct ?

Another question - you have told me that generate.xml is not used for "java application" launches.
What is it used for then ?
( Is it used as back-end of the Acceleo Plug-in app, or just as an alternate to Launch as "Acceleo plug-in App", using ant ?)

Best regards,
Vlad Gheorghe

[Updated on: Tue, 22 November 2011 21:24]

Report message to a moderator

Re: [acceleo] debug java code in "Acceleo Plug-in Application" [message #758495 is a reply to message #758360] Wed, 23 November 2011 13:05 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Acceleo Plug-in Application runs the Acceleo generator in the current Eclipse instance while Java Application runs the Acceleo generator as a stand alone Java application using the dependencies available in Eclipse (for example we are linking the generator to the jars of EMF for you but otherwise it's a stand alone launch). The generate.xml file is used for a stand alone launch from Ant (it is a bit more subtle then the Java launch since the dependencies are resolved to the real position of the needed jars).

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [acceleo] debug java code in &quot;Acceleo Plug-in Application&quot; [message #758568 is a reply to message #758495] Wed, 23 November 2011 17:32 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7676
Registered: July 2009
Senior Member
Hi Stephane

Thanks for the explanation; now I understand why I was confused. The use
of 'Plugin' is different to a JUnit Plugin launch in which all the
projects in the current workspace are available. I suggest using a
description that avoids this different use of 'Plugin'.

Potentially there could be 3 useful launches called:

a) Local Launch (currently called Plugin)
b) Standalone launch analuguous to JUnit launch
c) Plugin launch analoguous to JUnit Plugin launch (not currently available)

Regards

Ed Willink

On 23/11/2011 13:05, Stephane Begaudeau wrote:
> Hi,
>
> Acceleo Plug-in Application runs the Acceleo generator in the current
> Eclipse instance while Java Application runs the Acceleo generator as
> a stand alone Java application using the dependencies available in
> Eclipse (for example we are linking the generator to the jars of EMF
> for you but otherwise it's a stand alone launch). The generate.xml
> file is used for a stand alone launch from Ant (it is a bit more
> subtle then the Java launch since the dependencies are resolved to the
> real position of the needed jars).
>
> Regards,
>
> Stephane Begaudeau, Obeo
>
> --
> Twitter: http://twitter.com/#!/sbegaudeau
> Google+: http://www.google.com/profiles/stephane.begaudeau
> Blog: http://stephanebegaudeau.tumblr.com
> Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Previous Topic:[acceleo 3.2] Don't understand the error/problem with a simple query modification
Next Topic:[Acceleo 3.1.2][resolved] Custom code lost in some protected area
Goto Forum:
  


Current Time: Wed Oct 09 22:43:39 GMT 2024

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

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

Back to the top