camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-11234) NullPointerException while trying to get the Route Status on startup
Date Mon, 15 May 2017 11:45:04 GMT

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

ASF GitHub Bot commented on CAMEL-11234:
----------------------------------------

GitHub user prashant2402 opened a pull request:

    https://github.com/apache/camel/pull/1696

    CAMEL-11234: NullPointerException while trying to get the Route Status on startup

    Please review the fix.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/prashant2402/camel master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1696.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1696
    
----
commit 087dc6490766d6676dd1ee58f265a1d19cbe1dd7
Author: Prasanth Pagolu <ppagolu@redhat.com>
Date:   2017-05-12T16:35:24Z

    CAMEL-11264: Fixed potential NPE in DefaultUndertowHttpBinding

commit 44cf72c2e2d0d7bc32fdfb3961e491385e65ec2a
Author: Prasanth Pagolu <ppagolu@redhat.com>
Date:   2017-05-12T17:07:30Z

    CAMEL-11264: Fixed potential NPE in DefaultUndertowHttpBinding

commit 95db007a8a502e5e695e556641ebbc8fd0bfab08
Author: Prasanth Pagolu <ppagolu@redhat.com>
Date:   2017-05-13T16:20:35Z

    CAMEL-11264: Fixed potential NPE in DefaultUndertowHttpBinding

commit eeb70213ce8aaffbf893d77968fdbc27a00f9c7e
Author: Prasanth Pagolu <ppagolu@redhat.com>
Date:   2017-05-14T20:49:34Z

    CAMEL-11264: Fixed potential NPE in DefaultUndertowHttpBinding

commit c6261fedc94a6156df0d04091ba5c4ce3d0b5dd2
Author: Prasanth Pagolu <ppagolu@redhat.com>
Date:   2017-05-15T11:37:29Z

    CAMEL-11234: NullPointerException while trying to get the Route Status on startup

----


> NullPointerException while trying to get the Route Status on startup
> --------------------------------------------------------------------
>
>                 Key: CAMEL-11234
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11234
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.18.2
>         Environment: Spring Boot 1.5.1
>            Reporter: Raul Astudillo Markoch
>            Priority: Minor
>             Fix For: 2.18.4, 2.19.1, 2.20.0
>
>
> Using a class that extends EventNotifierSupport, we advise a route by adding a processor
in between two outputs.
> It looks like this
> from().processor().bean().processor().processor(advised),to().
> To add the adviceWith processor we listen to the routeAdded event and advice the route.
> While Camel is starting up there is a line (line number 2966) in the DefaultCamelContext
that loops through the available routes for later logging the amount of routes started in
the context. This calls for a method ( if(this.getRouteStatus(route.getId()).isStarted())
{ ) that may return null if there are no routes running while this is being done, so IT WILL
throw a NullPointerException.
> Since I'm advising routes while the context is being started, the route gets stopped
and restarted, meanwhile the aforementioned method gets called and BUM.... NullPointerException.
> Here's the stacktrace:
> org.apache.camel.spring.boot.CamelSpringBootInitializationException: java.lang.NullPointerException
> 	at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:124)
~[camel-spring-boot-2.18.2.jar:2.18.2]
> 	at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:41)
~[camel-spring-boot-2.18.2.jar:2.18.2]
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
> 	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.springframework.boot.SpringApplication$run.call(Unknown Source) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
[groovy-all-2.4.7.jar:2.4.7]
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
[groovy-all-2.4.7.jar:2.4.7]
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
[groovy-all-2.4.7.jar:2.4.7]
> 	at com.my.app.ApplicationMain.main(ApplicationMain.groovy:12) [main/:?]
> Caused by: java.lang.NullPointerException
> 	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2943) ~[camel-core-2.18.2.jar:2.18.2]
> 	at org.apache.camel.spring.boot.RoutesCollector.maybeStart(RoutesCollector.java:141)
~[camel-spring-boot-2.18.2.jar:2.18.2]
> 	at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:116)
~[camel-spring-boot-2.18.2.jar:2.18.2]
> 	... 17 more



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message