2012-03-16 245 views
0

我有以下途徑:問題與駱駝路線! (很沮喪)

<!-- RC get projects --> 
<route id="sqlRCprojects"> 
    <setBody> 
      <constant>SELECT [No_] FROM [navview].[dbo].[job] WHERE [Project Director] = 'RC';</constant> 
    </setBody> 
    <to uri="jdbc:sql2005navview?readSize=0"/> 
    <split> 
     <tokenize token=","/> 
     <setHeader headerName="project"> 
      <javaScript>request.body.substring(6, (""+request.body).length-1)</javaScript> 
      </setHeader> 
     <to uri="activemq:queue:test.line"/> 
    </split> 
    <to uri="mock:result"/> 
    </route> 

它使用這個bean:

<bean id="sql2005navview" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> 
<property name="url" value="jdbc:sqlserver://**.**:56395;databaseName=test" /> 
<property name="username" value="**" /> 
<property name="password" value="**" /> 

失敗與以下消息:

  INFO | Apache Camel 2.7.0 (CamelContext: camel) is shutdown in 0.009 seconds 
ERROR | Context initialization failed 
org.apache.camel.RuntimeCamelException: java.util.NoSuchElementException 
     at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139) 
     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) 
     at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) 
     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) 
     at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428) 
     at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) 
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) 
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) 
     at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:645) 
     at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:200) 
     at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:994) 
     at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:588) 
     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:380) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:338) 
     at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:229) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.server.Server.doStart(Server.java:242) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     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:597) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574) 
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 
     at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) 
     at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) 
     at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:114) 
     at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:114) 
     at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:70) 
     at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) 
     at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) 
     at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115) 
     at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74) 
     at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) 
     at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143) 
     at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) 
     at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85) 
     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:597) 
     at org.apache.activemq.console.Main.runTaskClass(Main.java:251) 
     at org.apache.activemq.console.Main.main(Main.java:107) 
Caused by: java.util.NoSuchElementException 
     at java.util.AbstractList$Itr.next(AbstractList.java:350) 
     at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1528) 
     at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1440) 
     at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1336) 
     at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164) 
     at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67) 
     at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54) 
     at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1314) 
     at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203) 
     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101) 
     ... 60 more 
WARN | Failed startup of context [email protected]@3b2ab74f/camel,file:/srv/apache-activemq-5.5.0/webapps/camel/ 
org.apache.camel.RuntimeCamelException: java.util.NoSuchElementException 
     at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139) 
     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) 
     at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238) 
     at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) 
     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) 
     at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428) 
     at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) 
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) 
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) 
     at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:645) 
     at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:200) 
     at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:994) 
     at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:588) 
     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:380) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:338) 
     at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:229) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.server.Server.doStart(Server.java:242) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     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:597) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574) 
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 
     at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) 
     at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) 
     at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:114) 
     at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:114) 
     at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:70) 
     at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) 
     at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) 
     at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115) 
     at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74) 
     at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) 
     at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143) 
     at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) 
     at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85) 
     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:597) 
     at org.apache.activemq.console.Main.runTaskClass(Main.java:251) 
     at org.apache.activemq.console.Main.main(Main.java:107) 
Caused by: java.util.NoSuchElementException 
     at java.util.AbstractList$Itr.next(AbstractList.java:350) 
     at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1528) 
     at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1440) 
     at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1336) 
     at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164) 
     at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67) 
     at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54) 
     at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1314) 
     at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203) 
     at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101) 
     ... 60 more 

回答

5

你路由缺少<from uri="someuri" />端點。

+0

大聲笑...很棒的漁獲 – 2012-03-16 16:37:58

+0

woops。解決了一切。謝謝 – ministry 2012-03-20 10:21:17