2013-03-19 1 views
0

낙타 경로에 문제가있어서 "dataFormats"태그를 인식하지 못합니다. 내 네임 스페이스에 문제가있을 수 있다고 생각하지만 정확히 모르겠습니다. 어떤 도움이라도 대단히 감사하겠습니다. 내 오류는 다음과 같습니다 :Camel Route, 요소 "dataFormats"로 시작하는 잘못된 콘텐츠가 발견되었습니다.

목표 org.apache.camel : camel-maven-plugin : 2.10.4 : 프로젝트 (ExactTargetSample)에서 실행 (default-cli)을 실행하지 못했습니다 : null : MojoExecutionException : InvocationTargetException : XML의 52 행 [C : \ EclipseWorkspaces \ EclipseWorkSpaceCurrent \ ApacheCamel \ target \ classes \ META-INF \ spring \ camel-context.xml] 파일의 문서가 유효하지 않습니다. 상자의 예외는 org.xml.sax.SAXParseException입니다. lineNumber : 52; columnNumber : 20; cvc-complex-type.2.4.a : 요소 'dataFormats'으로 시작하는 잘못된 콘텐츠가 발견되었습니다. 아 브로, "http://camel.apache.org/schema/spring": '{ "http://camel.apache.org/schema/spring"중 하나 beanio, "http://camel.apache.org/schema/spring"bindy, "http://camel.apache.org/schema/spring": 캐스터, "http://camel.apache.org/schema/spring"암호화 "http://camel.apache.org/schema/spring"CSV "http://camel.apache.org/schema/spring"사용자 정의 "http://camel.apache.org/schema/spring" flatpack, "http://camel.apache.org/schema/spring"GZIP, "http://camel.apache.org/schema/spring"HL7, "http://camel.apache.org/schema/spring"JAXB, "http://camel.apache.org/schema/spring"JiBX는 "http://camel.apache.org/schema/spring"JSON "http://camel.apache.org/schema/spring"protobuf, "http://camel.apache.org/schema/spring"RSS "http://camel.apache.org/schema/spring"secureXML, "http://camel.apache.org/schema/spring"직렬화 "http://camel.apache.org/schema/spring"soapjaxb, "http://camel.apache.org/schema/spring": 문자열, "http://camel.apache.org/schema/spring"시스템 로그, "http://camel.apache.org/schema/spring"tidyMarkup, "http://camel.apache.org/schema/spring"XML 빈스, "http://camel.apache.org/schema/spring"xmljson, "http://camel.apache.org/schema/spring": xstream, "http://camel.apache.org/schema/spring": pgp, "http://camel.apache.org/schema/spring": zip} '이 (가) 필요합니다. -> [도움말 1]


그리고 내 경로의 사본은 아래에서 확인할 수 있습니다

<?xml version="1.0" encoding="UTF-8"?> 

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:camel="http://camel.apache.org/schema/spring" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> 

<!-- load properties --> 

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
    <property name="locations" value="file:backend.properties" /> 
</bean> 
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent"> 
    <property name="location" value="file:backend.properties" /> 
</bean> 

<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> 
    <property name="brokerURL" value="tcp://0.0.0.0:61616?useLocalHost=true" /> 
</bean> 

<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"> 
    <property name="maxConnections" value="8" /> 
    <property name="maximumActive" value="500" /> 
    <property name="connectionFactory" ref="jmsConnectionFactory" /> 
</bean> 

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"> 
    <property name="connectionFactory" ref="pooledConnectionFactory" /> 
    <property name="transacted" value="false" /> 
    <property name="concurrentConsumers" value="1" /> 
</bean> 

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> 
    <property name="configuration" ref="jmsConfig" /> 
</bean> 

<!-- Custom Loaded Beans --> 

<bean id="TriggeredSendBean" class="com.backend.trigger.ClientTest"/> 

<!-- camel configuration --> 

<camel:camelContext xmlns="http://camel.apache.org/schema/spring"> 
    <dataFormats> 
     <json id="WelcomeEmail" library="Jackson" unmarshalTypeName="com.testObjects.EnrollResponse" /> 
    <dataFormats> 

    <camel:route id="genericMessageHandler" streamCache="true"> 
    <from uri="activemq:topic:Test.Central" /> 
    <unmarshal ref="WelcomeEmail" /> 

    <to uri = "bean:TriggeredSendBean?method=setup" /> 
    <to uri = "bean:TriggeredSendBean?method=addSubscriberAllList" /> 
    <to uri = "bean:TriggeredSendBean?method=sendWelcomeEmail" /> 

    </camel:route> 
</camel:camelContext> 

답변

1

모든 것이 좋아 보인다. 당신은 당신의 pom에 낙타 - 잭슨 의존성을 더하는 것을 놓칠 수 있습니다. 그냥 추측해라.

<dependency> 
     <groupId>org.apache.camel</groupId> 
     <artifactId>camel-jackson</artifactId> 
     <version>${camel-version}</version> 
    </dependency> 
+1

내 네임 스페이스 선언에 선언했기 때문에 "data"문자 앞에 "camel"을 넣는 것을 잊어 버렸습니다. 그것을 완전히 건너 뜁니다. 그래도 도와 ​​줘서 고마워! – parchambeau

+1

이 질문에 답변 할 수 있습니까? –

관련 문제