Overriding jar files on static classpath

조회 수: 5 (최근 30일)
Dean
Dean 2013년 10월 29일
댓글: Ameya Deoras 2014년 3월 25일
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