0

xsltコンポーネントを使用するラクダのコンテキストがあります。ローカルの開発マシンでルートを実行しても、問題は発生しません。

しかし、プロジェクトをリモートサーバーにデプロイすると、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
4

1 に答える 1

0

問題を見つけました。

私はこの古いラクダプロジェクトをデーモンとして実行するように変換していました。プロジェクトが改ざんされたので、私はすべてのライブラリがリモートでフェッチされたと信じていました。どうやら、pomには、プロジェクトのgitリポジトリに含まれているローカルライブラリへのパスも含まれていました。実際に欠落しているjarは、XSLTコンポーネントに必要なSaxonjarでした。

そのため、プロジェクトをローカルで実行したとき、jarファイルがそこにあったため、問題は発生しませんでした。しかし、jarをビルドしてデプロイしたとき、Saxonjarは含まれていませんでした。

私の解決策:

新しいホストリポジトリをNexusServerに追加し、その依存関係をpomファイルに含めました。したがって、ローカル依存関係はもうありません。

于 2012-11-09T08:02:06.250 に答える