Amazon s3 connector: IllegalArgumentException: Empty key when using getAuthorization - amazon-s3

When using the getAuthorization function from the Amazon s3 connector I am getting the following trace:
[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)
When looking through the code it seems that the key should be there as the custom InvalidKeyException is not being thrown but rather the java.lang.IllegalArgumentException is being thrown by javax.crypto.
My mediator config.
<amazons3.getAuthorization>
<accessKeyId>********************</accessKeyId>
<secretAccessKey>****************************************</secretAccessKey>
<methodType>POST</methodType>
<contentType>multipart/form-data</contentType>
<bucketName>*********</bucketName>
<uriRemainder>/</uriRemainder>
<isXAmzDate>true</isXAmzDate>
</amazons3.getAuthorization>
What am I doing wrong? Anyone has any experience with this? Does this function work for others?

This error has been resolved. Apparently setting a property with the key fields fixes the problem.

Related

How to handle "Couldn't get any response" in mule?

I am trying to implement proper error handling in my code. There is a request component, which hits a specific api. I have to handle the scenario, where "server couldn't send a response" exception occurs.
Mule does not identify it as a HTTP:NOT FOUND error instead it identifies it as MULE:UNKNOWN.
How should I handle this case ? I want mule to identify it as a HTTP error.
EDIT:
How do I handle the MULE:UNKNOWN error type. I dont want to handle it under ANY and the compiler doesn't accept the type MULE : UNKNOWN. ?
org.mule.runtime.deployment.model.api.DeploymentException: Failed to
deploy artifact [] Caused by:
org.mule.runtime.api.exception.MuleRuntimeException:
org.mule.runtime.deployment.model.api.DeploymentInitException:
MuleRuntimeException: Could not find ErrorType for the given
identifier: 'MULE:UNKNOWN' Caused by:
org.mule.runtime.deployment.model.api.DeploymentInitException:
MuleRuntimeException: Could not find ErrorType for the given
identifier: 'MULE:UNKNOWN' Caused by:
org.mule.runtime.core.api.config.ConfigurationException: Could not
find ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by:
org.mule.runtime.api.lifecycle.InitialisationException: Could not find
ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by:
org.mule.runtime.api.lifecycle.LifecycleException: Could not find
ErrorType for the given identifier: 'MULE:UNKNOWN' Caused by:
org.mule.runtime.api.exception.MuleRuntimeException: Could not find
ErrorType for the given identifier: 'MULE:UNKNOWN'
HTTP:NOT FOUND means that the server returned an HTTP 404 (ie not found) response. If the server aborted the response for any reason it is not expected that the HTTP Requester to return a NOT FOUND. Having said that, the MULE:UNKNOWN error indicates an error that the component can not handle. You could try to update the version of the HTTP Connector to the last one to see if it has been improved to handle better that particular situation. Check the release notes to see if a newest one has been released.

Oracle Protocol violation SQLException

I am getting Oracle Protocol Violation SQLException when I am calling connection.commit(). I have read other post which are saying that it might be due to password is about to expire. But in my case it is not. Also jdbc driver should be fine because for some other engine I do not have such a problem. What else can be problem do you have any idea ?
at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Protocol violation
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C7Ocommoncall.doOCOMMIT(T4C7Ocommoncall.java:75)
at oracle.jdbc.driver.T4CConnection.doCommit(T4CConnection.java:558)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3674)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3680)
at oracle.jdbc.OracleConnectionWrapper.commit(OracleConnectionWrapper.java:140)
Generally the issue with the ojdbc7 jar. If the length of clob is 4193 characters, the driver fails to retrieve. Use new OJDBC7 patch jar
Happy Coding ..!!!

Error while connecting to documentum source

I am new to documentum,can any one help me how to resolve the following error
DfException:: THREAD: Thread-694; MSG: [DFC_BOF_CLASS_CACHE_INIT_ERROR] Failed to initialize class cache.; ERRORCODE: ff; NEXT: null
at com.documentum.fc.client.impl.bof.cache.NullClassCacheManager.checkCacheConsistency(NullClassCacheManager.java:46)
at com.documentum.fc.client.impl.bof.compoundclass.CompoundClassMgr.getImpClass(CompoundClassMgr.java:66)
at com.documentum.fc.client.impl.objectmanager.AbstractPersistentObjectFactory.getCompoundClassEntry(AbstractPersistentObjectFactory.java:39)
at com.documentum.fc.client.impl.objectmanager.PObjectFactoryWithAspects.makeObject(PObjectFactoryWithAspects.java:49)
at com.documentum.fc.client.impl.objectmanager.PersistentObjectManager.getObjectFromServer(PersistentObjectManager.java:356)
at com.documentum.fc.client.impl.objectmanager.PersistentObjectManager.getObject(PersistentObjectManager.java:311)
at com.documentum.fc.client.impl.session.Session.getObject(Session.java:963)
at com.documentum.fc.client.impl.session.SessionHandle.getObject(SessionHandle.java:653)
at com.gsk.rd.datacoe.documentum.DocumentumBot.processBotLogic(DocumentumBot.java:193)
at com.gsk.rd.datacoe.bots.BaseBot.processMessage(BaseBot.java:542)
at com.gsk.rd.datacoe.bots.BaseBot.fetchMessages(BaseBot.java:460)
at com.gsk.rd.datacoe.bots.BaseBot$1.run(BaseBot.java:185)
at java.lang.Thread.run(Thread.java:745)
I am using dfc.properties,can any one help me what is the cause of the above error
my dfc.properties file is
dfc.data.dir=./dfc
dfc.registry.mode=file
dfc.search.ecis.enable=false
dfc.search.ecis.host=
dfc.search.ecis.port=
dfc.tokenstorage.dir=./dfc/apptoken
dfc.tokenstorage.enable=false
dfc.docbroker.host[0]=random host_name
dfc.docbroker.port[0]=1489
#Additions 3/22
dfc.security.keystore.file=./dfc/dfc.keystore
dfc.session.secure_connect_default=try_native_first
dfc.globalregistry.repository[0]=random docbase
dfc.globalregistry.username=username
dfc.globalregistry.password=password
#dfc.cache.object.size=100
#dfc.session.pool.expiration_interval=10
does any values in dfc.properties is causing the above error?? please help me
Just to be sure: do you have actual values for host and global registry properties?
A DFC client only has one global registry hence this is wrong
dfc.globalregistry.repository[0]=random docbase
and should be
dfc.globalregistry.repository=random docbase

Pig: STORE with MongoInsertStorage don't work

I'm executing this simple code in a pig script:
REGISTER /home/myuser/mongodb/mongo-2.10.1.jar
REGISTER /opt/cloudera/parcels/CDH-4.5.0-1.cdh4.5.0.p0.30/lib/mongo-hadoop-cdh4-1.2.0/mongo-hadoop-core_cdh4.3.0-1.2.0.jar
REGISTER /opt/cloudera/parcels/CDH-4.5.0-1.cdh4.5.0.p0.30/lib/mongo-hadoop-cdh4-1.2.0/mongo-hadoop-pig_cdh4.3.0-1.2.0.jar
set mapred.map.tasks.speculative.execution false;
set mapred.reduce.tasks.speculative.execution false;
col = LOAD 'mongodb://localhost:27017/mydb.mycollection' using com.mongodb.hadoop.pig.MongoLoader ('id:chararray, companyId:chararray, ts:chararray', 'id');
STORE col INTO 'mongodb://localhost:27017/mydb.mycollection2' USING com.mongodb.hadoop.pig.MongoInsertStorage ('', '');
it returns the following error:
Location Config: Configuration: For URI: file:/tmp/temp449583595/tmp-109467318
2014-04-04 14:30:40,913 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2017: Internal error creating job configuration.
Details at logfile: /home/myuser/pig/pig_1396614639609.log
the end of file pig_1396614639609.log:
... at org.apache.hadoop.util.RunJar.main(RunJar.java:208) Caused
by: java.lang.IllegalArgumentException: Invalid URI Format. URIs must
begin with a mongodb:// protocol string. at
com.mongodb.hadoop.pig.MongoInsertStorage.setStoreLocation(MongoInsertStorage.java:159)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:576)
... 17 more
I don't know where is the error so that mongodb protocol string "mongodb://" is well-written.
I have a similar issue when running LOAD and STORE using mongo-hadoop on the same Pig script.
It throws
java.net.UnknownHostException: localhost:27017 is not a valid Inet address
at org.apache.hadoop.net.NetUtils.verifyHostnames(NetUtils.java:587)
at org.apache.hadoop.mapred.JobInProgress.initTasks(JobInProgress.java:734)
at org.apache.hadoop.mapred.JobTracker.initJob(JobTracker.java:3890)
at org.apache.hadoop.mapred.EagerTaskInitializationListener$InitJob.run(EagerTaskInitializationListener.java:79)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
I didn't investigate further, but either is a bug or some parameter related to locking. I don't know.
If I run the same code, but loading and storing in different scripts it runs without a problem.

WSO2 Identity Server: Error while loading identity configurations after editing identity.xml

I'm trying to set up an WSO2-Identity Server. I've downloaded the Version 4.0.0 Binary. It started correctly and I was able to use it with LDAP.
However, if I want to insert the correct ServerURL into the identity.xml file I get an error.
I inserted the follwoing into the identity.xml:
<OpenIDServerUrl>https://server.vm.uni-freiburg.de:9443/openidserver</OpenIDServerUrl>
<OpenIDUserPattern>https://server.vm.uni-freiburg.de:9443/openid/</OpenIDUserPattern>
and when starting the wso2 IS the following error is thrown:
[2012-11-23 10:34:41,510] ERROR {org.wso2.carbon.identity.core.util.IdentityConfigParser} - Error while loading Identity Configurations
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxIOException: Stream Closed
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:336)
at org.apache.axiom.om.impl.traverse.OMChildElementIterator.next(OMChildElementIterator.java:104)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.readChildElements(IdentityConfigParser.java:154)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.<init>(IdentityConfigParser.java:60)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.getInstance(IdentityConfigParser.java:71)
at org.wso2.carbon.identity.core.util.IdentityUtil.populateProperties(IdentityUtil.java:58)
at org.wso2.carbon.identity.sso.saml.ui.internal.SAMLSSOUIBundleActivator.start(SAMLSSOUIBundleActivator.java:33)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
Caused by: com.ctc.wstx.exc.WstxIOException: Stream Closed
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 20 more
Caused by: java.io.IOException: Stream Closed
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:214)
at com.ctc.wstx.io.ISOLatinReader.read(ISOLatinReader.java:79)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1046)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1053)
at com.ctc.wstx.sr.StreamScanner.getNextCharFromCurrent(StreamScanner.java:811)
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3206)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2832)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 23 more
However, if I leave the default values:
<OpenIDServerUrl>https://localhost:9443/openidserver</OpenIDServerUrl>
<OpenIDUserPattern>https://localhost:9443/openid/</OpenIDUserPattern>
the server starts normally.
I've found a Bug-Report from https://wso2.org/jira/browse/IDENTITY-407 which may be connected with the problem but is not the same.
What am I doing wrong? Thanks in advance!