2 Replies Latest reply on Nov 20, 2012 10:36 PM by Serge Vilvovsky

    Debug Camel spring application in Eclipse

    Serge Vilvovsky Newbie

      Could you tell me, please, how I can debug the camel application in eclipse?

       

      I can run it from command line using "mvn camel:run" or from eclipse using "RunAs ... -> Maven build", but now need to work with breakpoints.

       

      If its not supported, could you tell me, how to debug it remotely within Fuse ESB?

       

      Thank you!

        • 1. Re: Debug Camel spring application in Eclipse
          Freeman(Yue) Fang Master

          Hi,

           

          For the remote way, in the term where you start FUSE ESB, do

          export KARAF_DEBUG=true

          then you can debug FUSE ESB in eclipse with remote port 5005.

           

          I also believe you can debug your camel application directly in eclipse, but if you wanna it same as a OSGi container, you may need use pax-exam-karaf to write your test.

           

          Freeman

          • 2. Re: Debug Camel spring application in Eclipse
            Serge Vilvovsky Newbie

            Thank you. The way that I found is running the spring env using the next function:

             

            public void startWorkflow() {

                    parent = new FileSystemXmlApplicationContext("src/main/resources/META-INF/spring/camel-context.xml");

                    GenericXmlApplicationContext gac = new GenericXmlApplicationContext();

                    gac.setParent(parent);

                    CamelContext context = null;

                    gac.refresh();

                     

                    try {

                         Thread.sleep(1000000);

                    }

                    catch (InterruptedException ignore) {

                          

                    }

                }