[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-07 Thread Claus Ibsen (JIRA)

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

Claus Ibsen commented on CAMEL-9789:


Hubertus so I have modified camel-spring-javaconfig to be more like 
camel-spring-boot and add the routes after CamelContext has been fully created. 
So together with that fix and this ticket your issue should be fixed/improved a 
lot.

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-07 Thread Hubertus Willuhn (JIRA)

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

Hubertus Willuhn commented on CAMEL-9789:
-

That's good to know, i was a bit miss lead by the documentation. I think a 
sample for "good pratice" with spring boot, java config and camel would help
Much to do at the moment, but i will try to zip a basic sample project and 
upload it to this JIRA

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-06 Thread Claus Ibsen (JIRA)

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

Claus Ibsen commented on CAMEL-9789:


Yeah for spring-boot I think not using camel-spring-javaconfig is the approach. 
That module was written before spring-boot and is not as much in use as 
camel-spring-boot is.

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-06 Thread Claus Ibsen (JIRA)

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

Claus Ibsen commented on CAMEL-9789:


Trying to improve this so endpoints are not pre-started if you use getEndpoint. 
Also other services that routes / components etc may register are being 
deferred being started until later.

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-06 Thread Claus Ibsen (JIRA)

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

Claus Ibsen commented on CAMEL-9789:


Hubertus,

Maybe you can put a sample project together as a .zip and attach this JIRA or 
put it on github somewhere.

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-05 Thread Hubertus Willuhn (JIRA)

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

Hubertus Willuhn commented on CAMEL-9789:
-

*UPDATE*:

I tried out different things with the new Camel Version 2.17.0 and the new 
Camel-Spring-Boot-Starter POM.
This leads to a invalid JavaConfig Classes on my side.

My config classes in Camel 2.16.0 looks like:

{code}
// my base config class
public abstract class BaseCamelConfig extends CamelConfiguration
{
... // Constants definitions

@Override
protected void setupCamelContext(CamelContext camelContext) throws 
Exception
{
super.setupCamelContext(camelContext);

if(camelContext instanceof SpringCamelContext)
((SpringCamelContext) camelContext).setName("Import");

// currently no stream caching at all
//this.setupStreamCache(camelContext);
this.setupThreadPools(camelContext);
}

   ... // functions
}
{code}

{code}
// project specific config class
@Configuration
@EnableAutoConfiguration
@ComponentScan ({"**.core", "**.camel", "**.imp"})
//@PropertySource("classpath:application.properties")
public class CamelConfig extends BaseCamelConfig
{
{code}

This works fine with Camel 2.16.1 but in Camel 2.17.0 the app crashes with 
above error.

Changing the configuration to this, works in both versions (mainly copied from 
[http://camel.apache.org/spring-boot.html]):

{code}
// my new base config class
public abstract class BaseCamelConfig
{
 ...

@Bean
public CamelContextConfiguration contextConfiguration()
{
return new CamelContextConfiguration()
{
@Override
public void beforeApplicationStart(CamelContext 
camelContext)
{
if(camelContext instanceof SpringCamelContext)
((SpringCamelContext) 
camelContext).setName("Import");

setupThreadPools(camelContext);
}
};
}
...
}
{code}

> CamelContext.getEndpoint should not start endpoint if Camel is starting up
> --
>
> Key: CAMEL-9789
> URL: https://issues.apache.org/jira/browse/CAMEL-9789
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-core
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Quartz2-Endpoint-Exception-td5780221.html



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


[jira] [Commented] (CAMEL-9789) CamelContext.getEndpoint should not start endpoint if Camel is starting up

2016-04-04 Thread Hubertus Willuhn (JIRA)

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

Hubertus Willuhn commented on CAMEL-9789:
-

After upgrading to Camel 1.17.0 my Routes are crashing with stacktraces like 
the following (seems to be related to this issue, my own packages are masked 
with **):

14:32:31 | [main] CamelApp| ERROR | Camel 
App crashed, Reason: Error creating bean with name 'camelContext' defined in 
class **.config.CamelConfig: Invocation of init method failed; nested exception 
is java.lang.IllegalArgumentException: Cannot add component as its already 
previously added: properties
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'camelContext' defined in class **.config.CamelConfig: Invocation of 
init method failed; nested exception is java.lang.IllegalArgumentException: 
Cannot add component as its already previously added: properties
Related cause: 
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error 
creating bean with name 'camelContext': Requested bean is currently in 
creation: Is there an unresolvable circular reference?
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689)
at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at **.CamelApp.main(CamelApp.java:67)
Caused by: java.lang.IllegalArgumentException: Cannot add component as its 
already previously added: properties
at 
org.apache.camel.impl.DefaultCamelContext.addComponent(DefaultCamelContext.java:370)
at 
org.apache.camel.util.CamelContextHelper.lookupPropertiesComponent(CamelContextHelper.java:578)
at 
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3003)
at 
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
at 
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2848)
  t 
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2844)
at 
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2867)
at 
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2844)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at 
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2813)
at 
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:270)
at 
org.apache.camel.spring.SpringCamelContext.afterPropertiesSet(SpringCamelContext.java:122)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 12 more  
Related cause:   
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error 
creating bean with name 'camelContext': Requested bean is currently in 
creation: Is there an unresolvable circular reference?
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:347)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at