Overriding jar files on static classpath

5 views (last 30 days)
Dean
Dean on 29 Oct 2013
Commented: Ameya Deoras on 25 Mar 2014
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 Comment
Ameya Deoras
Ameya Deoras on 25 Mar 2014
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.

Sign in to comment.

Answers (0)

Categories

Find more on Java Package Integration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!