我有一个使用xslt组件的camel上下文。 当我在我的本地开发机器上运行我的路线时,我没有遇到任何问题。
但是当我在远程服务器上部署项目时,我遇到了xslt组件的一些问题。 我守护项目,所以我可以在后台运行,这可能是一个问题? 我检查了xsl文件的路径(测试了我日志中找到的路径),它们是正确的我甚至使用绝对路径。
有人有提示吗?或者想出为什么会出错?
错误日志记录了这些错误:
ERROR: 'Syntax error in '()'.'
FATAL ERROR: 'Could not compile stylesheet'
java.lang.reflect.InvocationTargetException
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.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:243)
Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route2 at: >>> To[ref:hoo_transformer] <<< in route: Route[[From[jms:incomingHoo]] -> [To[ref:hoo_transformer], T... because of Failed to resolve endpoint: ref://hoo_transformer due to: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hoo_transformer': FactoryBean threw exception on object creation; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1140)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:237)
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.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:219)
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 nl.kabisa.seacon.SwsDeamon.start(SwsDeamon.java:17)
... 5 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route2 at: >>> To[ref:hoo_transformer] <<< in route: Route[[From[jms:incomingHoo]] -> [To[ref:hoo_transformer], T... because of Failed to resolve endpoint: ref://hoo_transformer due to: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hoo_transformer': FactoryBean threw exception on object creation; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:773)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:174)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:610)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1514)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1306)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1213)
at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)
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.DefaultCamelContext.start(DefaultCamelContext.java:1191)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
... 18 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: ref://hoo_transformer due to: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hoo_transformer': FactoryBean threw exception on object creation; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:189)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:64)
at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:58)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:394)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:172)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:770)
... 29 more
Caused by: org.apache.camel.RuntimeCamelException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hoo_transformer': FactoryBean threw exception on object creation; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1140)
at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:56)
at org.apache.camel.component.ref.RefComponent.lookupEndpoint(RefComponent.java:52)
at org.apache.camel.component.ref.RefComponent.createEndpoint(RefComponent.java:41)
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:419)
... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hoo_transformer': FactoryBean threw exception on object creation; nested exception is org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1414)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:245)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079)
at org.apache.camel.spring.spi.ApplicationContextRegistry.lookup(ApplicationContextRegistry.java:41)
at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54)
... 42 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://file:/var/java/sws/xslt/transform_hoo.xsl due to: Could not compile stylesheet
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
at org.apache.camel.core.xml.AbstractCamelEndpointFactoryBean.getObject(AbstractCamelEndpointFactoryBean.java:57)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 49 more
Caused by: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:843)
at org.apache.camel.builder.xml.XsltBuilder.setTransformerSource(XsltBuilder.java:231)
at org.apache.camel.builder.xml.XsltBuilder.setTransformerInputStream(XsltBuilder.java:261)
at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:120)
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:419)
... 51 more
Cannot start daemon
Service exit with a return value of 5
答案 0 :(得分:0)
我发现了这个问题。
我正在将这个旧的camel项目转换为守护进程。 因为该项目是mavenized我相信每个lib都是远程获取的。 显然,pom还包含一个本地库的路径,包含在项目的git仓库中。 缺少的实际jar是XSLT组件所需的Saxon jar。
因此,当我在本地运行项目时,我没有遇到任何问题,因为罐子在那里。 但是当我制造罐子并展开它时,撒克逊罐子没有被包括在内。
我的解决方案:
我在Nexus Server中添加了一个新的托管存储库,并将该依赖项包含在pom文件中。所以不再有本地依赖。