我正在尝试使用 MultipartEntityBuilder,遵循http://hilton.org.uk/blog/camel-multipart-form-data博客上有关使用 Camel 进行多部分表单编码的内容,但是当我编译它时,它说该包不存在? ?我在https://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntityBuilder.html上看到它
有谁知道这个问题的解决办法吗?谢谢你!
import java.lang.StringBuilder;
import java.net.URLEncoder;
import java.util.Base64;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.camel.LoggingLevel;
import org.apache.http.entity.mime.MultipartEntityBuilder;
Run Code Online (Sandbox Code Playgroud)
编译给出
java:[13,35] error: package org.apache.http.entity.mime does not exist
Run Code Online (Sandbox Code Playgroud) 无论我将数据格式放在XML DSL蓝图中的何处,都会在不同的地方开始出现此错误。如果删除它,它可以工作,但是我当然不能将JSON转换为POJO。??? 任何帮助或告诉我我在做错什么,我在想什么。谢谢!
错误
Unable to start blueprint container for bundle passthrumt1.core/1.0.1.SNAPSHOT
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'endpoint'. One of '{"http://camel.apache.org/schema/blueprint":redeliveryPolicyProfile, "http://camel.apache.org/schema/blueprint":onException, "http://camel.apache.org/schema/blueprint":onCompletion, "http://camel.apache.org/schema/blueprint":intercept, "http://camel.apache.org/schema/blueprint":interceptFrom, "http://camel.apache.org/schema/blueprint":interceptSendToEndpoint, "http://camel.apache.org/schema/blueprint":restConfiguration, "http://camel.apache.org/schema/blueprint":rest, "http://camel.apache.org/schema/blueprint":route}' is expected.
Run Code Online (Sandbox Code Playgroud)
XML DSL
<camelContext
id="com.passthru.coreCamelContext"
trace="true"
xmlns="http://camel.apache.org/schema/blueprint"
allowUseOriginalMessage="false"
streamCache="true"
errorHandlerRef="deadLetterErrorHandler" >
<properties>
<property key="http.proxyHost" value="PITC-Zscaler-Americas.proxy.corporate.com"/>
<property key="http.proxyPort" value="80"/>
</properties>
<streamCaching id="CacheConfig"
spoolUsedHeapMemoryThreshold="70"
anySpoolRules="true"/>
<!-- -->
<dataFormats>
<json id="Json2Pojo" library="Jackson" unmarshalTypeName="com.passthru.core.entities.TokenEntities">
</json>
</dataFormats>
<endpoint id="predixConsumer" uri="direct:preConsumer" />
<endpoint id="predixProducer" uri="direct:preProducer" />
<endpoint id="getToken" uri="direct:getToken" /> …Run Code Online (Sandbox Code Playgroud)