You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Charles Moulliard (JIRA)" <ji...@apache.org> on 2015/10/27 08:22:27 UTC

[jira] [Commented] (CAMEL-9259) enableTrace of the Main class doesn't work

    [ https://issues.apache.org/jira/browse/CAMEL-9259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14975870#comment-14975870 ] 

Charles Moulliard commented on CAMEL-9259:
------------------------------------------

Fix required. Add the trace option if the boolean is true when the postProcess method is called

{code}
protected void postProcessContext() throws Exception {
        Map<String, CamelContext> map = getCamelContextMap();
        Set<Map.Entry<String, CamelContext>> entries = map.entrySet();
        int size = entries.size();
        for (Map.Entry<String, CamelContext> entry : entries) {
            String name = entry.getKey();
            CamelContext camelContext = entry.getValue();
{code}

> enableTrace of the Main class doesn't work
> ------------------------------------------
>
>                 Key: CAMEL-9259
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9259
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, el-core
>    Affects Versions: 2.15.3
>            Reporter: Charles Moulliard
>
> The enableTrace() method of the Camel Main class doesn't work.
> When we setup the code as such
> {code}
>     public static void main(String... args) throws Exception {
>         Main main = new Main();
>         main.enableHangupSupport();
>         main.addRouteBuilder(new MyRouteBuilder());
>         main.enableTrace();
>         main.run(args);
> {code}
> and launch the Main class, than the messages reported by the route in the log are not traced at all.
> If we debug, we can see that there is not CamelContext object when this method of the MainSupport class is called
> {code}
>     public void enableTrace() {
>         this.trace = true;
>         for (CamelContext context : camelContexts) { // EMPTY
>             context.setTracing(true);
>         }
>     }
> {code}
> The workaround is to enable the tracing within the route definition
> {code}
>     public void configure() {
>         getContext().setTracing(true);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)