Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to debug java extensions?
icon5.gif  How to debug java extensions? [message #511854] Wed, 03 February 2010 09:04 Go to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Hi,

I had to add quite a lot of java code to my Xpand project to manipulate the model before output generation and to facilitate processing while output generation. My problem is the debugging does not work for a workflow, therefore not for Xpand, and not for the java extensions called.

Not even a stack trace shows useable information since it does not go below the level of Xpand declarations. So if e.g. my extension throws a NullPointerException in the third sub routine I get no information where it happened and how it got there.

Is there a way to overcome this shortcoming?

Best regards,
Marco
Re: How to debug java extensions? [message #511889 is a reply to message #511854] Wed, 03 February 2010 10:31 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
There's a 'java debug' flag in the workflow launch configuration, which
you need to enable.

Sven


arco schrieb:
> Hi,
>
> I had to add quite a lot of java code to my Xpand project to manipulate
> the model before output generation and to facilitate processing while
> output generation. My problem is the debugging does not work for a
> workflow, therefore not for Xpand, and not for the java extensions called.
>
> Not even a stack trace shows useable information since it does not go
> below the level of Xpand declarations. So if e.g. my extension throws a
> NullPointerException in the third sub routine I get no information where
> it happened and how it got there.
>
> Is there a way to overcome this shortcoming?
>
> Best regards,
> Marco


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: How to debug java extensions? [message #512075 is a reply to message #511889] Wed, 03 February 2010 19:48 Go to previous messageGo to next message
Marco  is currently offline Marco Friend
Messages: 216
Registered: August 2009
Senior Member
Sven, thanks for the advice. Now my code can be traced in the debugger.

But still there is no hint where an exception was thrown. The top line of the stack trace just names the extension without information what happened below.

How can I best track down such problems?

br
m
Re: How to debug java extensions? [message #512219 is a reply to message #512075] Thu, 04 February 2010 12:40 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
I consider it a bug, that exceptions thrown in Java extensions are not
logged properly (please file a bugzilla).

Is that what you're are missing?

Sven

Marco schrieb:
> Sven, thanks for the advice. Now my code can be traced in the debugger.
>
> But still there is no hint where an exception was thrown. The top line
> of the stack trace just names the extension without information what
> happened below.
>
> How can I best track down such problems?
>
> br
> m


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: How to debug java extensions? [message #512260 is a reply to message #512219] Thu, 04 February 2010 09:26 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
You'll have to call it by its qualified name.
<<EXPAND my::path::TemplateFile::plop FOR this.onePlop>>

Sven

Sven Efftinge schrieb:
> I consider it a bug, that exceptions thrown in Java extensions are not
> logged properly (please file a bugzilla).
>
> Is that what you're are missing?
>
> Sven
>
> Marco schrieb:
>> Sven, thanks for the advice. Now my code can be traced in the debugger.
>>
>> But still there is no hint where an exception was thrown. The top line
>> of the stack trace just names the extension without information what
>> happened below.
>>
>> How can I best track down such problems?
>>
>> br
>> m
>
>


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: How to debug java extensions? [message #512262 is a reply to message #512260] Thu, 04 February 2010 09:26 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Sorry wrong thread :-)

Sven Efftinge schrieb:
> You'll have to call it by its qualified name.
> <<EXPAND my::path::TemplateFile::plop FOR this.onePlop>>
>
> Sven
>
> Sven Efftinge schrieb:
>> I consider it a bug, that exceptions thrown in Java extensions are not
>> logged properly (please file a bugzilla).
>>
>> Is that what you're are missing?
>>
>> Sven
>>
>> Marco schrieb:
>>> Sven, thanks for the advice. Now my code can be traced in the debugger.
>>>
>>> But still there is no hint where an exception was thrown. The top
>>> line of the stack trace just names the extension without information
>>> what happened below.
>>>
>>> How can I best track down such problems?
>>>
>>> br
>>> m
>>
>>
>
>


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:Neebee question: XMLBeautifier
Next Topic:[Xpand] Advices not applied
Goto Forum:
  


Current Time: Fri Apr 19 23:10:39 GMT 2024

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

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

Back to the top