Code generated from archetypes does not work oob
------------------------------------------------

                 Key: CAMEL-1197
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1197
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 1.5.0
            Reporter: Hadrian Zbarcea
            Priority: Minor
             Fix For: 1.5.1


I noticed this using te camel-archetype-activemq archetype.  We need to test 
the others too.

Steps to reproduce:

{code}
pebble:examples hadrian$ mvn 
org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create 
-DarchetypeGroupId=org.apache.camel.archetypes 
-DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=1.5.0 
-DgroupId=org.apache.camel -DartifactId=camel-example-activemq
{code}

There is a velocity error while generating code that should be addressed 
(minor):
{code}
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 43,column 16] : 
${activemq-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 48,column 16] : ${camel-version} 
is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 53,column 16] : ${camel-version} 
is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 58,column 16] : ${camel-version} 
is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 63,column 16] : 
${xbean-spring-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 84,column 18] : ${camel-version} 
is not a valid reference.
[INFO] ********************* End of debug info from resources from generated 
POM ***********************
[INFO] Archetype created in dir: 
/opt/apache/apache-camel-1.5.0/examples/camel-example-activemq
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
{code}

Running it:
{code}
pebble:camel-example-activemq hadrian$ mvn camel:run
[...]
SEVERE: Failed: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'camelContext:beanPostProcessor': Cannot resolve 
reference to bean 'camelContext' while setting bean property 'camelContext'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'camelContext': Invocation of init method failed; 
nested exception is java.lang.IllegalArgumentException: the fromUris property 
must contain at least one valid URI
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'camelContext:beanPostProcessor': Cannot resolve reference to bean 
'camelContext' while setting bean property 'camelContext'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'camelContext': Invocation of init method failed; nested exception is 
java.lang.IllegalArgumentException: the fromUris property must contain at least 
one valid URI
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
        at 
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:606)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366)
        at 
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at 
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
        at 
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:189)
        at org.apache.camel.spring.Main.doStart(Main.java:152)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
        at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
        at org.apache.camel.util.MainSupport.run(MainSupport.java:310)
        at org.apache.camel.spring.Main.main(Main.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:396)
        at java.lang.Thread.run(Thread.java:613)
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'camelContext': Invocation of init method failed; 
nested exception is java.lang.IllegalArgumentException: the fromUris property 
must contain at least one valid URI
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
        ... 29 more
Caused by: java.lang.IllegalArgumentException: the fromUris property must 
contain at least one valid URI
        at 
org.apache.camel.spring.util.SimpleRouteBuilder.configure(SimpleRouteBuilder.java:42)
        at 
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:201)
        at 
org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:175)
        at 
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:399)
        at 
org.apache.camel.spring.CamelContextFactoryBean.installRoutes(CamelContextFactoryBean.java:504)
        at 
org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:255)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
        ... 39 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
{code}

The build is reported as successful even if it's not.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to