You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by raulvk <ra...@gmail.com> on 2008/04/09 11:22:49 UTC

Debugging ServiceMix source code - breakpoints?

Hi all,

I have downloaded and successfully built ServiceMix's code from trunk. I am
running it inside Eclipse. In fact I have managed to boot up the the
file-binding example that you suggest in your "Importing ServiceMix into
Eclipse" wiki page (it's a static configuration file).

My intention is to observe how ServiceMix works behind the curtains, by
setting the appropriate breakpoints in the code and stepping through it.
However, I am finding that most of the starting up work is done within the
following method call inside the Main class:

                context = new FileSystemXmlApplicationContext(file,
processors);

I'd like to see two things:
  - How the startup process works? --> for this, I imagine I need to
download the source code of Spring and XBean, to get visibility into what
happens within the above method call.
  - How ServiceMix operates after the startup process? --> for this, I try
setting breakpoints all over the code of servicemix-file, but the execution
never pauses, perhaps because the code actually executes inside newly
spawned threads? Where should I set the breakpoints to see this in action?

I am unsure as to whether this is actually an Eclipse question rather than a
pure ServiceMix one, but since you guys debug ServiceMix code (possibly in
Eclipse) I've figured out you could give me a hand.

Many thanks,

Raul.

Re: Debugging ServiceMix source code - breakpoints?

Posted by Guillaume Nodet <gn...@gmail.com>.
On Wed, Apr 9, 2008 at 11:22 AM, raulvk <ra...@gmail.com> wrote:

> Hi all,
>
> I have downloaded and successfully built ServiceMix's code from trunk. I
> am
> running it inside Eclipse. In fact I have managed to boot up the the
> file-binding example that you suggest in your "Importing ServiceMix into
> Eclipse" wiki page (it's a static configuration file).
>
> My intention is to observe how ServiceMix works behind the curtains, by
> setting the appropriate breakpoints in the code and stepping through it.
> However, I am finding that most of the starting up work is done within the
> following method call inside the Main class:
>
>                context = new FileSystemXmlApplicationContext(file,
> processors);
>
> I'd like to see two things:
>  - How the startup process works? --> for this, I imagine I need to
> download the source code of Spring and XBean, to get visibility into what
> happens within the above method call.


ServiceMix container initialization is done in the SpringJBIContainer class
(and its parent, JBIContainer).  There is a init and a start method where
you can put breakpoints.

Btw, if you run "mvn eclipse:eclipse -DdownloadSources=true", maven should
download all the available code (spring, xbean and all) and associate it so
that debugging will be much easier

>
>  - How ServiceMix operates after the startup process? --> for this, I try
> setting breakpoints all over the code of servicemix-file, but the
> execution
> never pauses, perhaps because the code actually executes inside newly
> spawned threads? Where should I set the breakpoints to see this in action?


Yeah, lots of threads are created, but it should not prevent the debugger
from pausing when it hits a breakpoint.  You should add breakpoints in the
FileEndpoint class, which should be called by a timer.


>
>
> I am unsure as to whether this is actually an Eclipse question rather than
> a
> pure ServiceMix one, but since you guys debug ServiceMix code (possibly in
> Eclipse) I've figured out you could give me a hand.
>
> Many thanks,
>
> Raul.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/