使用vfs:ftps(缺少FileURI)上载pdf时出错。可能的错误?

时间:2013-04-24 19:14:05

标签: wso2

我们有一个代理服务,从JasperReports服务器下载pdf文件,然后执行vfs:ftps将pdf上传到FTP服务器。下载部分工作正常,但我们正在努力与上传部分。这是我们的问题:

启动代理服务时,我们收到以下WARN消息(注意我们在配置中有一个参数FileURI):

WARN PollTableEntry transport.vfs.FileURI parameter is missing in the proxy service configuration

并且在运行请求时,我们得到如下异常:

[PassThroughMessageProcessor-2] ERROR Axis2Sender Unexpected error during sending message out
java.lang.NullPointerException
    at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
    at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
    at org.apache.commons.vfs2.provider.ftps.FtpsFileProvider.doCreateFileSystem(FtpsFileProvider.java:67)
    at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:104)
    at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:82)
    at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:66)
    at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:694)
    at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:650)
    at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:606)
    at org.apache.synapse.transport.vfs.VFSTransportSender.sendMessage(VFSTransportSender.java:134)
    at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
    at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
    at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:269)
    at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
    at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:230)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

我想知道它是否是潜在的错误或代理配置中的任何错误。

请帮助,谢谢!

这是代理配置xml:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="GenerateSecurityReport"
       transports="https http vfs"
       startOnLoad="true"
       trace="enable"
       statistics="enable">
   <description/>
   <parameter name="transport.vfs.FileURI">vfs:ftps://ftpUser:ftpPassword@ftp.host/path?vfs.passive=true</parameter>
   <parameter name="transport.vfs.ContentType">application/pdf</parameter>
   <target>
      <endpoint>
         <address uri="http://jasperServerHost/path/to/report.pdf"/>
      </endpoint>
      <inSequence>
         <log/>
         <property name="Authorization"
                   expression="fn:concat('Basic ', base64Encode('jasperUser:jasperPassword'))"
                   scope="transport"
                   type="STRING"/>
         <property name="product"
                   expression="fn:substring-after(get-property('To'), 'product=')"
                   scope="default"
                   type="STRING"/>
      </inSequence>
      <outSequence>
         <log/>
         <property name="CONTENT_TYPE"
                   value="application/pdf"
                   scope="axis2"
                   type="STRING"/>
         <property name="transport.vfs.ReplyFileName"
                   expression="fn:concat(get-property('product'), '_vendor_patches.pdf')"
                   scope="transport"/>
         <property name="OUT_ONLY" value="true"/>
         <property name="HTTP_SC" value="200" scope="axis2"/>
         <send>
            <endpoint>
               <address uri="vfs:ftps://ftpUser:ftpPassword@ftp.host/path?vfs.passive=true"/>
            </endpoint>
         </send>
         <payloadFactory>
            <format>
               <html xmlns="">
                  <body>success</body>
               </html>
            </format>
         </payloadFactory>
         <property name="Content-Type"
                   value="text/html"
                   scope="transport"
                   type="STRING"/>
         <send/>
      </outSequence>
   </target>
</proxy>

1 个答案:

答案 0 :(得分:0)

您是否定义了transport.vfs.FileNamePattern参数?

关注此sample