camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: classpath problem with camel:dot and provided dependencies
Date Wed, 12 Jan 2011 12:46:02 GMT
You found the key :)
I just committed the patch.

Willem
On 1/12/11 8:29 PM, Pablo Graña wrote:
> with runCamel set to false, the plugin does not generate the report.
>
> I checked out the plugin sources and changed the
> requiresDependencyResolution from runtime to test. It worked in my
> case.
>
> I created jira issue https://issues.apache.org/jira/browse/CAMEL-3533
> with this change.
>
> thanks a lot.
>
> On Wed, Jan 12, 2011 at 3:06 AM, Willem Jiang<willem.jiang@gmail.com>  wrote:
>> Hi,
>>
>> You don't have to run the camel application when run camel:dot.
>> Please set the runCamel configure to be false to work around this issue.
>>
>> BTW, you may try to add the servlet API dependency as test scope to see if
>> the application can start rightly..
>>
>> Willem
>> On 1/12/11 12:58 AM, Pablo Graña wrote:
>>>
>>> hi all:
>>>
>>> I am trying to run camel:dot in my project, but it is failing with a
>>> class not found exception. In my case, I am instantiating a servlet
>>> from the spring application context. The jar that includes the servlet
>>> interface is marked as provided.
>>>
>>> It looks like camel:dot is not included provided dependencies.
>>>
>>> Here is the full stack trace.
>>>
>>> Thanks a lot for your help.
>>>
>>> [ERROR] Failed to run Camel embedded:
>>> org.apache.maven.plugin.MojoExecutionException: Failed:
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name
>>> 'com.globant.katari.core.web.ModuleBeanPostProcessor#0' defined in
>>> class path resource [com/globant/katari/core/beans-core.xml]: Cannot
>>> resolve reference to bean 'katari.contextRegistrar' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'katari.contextRegistrar' defined in class
>>> path resource [com/globant/katari/core/beans-core.xml]: Cannot resolve
>>> reference to bean 'katari.moduleListenerProxy' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.CannotLoadBeanClassException: Error
>>> loading class [com.globant.katari.core.web.ModuleListenerProxy] for
>>> bean with name 'katari.moduleListenerProxy' defined in class path
>>> resource [com/globant/katari/core/beans-core.xml]: problem with class
>>> file or dependent class; nested exception is
>>> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
>>> org.apache.maven.plugin.MojoExecutionException: Failed:
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name
>>> 'com.globant.katari.core.web.ModuleBeanPostProcessor#0' defined in
>>> class path resource [com/globant/katari/core/beans-core.xml]: Cannot
>>> resolve reference to bean 'katari.contextRegistrar' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'katari.contextRegistrar' defined in class
>>> path resource [com/globant/katari/core/beans-core.xml]: Cannot resolve
>>> reference to bean 'katari.moduleListenerProxy' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.CannotLoadBeanClassException: Error
>>> loading class [com.globant.katari.core.web.ModuleListenerProxy] for
>>> bean with name 'katari.moduleListenerProxy' defined in class path
>>> resource [com/globant/katari/core/beans-core.xml]: problem with class
>>> file or dependent class; nested exception is
>>> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
>>>         at
>>> org.apache.camel.maven.EmbeddedMojo.runCamel(EmbeddedMojo.java:226)
>>>         at
>>> org.apache.camel.maven.EmbeddedMojo.executeWithoutWrapping(EmbeddedMojo.java:127)
>>>         at
>>> org.apache.camel.maven.DotMojo.runCamelEmbedded(DotMojo.java:380)
>>>         at org.apache.camel.maven.DotMojo.execute(DotMojo.java:256)
>>>         at org.apache.camel.maven.DotMojo.execute(DotMojo.java:221)
>>>         at
>>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>>>         at
>>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:616)
>>>         at
>>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>>         at
>>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>> Error creating bean with name
>>> 'com.globant.katari.core.web.ModuleBeanPostProcessor#0' defined in
>>> class path resource [com/globant/katari/core/beans-core.xml]: Cannot
>>> resolve reference to bean 'katari.contextRegistrar' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'katari.contextRegistrar' defined in class
>>> path resource [com/globant/katari/core/beans-core.xml]: Cannot resolve
>>> reference to bean 'katari.moduleListenerProxy' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.CannotLoadBeanClassException: Error
>>> loading class [com.globant.katari.core.web.ModuleListenerProxy] for
>>> bean with name 'katari.moduleListenerProxy' defined in class path
>>> resource [com/globant/katari/core/beans-core.xml]: problem with class
>>> file or dependent class; nested exception is
>>> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
>>>         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.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
>>>         at
>>> org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
>>>         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:222)
>>>         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:880)
>>>         at
>>> org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542)
>>>         at
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:362)
>>>         at
>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
>>>         at
>>> org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:94)
>>>         at
>>> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:209)
>>>         at org.apache.camel.spring.Main.doStart(Main.java:173)
>>>         at
>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)
>>>         at
>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>>>         at org.apache.camel.impl.MainSupport.run(MainSupport.java:114)
>>>         at org.apache.camel.impl.MainSupport.run(MainSupport.java:291)
>>>         at org.apache.camel.spring.Main.main(Main.java:97)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:616)
>>>         at
>>> org.apache.camel.maven.EmbeddedMojo.runCamel(EmbeddedMojo.java:223)
>>>         ... 23 more
>>> Caused by: org.springframework.beans.factory.BeanCreationException:
>>> Error creating bean with name 'katari.contextRegistrar' defined in
>>> class path resource [com/globant/katari/core/beans-core.xml]: Cannot
>>> resolve reference to bean 'katari.moduleListenerProxy' while setting
>>> constructor argument; nested exception is
>>> org.springframework.beans.factory.CannotLoadBeanClassException: Error
>>> loading class [com.globant.katari.core.web.ModuleListenerProxy] for
>>> bean with name 'katari.moduleListenerProxy' defined in class path
>>> resource [com/globant/katari/core/beans-core.xml]: problem with class
>>> file or dependent class; nested exception is
>>> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
>>>         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.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
>>>         at
>>> org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
>>>         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:222)
>>>         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)
>>>         ... 54 more
>>> Caused by: org.springframework.beans.factory.CannotLoadBeanClassException:
>>> Error loading class [com.globant.katari.core.web.ModuleListenerProxy]
>>> for bean with name 'katari.moduleListenerProxy' defined in class path
>>> resource [com/globant/katari/core/beans-core.xml]: problem with class
>>> file or dependent class; nested exception is
>>> java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
>>>         at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1144)
>>>         at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1105)
>>>         at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:386)
>>>         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:222)
>>>         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)
>>>         ... 69 more
>>> Caused by: java.lang.NoClassDefFoundError:
>>> javax/servlet/ServletContextListener
>>>         at java.lang.ClassLoader.defineClass1(Native Method)
>>>         at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
>>>         at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>>>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
>>>         at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
>>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>         at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
>>>         at
>>> org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385)
>>>         at
>>> org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)
>>>         ... 79 more
>>> Caused by: java.lang.ClassNotFoundException:
>>> javax.servlet.ServletContextListener
>>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>>         ... 92 more
>>>
>>
>>
>> --
>> Willem
>> ----------------------------------
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.com (English)
>>          http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang
>>
>
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Mime
View raw message