0 Replies Latest reply on Feb 18, 2012 5:08 PM by ~= ziggy =~

    mime4j errors with reasteasy

    ~= ziggy =~ Newbie

      I have a Spring MVC and Resteasy based REST service that i need to test by sending a multipart/mixed request.

      The service is coded as follows:

      public String createMime(@Context ServletContext servletContext, MultipartInput input) throws Exception, IOException {

      .info("Processing /mixedMimeText");

      for(InputPart p : input.getParts()){
      .info("Headers : " + p.getHeaders());
      .info("MediaType : " + p.getMediaType());
      .info("Body : " +  p.getBodyAsString());
      .info("--------------------------------------------------- ");

      return "TEST";

      I am using the following file to send as the multipart mime content

      Content-Type: text/xml

      <?xml version="1.0" ?>
      <name>Joe Bloggs</name>
      <name>John Smith</name>

      Content-Type: text/xml



      I am sending the request using the curl client with the following command:

      curl -X POST http://localhost:8080/MyRestServices/restportal/services/mixedMimeText -i -H "Content-Type: multipart/mixed; boundary="--ABC123Boundary" -T myfile.txt

      The request does get to the service but all i see on the JBOSS terminal is that it produces the following error which does not really make sense. There is no stack trace or any other errors.

      21:48:37,174 WARN  [org.apache.james.mime4j.parser.MimeEntity] (http-- Unexpected end of headers detected. Higher level boundary detected or EOF reached.
      21:48:37,175 WARN  [org.apache.james.mime4j.parser.MimeEntity] (http-- Invalid header encountered
      21:48:37,176 WARN  [org.apache.james.mime4j.parser.MimeEntity] (http-- Body part ended prematurely. Boundary detected in header or EOF reached.

      It sounds like there is something wrong with the content but i am not quite sure.