Overriding jar files on static classpath

4 次查看(过去 30 天)
I'm trying to get the AWS SDK jar file to work in matlab. I started by trying to simply import it and use it. When I do, it sort of works, but on every write I get this error:
Java exception occurred:
java.lang.IllegalStateException: Content has been consumed
at org.apache.http.entity.BasicHttpEntity.getContent(BasicHttpEntity.java:84)
at org.apache.http.conn.BasicManagedEntity.getContent(BasicManagedEntity.java:89)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:452)
at com.amazonaws.http.AmazonHttpClient.execute0(AmazonHttpClient.java:266)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:236)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3104)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1233)
at edu.xxxxx.aws.S3_Uploader.upload(S3_Uploader.java:31)
So I wrote a simple java class outside matlab to try to use my own version of the httpcore jar file. It works fine in eclipse, but if i import and run in matlab i get the same error. There is a httpcore jar file on the static classpath that seems to be getting used instead of the one I'm adding to the dynamic classpath, but it apparently is incompatible. Is there any way to get around this?
  1 个评论
Ameya Deoras
Ameya Deoras 2014-3-25
I commented out that JAR file ($matlabroot/java/jarext/axis2/httpcore.jar) in @matlabroot/toolbox/local/classpath.txt and confirmed that it fixes the issues. I'm sure this is not recommended as it will cause other bad things to happen, so try this at your own risk.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Java Package Integration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by