Login  Register

[jira] Commented: (OFBIZ-70) EmailServices.storeIncomingEmail(EmailServices.java:643)-- String index out of range: -1

Posted by Nicolas Malin (Jira) on Jul 30, 2006; 3:25am
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-70-EmailServices-storeIncomingEmail-EmailServices-java-643-String-index-out-of-ra1-tp169170p169174.html

    [ http://issues.apache.org/jira/browse/OFBIZ-70?page=comments#action_12424343 ]
           
BJ Freeman commented on OFBIZ-70:
---------------------------------

some dontent types and dispositons not handled.
Note some are not as important as others.

Content-Type: multipart/report; report-type=disposition-notification;

this is important for locale
Content-Type: text/plain; charset=ISO-8859-1
Content-Type: text/plain; charset=us-ascii


Content-Type: message/disposition-notification; name="MDNPart2.txt"
Disposition: manual-action/MDN-sent-manually; displayed
Content-Type: text/plain; charset=UTF-8; format=flowed

Content-Type: multipart/mixed;
Content-Type: multipart/alternative;

Content-Disposition: attachment; filename="somefile.ext "
Content-Type: message/disposition-notification

Content-Type: multipart/related;
Content-Type: image/jpeg; <--image object

Content-Type: application/vnd.ms-excel; name="somefile.xls"  <-note the vnd.

> EmailServices.storeIncomingEmail(EmailServices.java:643)-- String index out of range: -1
> ----------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-70
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-70
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: content
>            Reporter: BJ Freeman
>
>  46701852[   ServiceMcaAction.java:69 :ERROR] String index out of range: -1
> 346702033[      EmailServices.java:747:ERROR]
> ---- runtime exception report --------------------------------------------------
> Exception: java.lang.StringIndexOutOfBoundsException
> Message: String index out of range: -1
> ---- stack trace ---------------------------------------------------------------
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> java.lang.String.substring(String.java:1444)
> com.businessesnetwork.communications.EmailServices.storeIncomingEmail(EmailServices.java:643)
> sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
>  l       int idx = contentTypeRaw.indexOf(";");
>  ine 643              contentType = contentTypeRaw.substring(0, idx);
> email being evaluated
> Content-Type: text/plain
> Content-Disposition: inline
> Content-Transfer-Encoding: 7bit
> MIME-Version: 1.0
> I think the indexof for a semicoln will  set idx to null
> so line 643 fails.
> should test for null then
> contentType = contentTypeRaw;

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira