Quartz作业已经存在,名称/ group包含spring mvc和camel

时间:2014-06-12 09:01:17

标签: java spring spring-mvc apache-camel

您好我得到以下异常

org.apache.camel.FailedToCreateRouteException: Failed to create route healthCheckRoute: Route(healthCheckRoute)[[From[quartz://healthCheck?cron={{sf... because of Failed to resolve endpoint: quartz://healthCheck?cron=0%2F30+*+*+*+*+%3F due to: A Quartz job already exists with the name/group: healthCheck/Camel
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:182)
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:724)

当我部署并启动我的spring mvc web应用程序时会发生这种情况。虽然相同的工作上的孤立测试用例很好。有人知道这个问题。

请嘻嘻

1 个答案:

答案 0 :(得分:2)

似乎使用相同的camelContext ID配置了两个Camel路由。检查他们的ID并在它们相同的情况下进行更改。还要检查你是否两次没有加载Camel上下文,因为这会产生相同的错误。

另请看一下:

https://issues.apache.org/jira/browse/CAMEL-5259