Amazon s3连接器:IllegalArgumentException:使用getAuthorization时为空键

时间:2016-04-28 10:13:25

标签: amazon-s3 wso2 wso2esb wso2carbon connector

当使用Amazon s3连接器中的getAuthorization函数时,我得到以下跟踪:

 [2016-04-28 11:42:14,155] ERROR - AmazonS3AuthConnector Error occured in connect
or
java.lang.IllegalArgumentException: Empty key
        at javax.crypto.spec.SecretKeySpec.<init>(SecretKeySpec.java:94)
        at org.wso2.carbon.connector.amazons3.auth.AmazonS3Authentication.getAut
horizationHeaderValue(AmazonS3Authentication.java:79)
        at org.wso2.carbon.connector.amazons3.auth.AmazonS3AuthConnector.connect
(AmazonS3AuthConnector.java:102)
        at org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConn
ector.java:32)
        at org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.
java:78)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:81)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:48)
        at org.apache.synapse.mediators.template.TemplateMediator.mediate(Templa
teMediator.java:97)
        at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMe
diator.java:129)
        at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMe
diator.java:78)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:81)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:48)
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMe
diator.java:149)
        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(Pro
xyServiceMessageReceiver.java:175)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.axis2.transport.base.AbstractTransportListener.handleIncom
ingMessage(AbstractTransportListener.java:328)
        at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFS
TransportListener.java:751)
        at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirec
tory(VFSTransportListener.java:407)
        at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTranspo
rtListener.java:177)
        at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTranspo
rtListener.java:124)
        at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.
run(AbstractPollingTransportListener.java:67)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(Native
WorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
        at java.lang.Thread.run(Thread.java:745)

在查看代码时,似乎密钥应该在那里,因为没有抛出自定义的InvalidKeyException,而是javax.crypto抛出了java.lang.IllegalArgumentException。

我的调解员配置。

<amazons3.getAuthorization>
    <accessKeyId>********************</accessKeyId>
    <secretAccessKey>****************************************</secretAccessKey>
    <methodType>POST</methodType>
    <contentType>multipart/form-data</contentType>
    <bucketName>*********</bucketName>
    <uriRemainder>/</uriRemainder>
    <isXAmzDate>true</isXAmzDate>
</amazons3.getAuthorization>

我做错了什么?有人有这方面的经验吗?这个功能对其他人有用吗?

1 个答案:

答案 0 :(得分:0)

此错误已解决。显然,使用关键字段设置属性可以解决问题。