You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Jakob Thun <ja...@gmail.com> on 2015/03/29 15:13:10 UTC

Possible defect in camel-cxf with spring-boot?

Hello,

I get a NullPointerException when using log-level INFO or finer in a
spring-boot application with CXF. 

I have made an example project to reproduce the strange behaviour, it has
more detailed explanation in the readme:
https://github.com/jakobthun/spring-boot-camel-cxf-logging-bug

I am not sure if I am doing something wrong when setting up the Camel or the
CXF component, but the route and service works just fine when logging is set
to WARN. So I hope I am doing things right.

If there is something I am doing wrong there might be room for some more
detailed error handling/description to indicate what has been missed.

Thanks for the awesome software!

Regards,
Jakob Thun



--
View this message in context: http://camel.465427.n5.nabble.com/Possible-defect-in-camel-cxf-with-spring-boot-tp5764973.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Possible defect in camel-cxf with spring-boot?

Posted by Jakob Thun <ja...@gmail.com>.
Hi Willem,

Sure, I created Jira issue now, here it is:
https://issues.apache.org/jira/browse/CAMEL-8570

/Jakob

On Mon, Mar 30, 2015 at 4:11 AM, Willem.Jiang [via Camel] <
ml-node+s465427n5765001h66@n5.nabble.com> wrote:

> Hi Jakob,
>
> Do you mind create a JIRA[1] for it, so we can keep the track of it.
>
> [1]https://issues.apache.org/jira/browse/CAMEL
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On March 29, 2015 at 9:14:06 PM, Jakob Thun ([hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5765001&i=0>) wrote:
>
> > Hello,
> >
> > I get a NullPointerException when using log-level INFO or finer in a
> > spring-boot application with CXF.
> >
> > I have made an example project to reproduce the strange behaviour, it
> has
> > more detailed explanation in the readme:
> > https://github.com/jakobthun/spring-boot-camel-cxf-logging-bug
> >
> > I am not sure if I am doing something wrong when setting up the Camel or
> the
> > CXF component, but the route and service works just fine when logging is
> set
> > to WARN. So I hope I am doing things right.
> >
> > If there is something I am doing wrong there might be room for some more
> > detailed error handling/description to indicate what has been missed.
> >
> > Thanks for the awesome software!
> >
> > Regards,
> > Jakob Thun
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Possible-defect-in-camel-cxf-with-spring-boot-tp5764973.html
>
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Possible-defect-in-camel-cxf-with-spring-boot-tp5764973p5765001.html
>  To unsubscribe from Possible defect in camel-cxf with spring-boot?, click
> here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764973&code=amFrb2IudGh1bkBnbWFpbC5jb218NTc2NDk3M3wxMjIwMzc1OTkx>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Possible-defect-in-camel-cxf-with-spring-boot-tp5764973p5765006.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Possible defect in camel-cxf with spring-boot?

Posted by Willem Jiang <wi...@gmail.com>.
Hi Jakob,

Do you mind create a JIRA[1] for it, so we can keep the track of it.

[1]https://issues.apache.org/jira/browse/CAMEL

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 29, 2015 at 9:14:06 PM, Jakob Thun (jakob.thun@gmail.com) wrote:
> Hello,
>  
> I get a NullPointerException when using log-level INFO or finer in a
> spring-boot application with CXF.
>  
> I have made an example project to reproduce the strange behaviour, it has
> more detailed explanation in the readme:
> https://github.com/jakobthun/spring-boot-camel-cxf-logging-bug
>  
> I am not sure if I am doing something wrong when setting up the Camel or the
> CXF component, but the route and service works just fine when logging is set
> to WARN. So I hope I am doing things right.
>  
> If there is something I am doing wrong there might be room for some more
> detailed error handling/description to indicate what has been missed.
>  
> Thanks for the awesome software!
>  
> Regards,
> Jakob Thun
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Possible-defect-in-camel-cxf-with-spring-boot-tp5764973.html  
> Sent from the Camel Development mailing list archive at Nabble.com.
>  


Re: Possible defect in camel-cxf with spring-boot?

Posted by Jakob Thun <ja...@gmail.com>.
Hi,

Thank you Andrew for starting analysing the issue.

I can add that I also tried with version 2.15-SNAPSHOT from
https://repository.apache.org/content/repositories/snapshots
<https://repository.apache.org/content/repositories/snapshots/org/apache/camel/camel-core/2.15-SNAPSHOT/>

It behaves the same, so it seems that it has not been found/fixed in the
proposed 2.15.1 release.

/Jakob

On Sun, Mar 29, 2015 at 8:01 PM, Andrew Block <an...@gmail.com> wrote:

> Briefly looked into the issue. It is running into issues in this code
> block which is executed at logging level >= INFO
>
>         if (log.isInfoEnabled()) {
>             // count how many routes are actually started
>             int started = 0;
>             for (Route route : getRoutes()) {
>                 if (getRouteStatus(route.getId()).isStarted()) {
>                     started++;
>                 }
>             }
>             log.info("Total " + getRoutes().size() + " routes, of which "
> + started + " is started.");
>             log.info("Apache Camel " + getVersion() + " (CamelContext: "
> + getName() + ") started in " + TimeUtils.printDuration(stopWatch.taken()));
>         }
>
> The exception occurs when the status for the route is pulled from the
> route service. It is null and the exception is thrown. The route is
> initially spun up but then refreshes when the CXF consumer is initialized.
> Swapping it to test with a direct consumer does not result in a similar
> situation and startup succeeds at all logging level. It appears the route
> is not being registered with the route service
>
> - Andy
>
> --
> Andrew Block
>
> On March 29, 2015 at 8:14:06 AM, Jakob Thun (jakob.thun@gmail.com) wrote:
>
> I get a NullPointerException when using log-level INFO or finer in a
> spring-boot application with CXF.
>
>

Re: Possible defect in camel-cxf with spring-boot?

Posted by Andrew Block <an...@gmail.com>.
Briefly looked into the issue. It is running into issues in this code block which is executed at logging level >= INFO

        if (log.isInfoEnabled()) {
            // count how many routes are actually started
            int started = 0;
            for (Route route : getRoutes()) {
                if (getRouteStatus(route.getId()).isStarted()) {
                    started++;
                }
            }
            log.info("Total " + getRoutes().size() + " routes, of which " + started + " is started.");
            log.info("Apache Camel " + getVersion() + " (CamelContext: " + getName() + ") started in " + TimeUtils.printDuration(stopWatch.taken()));
        }

The exception occurs when the status for the route is pulled from the route service. It is null and the exception is thrown. The route is initially spun up but then refreshes when the CXF consumer is initialized. Swapping it to test with a direct consumer does not result in a similar situation and startup succeeds at all logging level. It appears the route is not being registered with the route service

- Andy

-- 
Andrew Block
On March 29, 2015 at 8:14:06 AM, Jakob Thun (jakob.thun@gmail.com) wrote:

I get a NullPointerException when using log-level INFO or finer in a 
spring-boot application with CXF.