Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Thank you for the quick reply. :) On Wed, Oct 25, 2017 at 2:44 PM, Claus Ibsenwrote: > Builds from source, or wait until the apache CI server is able to > succesfully build and publish snapshots to apache snapshot repo > > https://www.apache.org/dev/repository-faq.html > > > > On Wed, Oct 25, 2017 at 2:13 PM, Dicken George > wrote: > > Okay. Thank you update and for creating an JIRA ticket. > > > > I see it is already resolved. However, in order to test it locally on my > > dev environment, i cannot find the artifactory where i could download the > > changes from this ticket https://issues.apache.org/ > jira/browse/CAMEL-11945 > > > > Where can i get the camel 2.21.0-snapshot or 2.20.1-snapshot artifactory? > > > > > > > > On Wed, Oct 25, 2017 at 12:01 PM, Claus Ibsen > wrote: > > > >> Hi > >> > >> See ticket > >> https://issues.apache.org/jira/browse/CAMEL-11945 > >> > >> On Tue, Oct 24, 2017 at 3:36 PM, Dicken George > >> wrote: > >> > Dear Fellow Developers, > >> > > >> > Just recently, I tried to upgrade my camel-spring boot project form > camel > >> > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up > my > >> > application any more, and I get the following stack trace > >> > > >> > java.lang.NullPointerException > >> > at > >> > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart( > >> BeanConfiguration.java:66) > >> > at > >> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > >> RoutesCollector.java:226) > >> > at > >> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > >> RoutesCollector.java:54) > >> > at > >> > org.springframework.context.event.SimpleApplicationEventMulticas > >> ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > >> > at > >> > org.springframework.context.event.SimpleApplicationEventMulticas > >> ter.invokeListener(SimpleApplicationEventMulticaster.java:165) > >> > at > >> > org.springframework.context.event.SimpleApplicationEventMulticas > >> ter.multicastEvent(SimpleApplicationEventMulticaster.java:139) > >> > at > >> > org.springframework.context.support.AbstractApplicationContext. > >> publishEvent(AbstractApplicationContext.java:393) > >> > at > >> > org.springframework.context.support.AbstractApplicationContext. > >> publishEvent(AbstractApplicationContext.java:347) > >> > at > >> > org.springframework.context.support.AbstractApplicationContext. > >> finishRefresh(AbstractApplicationContext.java:883) > >> > at > >> > org.springframework.boot.context.embedded. > EmbeddedWebApplicationContext. > >> finishRefresh(EmbeddedWebApplicationContext.java:144) > >> > at > >> > org.springframework.context.support.AbstractApplicationContext. > refresh( > >> AbstractApplicationContext.java:546) > >> > at > >> > org.springframework.boot.context.embedded. > EmbeddedWebApplicationContext. > >> refresh(EmbeddedWebApplicationContext.java:122) > >> > at > >> > org.springframework.boot.SpringApplication.refresh( > >> SpringApplication.java:693) > >> > at > >> > org.springframework.boot.SpringApplication.refreshContext( > >> SpringApplication.java:360) > >> > at > >> > org.springframework.boot.SpringApplication.run( > >> SpringApplication.java:303) > >> > at > >> > org.springframework.boot.SpringApplication.run( > >> SpringApplication.java:1118) > >> > at > >> > org.springframework.boot.SpringApplication.run( > >> SpringApplication.java:1107) > >> > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > >> > > >> > Due to my complex use case, i would like to start one specific route > >> > manually and not use the autoconfiguration and autostart from > >> camelcontext. > >> > I do this in my configuration class by over riding the before > application > >> > start and after application start methods. > >> > > >> > @Configuration > >> > class BeanConfiguration implements CamelContextConfiguration { > >> > private static final Logger log = > >> > LoggerFactory.getLogger(BeanConfiguration.class); > >> > > >> > @Override > >> > public void beforeApplicationStart(CamelContext camelContext) { > >> > camelContext.setPackageScanClassResolver(new > >> > FatJarPackageScanClassResolver()); > >> > camelContext.resolveDataFormat("json-jackson"); > >> > } > >> > > >> > @Autowired > >> > SalesforceComponent sfdcComp; > >> > > >> > @Override > >> > public void afterApplicationStart(CamelContext camelContext) { > >> > > >> > try { > >> > sfdcComp.start(); > >> > camelContext.startRoute("salesforce-versions"); > >> > Route theRoute = camelContext.getRoute(" > >> salesforce-versions"); > >> > Endpoint ep = theRoute.getEndpoint(); > >> > > >> > Exchange exchange = ep.createExchange(); > >> > ProducerTemplate template = > >> > exchange.getContext().createProducerTemplate(); > >> >
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Builds from source, or wait until the apache CI server is able to succesfully build and publish snapshots to apache snapshot repo https://www.apache.org/dev/repository-faq.html On Wed, Oct 25, 2017 at 2:13 PM, Dicken Georgewrote: > Okay. Thank you update and for creating an JIRA ticket. > > I see it is already resolved. However, in order to test it locally on my > dev environment, i cannot find the artifactory where i could download the > changes from this ticket https://issues.apache.org/jira/browse/CAMEL-11945 > > Where can i get the camel 2.21.0-snapshot or 2.20.1-snapshot artifactory? > > > > On Wed, Oct 25, 2017 at 12:01 PM, Claus Ibsen wrote: > >> Hi >> >> See ticket >> https://issues.apache.org/jira/browse/CAMEL-11945 >> >> On Tue, Oct 24, 2017 at 3:36 PM, Dicken George >> wrote: >> > Dear Fellow Developers, >> > >> > Just recently, I tried to upgrade my camel-spring boot project form camel >> > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my >> > application any more, and I get the following stack trace >> > >> > java.lang.NullPointerException >> > at >> > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart( >> BeanConfiguration.java:66) >> > at >> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( >> RoutesCollector.java:226) >> > at >> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( >> RoutesCollector.java:54) >> > at >> > org.springframework.context.event.SimpleApplicationEventMulticas >> ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172) >> > at >> > org.springframework.context.event.SimpleApplicationEventMulticas >> ter.invokeListener(SimpleApplicationEventMulticaster.java:165) >> > at >> > org.springframework.context.event.SimpleApplicationEventMulticas >> ter.multicastEvent(SimpleApplicationEventMulticaster.java:139) >> > at >> > org.springframework.context.support.AbstractApplicationContext. >> publishEvent(AbstractApplicationContext.java:393) >> > at >> > org.springframework.context.support.AbstractApplicationContext. >> publishEvent(AbstractApplicationContext.java:347) >> > at >> > org.springframework.context.support.AbstractApplicationContext. >> finishRefresh(AbstractApplicationContext.java:883) >> > at >> > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. >> finishRefresh(EmbeddedWebApplicationContext.java:144) >> > at >> > org.springframework.context.support.AbstractApplicationContext.refresh( >> AbstractApplicationContext.java:546) >> > at >> > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. >> refresh(EmbeddedWebApplicationContext.java:122) >> > at >> > org.springframework.boot.SpringApplication.refresh( >> SpringApplication.java:693) >> > at >> > org.springframework.boot.SpringApplication.refreshContext( >> SpringApplication.java:360) >> > at >> > org.springframework.boot.SpringApplication.run( >> SpringApplication.java:303) >> > at >> > org.springframework.boot.SpringApplication.run( >> SpringApplication.java:1118) >> > at >> > org.springframework.boot.SpringApplication.run( >> SpringApplication.java:1107) >> > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) >> > >> > Due to my complex use case, i would like to start one specific route >> > manually and not use the autoconfiguration and autostart from >> camelcontext. >> > I do this in my configuration class by over riding the before application >> > start and after application start methods. >> > >> > @Configuration >> > class BeanConfiguration implements CamelContextConfiguration { >> > private static final Logger log = >> > LoggerFactory.getLogger(BeanConfiguration.class); >> > >> > @Override >> > public void beforeApplicationStart(CamelContext camelContext) { >> > camelContext.setPackageScanClassResolver(new >> > FatJarPackageScanClassResolver()); >> > camelContext.resolveDataFormat("json-jackson"); >> > } >> > >> > @Autowired >> > SalesforceComponent sfdcComp; >> > >> > @Override >> > public void afterApplicationStart(CamelContext camelContext) { >> > >> > try { >> > sfdcComp.start(); >> > camelContext.startRoute("salesforce-versions"); >> > Route theRoute = camelContext.getRoute(" >> salesforce-versions"); >> > Endpoint ep = theRoute.getEndpoint(); >> > >> > Exchange exchange = ep.createExchange(); >> > ProducerTemplate template = >> > exchange.getContext().createProducerTemplate(); >> > DefaultExchange o = (DefaultExchange) template.request(ep, >> new >> > Processor() { >> > >> > @Override >> > public void process(Exchange exchange) throws Exception { >> > // TODO Auto-generated method stub >> > >> > } >> > }); >> > Object result = o.getOut().getBody(); >> >
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Okay. Thank you update and for creating an JIRA ticket. I see it is already resolved. However, in order to test it locally on my dev environment, i cannot find the artifactory where i could download the changes from this ticket https://issues.apache.org/jira/browse/CAMEL-11945 Where can i get the camel 2.21.0-snapshot or 2.20.1-snapshot artifactory? On Wed, Oct 25, 2017 at 12:01 PM, Claus Ibsenwrote: > Hi > > See ticket > https://issues.apache.org/jira/browse/CAMEL-11945 > > On Tue, Oct 24, 2017 at 3:36 PM, Dicken George > wrote: > > Dear Fellow Developers, > > > > Just recently, I tried to upgrade my camel-spring boot project form camel > > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my > > application any more, and I get the following stack trace > > > > java.lang.NullPointerException > > at > > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart( > BeanConfiguration.java:66) > > at > > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > RoutesCollector.java:226) > > at > > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > RoutesCollector.java:54) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > ter.invokeListener(SimpleApplicationEventMulticaster.java:165) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > ter.multicastEvent(SimpleApplicationEventMulticaster.java:139) > > at > > org.springframework.context.support.AbstractApplicationContext. > publishEvent(AbstractApplicationContext.java:393) > > at > > org.springframework.context.support.AbstractApplicationContext. > publishEvent(AbstractApplicationContext.java:347) > > at > > org.springframework.context.support.AbstractApplicationContext. > finishRefresh(AbstractApplicationContext.java:883) > > at > > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > finishRefresh(EmbeddedWebApplicationContext.java:144) > > at > > org.springframework.context.support.AbstractApplicationContext.refresh( > AbstractApplicationContext.java:546) > > at > > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > refresh(EmbeddedWebApplicationContext.java:122) > > at > > org.springframework.boot.SpringApplication.refresh( > SpringApplication.java:693) > > at > > org.springframework.boot.SpringApplication.refreshContext( > SpringApplication.java:360) > > at > > org.springframework.boot.SpringApplication.run( > SpringApplication.java:303) > > at > > org.springframework.boot.SpringApplication.run( > SpringApplication.java:1118) > > at > > org.springframework.boot.SpringApplication.run( > SpringApplication.java:1107) > > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > > > Due to my complex use case, i would like to start one specific route > > manually and not use the autoconfiguration and autostart from > camelcontext. > > I do this in my configuration class by over riding the before application > > start and after application start methods. > > > > @Configuration > > class BeanConfiguration implements CamelContextConfiguration { > > private static final Logger log = > > LoggerFactory.getLogger(BeanConfiguration.class); > > > > @Override > > public void beforeApplicationStart(CamelContext camelContext) { > > camelContext.setPackageScanClassResolver(new > > FatJarPackageScanClassResolver()); > > camelContext.resolveDataFormat("json-jackson"); > > } > > > > @Autowired > > SalesforceComponent sfdcComp; > > > > @Override > > public void afterApplicationStart(CamelContext camelContext) { > > > > try { > > sfdcComp.start(); > > camelContext.startRoute("salesforce-versions"); > > Route theRoute = camelContext.getRoute(" > salesforce-versions"); > > Endpoint ep = theRoute.getEndpoint(); > > > > Exchange exchange = ep.createExchange(); > > ProducerTemplate template = > > exchange.getContext().createProducerTemplate(); > > DefaultExchange o = (DefaultExchange) template.request(ep, > new > > Processor() { > > > > @Override > > public void process(Exchange exchange) throws Exception { > > // TODO Auto-generated method stub > > > > } > > }); > > Object result = o.getOut().getBody(); > > if(result == null && !(result instanceof ArrayList)) > > throw new Exception("No Salesforce version, login > > failed."); > > > > ArrayList theList = (ArrayList) result; > > if(theList.size() <= 1) > > throw new Exception("No Salesforce version got, login > > failed."); > > log.debug("Connection to salesforce
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Hi See ticket https://issues.apache.org/jira/browse/CAMEL-11945 On Tue, Oct 24, 2017 at 3:36 PM, Dicken Georgewrote: > Dear Fellow Developers, > > Just recently, I tried to upgrade my camel-spring boot project form camel > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my > application any more, and I get the following stack trace > > java.lang.NullPointerException > at > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart(BeanConfiguration.java:66) > at > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:226) > at > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:54) > at > org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > at > org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) > at > org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) > at > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) > at > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) > at > org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) > at > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) > at > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) > at > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) > at > org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) > at > org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) > at > org.springframework.boot.SpringApplication.run(SpringApplication.java:303) > at > org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) > at > org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > Due to my complex use case, i would like to start one specific route > manually and not use the autoconfiguration and autostart from camelcontext. > I do this in my configuration class by over riding the before application > start and after application start methods. > > @Configuration > class BeanConfiguration implements CamelContextConfiguration { > private static final Logger log = > LoggerFactory.getLogger(BeanConfiguration.class); > > @Override > public void beforeApplicationStart(CamelContext camelContext) { > camelContext.setPackageScanClassResolver(new > FatJarPackageScanClassResolver()); > camelContext.resolveDataFormat("json-jackson"); > } > > @Autowired > SalesforceComponent sfdcComp; > > @Override > public void afterApplicationStart(CamelContext camelContext) { > > try { > sfdcComp.start(); > camelContext.startRoute("salesforce-versions"); > Route theRoute = camelContext.getRoute("salesforce-versions"); > Endpoint ep = theRoute.getEndpoint(); > > Exchange exchange = ep.createExchange(); > ProducerTemplate template = > exchange.getContext().createProducerTemplate(); > DefaultExchange o = (DefaultExchange) template.request(ep, new > Processor() { > > @Override > public void process(Exchange exchange) throws Exception { > // TODO Auto-generated method stub > > } > }); > Object result = o.getOut().getBody(); > if(result == null && !(result instanceof ArrayList)) > throw new Exception("No Salesforce version, login > failed."); > > ArrayList theList = (ArrayList) result; > if(theList.size() <= 1) > throw new Exception("No Salesforce version got, login > failed."); > log.debug("Connection to salesforce successfully established:"); > > } catch (Exception e) { > // TODO Auto-generated catch block > e.printStackTrace(); > throw new RuntimeException("No Connection to salesforce"); > } > > } > In this code, i saw during my debugging that it was able to start the > routes in camelcontext object and get the endpoints, however with version > 2.20.0 I see my routes are not added to the camelcontext and no routes are > started. > > Could anyone help me here to trouble shoot this issue ? > > Thanks in advance > -- > > Dicken George -- Claus Ibsen - http://davsclaus.com @davsclaus Camel in Action 2:
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
yes it seems to be like a timing issue :) but what i don't understand is, i thought putting my manual route start up in afterapplicationstart should have resolved the problem. Seems like it doesn't :) On Tue, Oct 24, 2017 at 7:25 PM, Mark Nuttallwrote: > I don't know enough about the inner workings of Camel to tell you about the > version issue. > If i remember rightly, I've heard of or experience the same sort of thing > when doing outside the box things, like this. It is really a timing issue, > if i remember rightly. > > > > On Tue, Oct 24, 2017 at 1:18 PM, Dicken George > wrote: > > > so in the stack trace it talks about line 66 but when i debug i can see > > that > > > >"camelContext.startRoute("salesforce-versions");" > > > > already in line 64 meaning the route is not started as the routeservices > > object is empty (null). Which thereby causes and expection at line 66 > > which is > > > >Endpoint ep = theRoute.getEndpoint(); > > > > I am wondering if there any specific call which adds all routes to the > > camelcontext differently in 2.19.x compared to 2.20.0 ? > > > > > > > > On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttall > wrote: > > > > > Oh. i missed the "complex use case". Of the code you provided, what is > > line > > > 66? > > > > > > On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall > > > wrote: > > > > > > > Is there any reason you are not using the standard Spring Boot + > Camel > > > > mechanisms to create the context and routes. I don't readily see any > in > > > > your code. Doing so might resolve the problem. Let me know if you > > need > > > > help with that.. > > > > > > > > Mark > > > > > > > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George < > dickengeo...@gmail.com > > > > > > > wrote: > > > > > > > >> Dear Fellow Developers, > > > >> > > > >> Just recently, I tried to upgrade my camel-spring boot project form > > > camel > > > >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up > > my > > > >> application any more, and I get the following stack trace > > > >> > > > >> java.lang.NullPointerException > > > >> at > > > >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati > > > >> onStart(BeanConfiguration.java:66) > > > >> at > > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > > > >> ent(RoutesCollector.java:226) > > > >> at > > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > > > >> ent(RoutesCollector.java:54) > > > >> at > > > >> org.springframework.context.event.SimpleApplicationEventMult > > > >> icaster.doInvokeListener(SimpleApplicationEventMulticas > ter.java:172) > > > >> at > > > >> org.springframework.context.event.SimpleApplicationEventMult > > > >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165) > > > >> at > > > >> org.springframework.context.event.SimpleApplicationEventMult > > > >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) > > > >> at > > > >> org.springframework.context.support.AbstractApplicationConte > > > >> xt.publishEvent(AbstractApplicationContext.java:393) > > > >> at > > > >> org.springframework.context.support.AbstractApplicationConte > > > >> xt.publishEvent(AbstractApplicationContext.java:347) > > > >> at > > > >> org.springframework.context.support.AbstractApplicationConte > > > >> xt.finishRefresh(AbstractApplicationContext.java:883) > > > >> at > > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > > > >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144) > > > >> at > > > >> org.springframework.context.support.AbstractApplicationConte > > > >> xt.refresh(AbstractApplicationContext.java:546) > > > >> at > > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > > > >> tionContext.refresh(EmbeddedWebApplicationContext.java:122) > > > >> at > > > >> org.springframework.boot.SpringApplication.refresh(SpringApp > > > >> lication.java:693) > > > >> at > > > >> org.springframework.boot.SpringApplication.refreshContext(Sp > > > >> ringApplication.java:360) > > > >> at > > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > > >> tion.java:303) > > > >> at > > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > > >> tion.java:1118) > > > >> at > > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > > >> tion.java:1107) > > > >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > > >> > > > >> Due to my complex use case, i would like to start one specific route > > > >> manually and not use the autoconfiguration and autostart from > > > >> camelcontext. > > > >> I do this in my configuration class by over riding the before > > > application > > > >> start and after application start methods. > > > >> > > > >> @Configuration > > > >> class BeanConfiguration implements CamelContextConfiguration { > > > >>
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
I don't know enough about the inner workings of Camel to tell you about the version issue. If i remember rightly, I've heard of or experience the same sort of thing when doing outside the box things, like this. It is really a timing issue, if i remember rightly. On Tue, Oct 24, 2017 at 1:18 PM, Dicken Georgewrote: > so in the stack trace it talks about line 66 but when i debug i can see > that > >"camelContext.startRoute("salesforce-versions");" > > already in line 64 meaning the route is not started as the routeservices > object is empty (null). Which thereby causes and expection at line 66 > which is > >Endpoint ep = theRoute.getEndpoint(); > > I am wondering if there any specific call which adds all routes to the > camelcontext differently in 2.19.x compared to 2.20.0 ? > > > > On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttall wrote: > > > Oh. i missed the "complex use case". Of the code you provided, what is > line > > 66? > > > > On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall > > wrote: > > > > > Is there any reason you are not using the standard Spring Boot + Camel > > > mechanisms to create the context and routes. I don't readily see any in > > > your code. Doing so might resolve the problem. Let me know if you > need > > > help with that.. > > > > > > Mark > > > > > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George > > > > wrote: > > > > > >> Dear Fellow Developers, > > >> > > >> Just recently, I tried to upgrade my camel-spring boot project form > > camel > > >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up > my > > >> application any more, and I get the following stack trace > > >> > > >> java.lang.NullPointerException > > >> at > > >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati > > >> onStart(BeanConfiguration.java:66) > > >> at > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > > >> ent(RoutesCollector.java:226) > > >> at > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > > >> ent(RoutesCollector.java:54) > > >> at > > >> org.springframework.context.event.SimpleApplicationEventMult > > >> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > > >> at > > >> org.springframework.context.event.SimpleApplicationEventMult > > >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165) > > >> at > > >> org.springframework.context.event.SimpleApplicationEventMult > > >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) > > >> at > > >> org.springframework.context.support.AbstractApplicationConte > > >> xt.publishEvent(AbstractApplicationContext.java:393) > > >> at > > >> org.springframework.context.support.AbstractApplicationConte > > >> xt.publishEvent(AbstractApplicationContext.java:347) > > >> at > > >> org.springframework.context.support.AbstractApplicationConte > > >> xt.finishRefresh(AbstractApplicationContext.java:883) > > >> at > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > > >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144) > > >> at > > >> org.springframework.context.support.AbstractApplicationConte > > >> xt.refresh(AbstractApplicationContext.java:546) > > >> at > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > > >> tionContext.refresh(EmbeddedWebApplicationContext.java:122) > > >> at > > >> org.springframework.boot.SpringApplication.refresh(SpringApp > > >> lication.java:693) > > >> at > > >> org.springframework.boot.SpringApplication.refreshContext(Sp > > >> ringApplication.java:360) > > >> at > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > >> tion.java:303) > > >> at > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > >> tion.java:1118) > > >> at > > >> org.springframework.boot.SpringApplication.run(SpringApplica > > >> tion.java:1107) > > >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > >> > > >> Due to my complex use case, i would like to start one specific route > > >> manually and not use the autoconfiguration and autostart from > > >> camelcontext. > > >> I do this in my configuration class by over riding the before > > application > > >> start and after application start methods. > > >> > > >> @Configuration > > >> class BeanConfiguration implements CamelContextConfiguration { > > >> private static final Logger log = > > >> LoggerFactory.getLogger(BeanConfiguration.class); > > >> > > >> @Override > > >> public void beforeApplicationStart(CamelContext camelContext) { > > >> camelContext.setPackageScanClassResolver(new > > >> FatJarPackageScanClassResolver()); > > >> camelContext.resolveDataFormat("json-jackson"); > > >> } > > >> > > >> @Autowired > > >> SalesforceComponent sfdcComp; > > >> > > >> @Override > > >> public void
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
so in the stack trace it talks about line 66 but when i debug i can see that "camelContext.startRoute("salesforce-versions");" already in line 64 meaning the route is not started as the routeservices object is empty (null). Which thereby causes and expection at line 66 which is Endpoint ep = theRoute.getEndpoint(); I am wondering if there any specific call which adds all routes to the camelcontext differently in 2.19.x compared to 2.20.0 ? On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttallwrote: > Oh. i missed the "complex use case". Of the code you provided, what is line > 66? > > On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall > wrote: > > > Is there any reason you are not using the standard Spring Boot + Camel > > mechanisms to create the context and routes. I don't readily see any in > > your code. Doing so might resolve the problem. Let me know if you need > > help with that.. > > > > Mark > > > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George > > wrote: > > > >> Dear Fellow Developers, > >> > >> Just recently, I tried to upgrade my camel-spring boot project form > camel > >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my > >> application any more, and I get the following stack trace > >> > >> java.lang.NullPointerException > >> at > >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati > >> onStart(BeanConfiguration.java:66) > >> at > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > >> ent(RoutesCollector.java:226) > >> at > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv > >> ent(RoutesCollector.java:54) > >> at > >> org.springframework.context.event.SimpleApplicationEventMult > >> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > >> at > >> org.springframework.context.event.SimpleApplicationEventMult > >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165) > >> at > >> org.springframework.context.event.SimpleApplicationEventMult > >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) > >> at > >> org.springframework.context.support.AbstractApplicationConte > >> xt.publishEvent(AbstractApplicationContext.java:393) > >> at > >> org.springframework.context.support.AbstractApplicationConte > >> xt.publishEvent(AbstractApplicationContext.java:347) > >> at > >> org.springframework.context.support.AbstractApplicationConte > >> xt.finishRefresh(AbstractApplicationContext.java:883) > >> at > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144) > >> at > >> org.springframework.context.support.AbstractApplicationConte > >> xt.refresh(AbstractApplicationContext.java:546) > >> at > >> org.springframework.boot.context.embedded.EmbeddedWebApplica > >> tionContext.refresh(EmbeddedWebApplicationContext.java:122) > >> at > >> org.springframework.boot.SpringApplication.refresh(SpringApp > >> lication.java:693) > >> at > >> org.springframework.boot.SpringApplication.refreshContext(Sp > >> ringApplication.java:360) > >> at > >> org.springframework.boot.SpringApplication.run(SpringApplica > >> tion.java:303) > >> at > >> org.springframework.boot.SpringApplication.run(SpringApplica > >> tion.java:1118) > >> at > >> org.springframework.boot.SpringApplication.run(SpringApplica > >> tion.java:1107) > >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > >> > >> Due to my complex use case, i would like to start one specific route > >> manually and not use the autoconfiguration and autostart from > >> camelcontext. > >> I do this in my configuration class by over riding the before > application > >> start and after application start methods. > >> > >> @Configuration > >> class BeanConfiguration implements CamelContextConfiguration { > >> private static final Logger log = > >> LoggerFactory.getLogger(BeanConfiguration.class); > >> > >> @Override > >> public void beforeApplicationStart(CamelContext camelContext) { > >> camelContext.setPackageScanClassResolver(new > >> FatJarPackageScanClassResolver()); > >> camelContext.resolveDataFormat("json-jackson"); > >> } > >> > >> @Autowired > >> SalesforceComponent sfdcComp; > >> > >> @Override > >> public void afterApplicationStart(CamelContext camelContext) { > >> > >> try { > >> sfdcComp.start(); > >> camelContext.startRoute("salesforce-versions"); > >> Route theRoute = camelContext.getRoute("salesfo > >> rce-versions"); > >> Endpoint ep = theRoute.getEndpoint(); > >> > >> Exchange exchange = ep.createExchange(); > >> ProducerTemplate template = > >> exchange.getContext().createProducerTemplate(); > >> DefaultExchange o = (DefaultExchange) template.request(ep, > new > >> Processor() { > >> > >> @Override > >>
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Hi Mark, Thank you for your reply. I use the manual method to start one specific route as I would like to control the application behaviour. It is kind of a exception handler that allows me to shutdown my application incase the route was not successfully able to get the salesforce version. Therefore i want to control is manually after the camel context is all started up. On Tue, Oct 24, 2017 at 5:47 PM, Mark Nuttallwrote: > Is there any reason you are not using the standard Spring Boot + Camel > mechanisms to create the context and routes. I don't readily see any in > your code. Doing so might resolve the problem. Let me know if you need > help with that.. > > Mark > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George > wrote: > > > Dear Fellow Developers, > > > > Just recently, I tried to upgrade my camel-spring boot project form camel > > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my > > application any more, and I get the following stack trace > > > > java.lang.NullPointerException > > at > > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart( > > BeanConfiguration.java:66) > > at > > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > > RoutesCollector.java:226) > > at > > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > > RoutesCollector.java:54) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > > ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > > ter.invokeListener(SimpleApplicationEventMulticaster.java:165) > > at > > org.springframework.context.event.SimpleApplicationEventMulticas > > ter.multicastEvent(SimpleApplicationEventMulticaster.java:139) > > at > > org.springframework.context.support.AbstractApplicationContext. > > publishEvent(AbstractApplicationContext.java:393) > > at > > org.springframework.context.support.AbstractApplicationContext. > > publishEvent(AbstractApplicationContext.java:347) > > at > > org.springframework.context.support.AbstractApplicationContext. > > finishRefresh(AbstractApplicationContext.java:883) > > at > > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > > finishRefresh(EmbeddedWebApplicationContext.java:144) > > at > > org.springframework.context.support.AbstractApplicationContext.refresh( > > AbstractApplicationContext.java:546) > > at > > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > > refresh(EmbeddedWebApplicationContext.java:122) > > at > > org.springframework.boot.SpringApplication.refresh( > > SpringApplication.java:693) > > at > > org.springframework.boot.SpringApplication.refreshContext( > > SpringApplication.java:360) > > at > > org.springframework.boot.SpringApplication.run( > SpringApplication.java:303) > > at > > org.springframework.boot.SpringApplication.run( > > SpringApplication.java:1118) > > at > > org.springframework.boot.SpringApplication.run( > > SpringApplication.java:1107) > > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > > > Due to my complex use case, i would like to start one specific route > > manually and not use the autoconfiguration and autostart from > camelcontext. > > I do this in my configuration class by over riding the before application > > start and after application start methods. > > > > @Configuration > > class BeanConfiguration implements CamelContextConfiguration { > > private static final Logger log = > > LoggerFactory.getLogger(BeanConfiguration.class); > > > > @Override > > public void beforeApplicationStart(CamelContext camelContext) { > > camelContext.setPackageScanClassResolver(new > > FatJarPackageScanClassResolver()); > > camelContext.resolveDataFormat("json-jackson"); > > } > > > > @Autowired > > SalesforceComponent sfdcComp; > > > > @Override > > public void afterApplicationStart(CamelContext camelContext) { > > > > try { > > sfdcComp.start(); > > camelContext.startRoute("salesforce-versions"); > > Route theRoute = camelContext.getRoute(" > salesforce-versions"); > > Endpoint ep = theRoute.getEndpoint(); > > > > Exchange exchange = ep.createExchange(); > > ProducerTemplate template = > > exchange.getContext().createProducerTemplate(); > > DefaultExchange o = (DefaultExchange) template.request(ep, > new > > Processor() { > > > > @Override > > public void process(Exchange exchange) throws Exception { > > // TODO Auto-generated method stub > > > > } > > }); > > Object result = o.getOut().getBody(); > > if(result == null && !(result instanceof ArrayList)) > > throw new Exception("No Salesforce version, login > > failed."); > > > >
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Oh. i missed the "complex use case". Of the code you provided, what is line 66? On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttallwrote: > Is there any reason you are not using the standard Spring Boot + Camel > mechanisms to create the context and routes. I don't readily see any in > your code. Doing so might resolve the problem. Let me know if you need > help with that.. > > Mark > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George > wrote: > >> Dear Fellow Developers, >> >> Just recently, I tried to upgrade my camel-spring boot project form camel >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my >> application any more, and I get the following stack trace >> >> java.lang.NullPointerException >> at >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati >> onStart(BeanConfiguration.java:66) >> at >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv >> ent(RoutesCollector.java:226) >> at >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv >> ent(RoutesCollector.java:54) >> at >> org.springframework.context.event.SimpleApplicationEventMult >> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) >> at >> org.springframework.context.event.SimpleApplicationEventMult >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165) >> at >> org.springframework.context.event.SimpleApplicationEventMult >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) >> at >> org.springframework.context.support.AbstractApplicationConte >> xt.publishEvent(AbstractApplicationContext.java:393) >> at >> org.springframework.context.support.AbstractApplicationConte >> xt.publishEvent(AbstractApplicationContext.java:347) >> at >> org.springframework.context.support.AbstractApplicationConte >> xt.finishRefresh(AbstractApplicationContext.java:883) >> at >> org.springframework.boot.context.embedded.EmbeddedWebApplica >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144) >> at >> org.springframework.context.support.AbstractApplicationConte >> xt.refresh(AbstractApplicationContext.java:546) >> at >> org.springframework.boot.context.embedded.EmbeddedWebApplica >> tionContext.refresh(EmbeddedWebApplicationContext.java:122) >> at >> org.springframework.boot.SpringApplication.refresh(SpringApp >> lication.java:693) >> at >> org.springframework.boot.SpringApplication.refreshContext(Sp >> ringApplication.java:360) >> at >> org.springframework.boot.SpringApplication.run(SpringApplica >> tion.java:303) >> at >> org.springframework.boot.SpringApplication.run(SpringApplica >> tion.java:1118) >> at >> org.springframework.boot.SpringApplication.run(SpringApplica >> tion.java:1107) >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) >> >> Due to my complex use case, i would like to start one specific route >> manually and not use the autoconfiguration and autostart from >> camelcontext. >> I do this in my configuration class by over riding the before application >> start and after application start methods. >> >> @Configuration >> class BeanConfiguration implements CamelContextConfiguration { >> private static final Logger log = >> LoggerFactory.getLogger(BeanConfiguration.class); >> >> @Override >> public void beforeApplicationStart(CamelContext camelContext) { >> camelContext.setPackageScanClassResolver(new >> FatJarPackageScanClassResolver()); >> camelContext.resolveDataFormat("json-jackson"); >> } >> >> @Autowired >> SalesforceComponent sfdcComp; >> >> @Override >> public void afterApplicationStart(CamelContext camelContext) { >> >> try { >> sfdcComp.start(); >> camelContext.startRoute("salesforce-versions"); >> Route theRoute = camelContext.getRoute("salesfo >> rce-versions"); >> Endpoint ep = theRoute.getEndpoint(); >> >> Exchange exchange = ep.createExchange(); >> ProducerTemplate template = >> exchange.getContext().createProducerTemplate(); >> DefaultExchange o = (DefaultExchange) template.request(ep, new >> Processor() { >> >> @Override >> public void process(Exchange exchange) throws Exception { >> // TODO Auto-generated method stub >> >> } >> }); >> Object result = o.getOut().getBody(); >> if(result == null && !(result instanceof ArrayList)) >> throw new Exception("No Salesforce version, login >> failed."); >> >> ArrayList theList = (ArrayList) result; >> if(theList.size() <= 1) >> throw new Exception("No Salesforce version got, login >> failed."); >> log.debug("Connection to salesforce successfully >> established:"); >> >> } catch (Exception e) { >> // TODO Auto-generated catch block >> e.printStackTrace(); >>
Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0
Is there any reason you are not using the standard Spring Boot + Camel mechanisms to create the context and routes. I don't readily see any in your code. Doing so might resolve the problem. Let me know if you need help with that.. Mark On Tue, Oct 24, 2017 at 9:36 AM, Dicken Georgewrote: > Dear Fellow Developers, > > Just recently, I tried to upgrade my camel-spring boot project form camel > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my > application any more, and I get the following stack trace > > java.lang.NullPointerException > at > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart( > BeanConfiguration.java:66) > at > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > RoutesCollector.java:226) > at > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent( > RoutesCollector.java:54) > at > org.springframework.context.event.SimpleApplicationEventMulticas > ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172) > at > org.springframework.context.event.SimpleApplicationEventMulticas > ter.invokeListener(SimpleApplicationEventMulticaster.java:165) > at > org.springframework.context.event.SimpleApplicationEventMulticas > ter.multicastEvent(SimpleApplicationEventMulticaster.java:139) > at > org.springframework.context.support.AbstractApplicationContext. > publishEvent(AbstractApplicationContext.java:393) > at > org.springframework.context.support.AbstractApplicationContext. > publishEvent(AbstractApplicationContext.java:347) > at > org.springframework.context.support.AbstractApplicationContext. > finishRefresh(AbstractApplicationContext.java:883) > at > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > finishRefresh(EmbeddedWebApplicationContext.java:144) > at > org.springframework.context.support.AbstractApplicationContext.refresh( > AbstractApplicationContext.java:546) > at > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext. > refresh(EmbeddedWebApplicationContext.java:122) > at > org.springframework.boot.SpringApplication.refresh( > SpringApplication.java:693) > at > org.springframework.boot.SpringApplication.refreshContext( > SpringApplication.java:360) > at > org.springframework.boot.SpringApplication.run(SpringApplication.java:303) > at > org.springframework.boot.SpringApplication.run( > SpringApplication.java:1118) > at > org.springframework.boot.SpringApplication.run( > SpringApplication.java:1107) > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12) > > Due to my complex use case, i would like to start one specific route > manually and not use the autoconfiguration and autostart from camelcontext. > I do this in my configuration class by over riding the before application > start and after application start methods. > > @Configuration > class BeanConfiguration implements CamelContextConfiguration { > private static final Logger log = > LoggerFactory.getLogger(BeanConfiguration.class); > > @Override > public void beforeApplicationStart(CamelContext camelContext) { > camelContext.setPackageScanClassResolver(new > FatJarPackageScanClassResolver()); > camelContext.resolveDataFormat("json-jackson"); > } > > @Autowired > SalesforceComponent sfdcComp; > > @Override > public void afterApplicationStart(CamelContext camelContext) { > > try { > sfdcComp.start(); > camelContext.startRoute("salesforce-versions"); > Route theRoute = camelContext.getRoute("salesforce-versions"); > Endpoint ep = theRoute.getEndpoint(); > > Exchange exchange = ep.createExchange(); > ProducerTemplate template = > exchange.getContext().createProducerTemplate(); > DefaultExchange o = (DefaultExchange) template.request(ep, new > Processor() { > > @Override > public void process(Exchange exchange) throws Exception { > // TODO Auto-generated method stub > > } > }); > Object result = o.getOut().getBody(); > if(result == null && !(result instanceof ArrayList)) > throw new Exception("No Salesforce version, login > failed."); > > ArrayList theList = (ArrayList) result; > if(theList.size() <= 1) > throw new Exception("No Salesforce version got, login > failed."); > log.debug("Connection to salesforce successfully > established:"); > > } catch (Exception e) { > // TODO Auto-generated catch block > e.printStackTrace(); > throw new RuntimeException("No Connection to salesforce"); > } > > } > In this code, i saw during my debugging that it was able to start the > routes in camelcontext object and get the endpoints, however with version > 2.20.0 I see my routes are not added to the camelcontext and no routes