0

i am trying this solution for my application: Sending images using Http Post .(first answer) At frist i had problem with eclipse not wanting to import external jars, bat when i solved that problem i got this error:

The type org.apache.james.mime4j.message.SingleBody cannot be resolved. It is indirectly referenced from required .class files

on lines:

entity.addPart(nameValuePairs.get(index).getName(), new FileBody(new File(nameValuePairs.get(index).getValue())));

and

entity.addPart(nameValuePairs.get(index).getName(), new StringBody(nameValuePairs.get(index).getValue()));

any help?

Community
  • 1
  • 1
toskebre
  • 385
  • 2
  • 7
  • 18
  • http://stackoverflow.com/questions/1067655/how-to-upload-a-file-using-java-httpclient-library-working-with-php-strange-pr – BobTheBuilder Mar 19 '13 at 12:46
  • i was looking at that post, but there is nothing that can help me with this problem... – toskebre Mar 19 '13 at 12:49
  • Have you seen the second comment of the first answer? – BobTheBuilder Mar 19 '13 at 12:50
  • yes, but i am using httpmime-4.0.1.jar, and in post i was looking at (in post) it is not saying about importing httpClinet or httpCore jars, and they are much biger then this httpmime. So is there a way i can fix this without importing them insted? – toskebre Mar 19 '13 at 12:56
  • Problem solved. It just started working without any change. i dont know how and i dont know why... – toskebre Mar 21 '13 at 11:45

2 Answers2

1

Simple, The jar file which you are using is wrong file..

Same issue irritate me several times..

Download jar file from Grep code Which is Binary Download

the package name in Source Download jar file is not proper like org.apache.james.mime4j_.XXXXXX

and the Packages in Binary Download jar file is proper like org.apache.james.mime4j.XXXXXX

Wasted a lot of time on it today :( finally solved

Sandeep P
  • 4,291
  • 2
  • 26
  • 45
0

Having same problem and download the lib from here (only) solve the problem. I did download from other sites somehow they just did not resolved the problem.

lannyf
  • 9,865
  • 12
  • 70
  • 152