users@saaj.java.net

Re: [SAAJ-USR] Missing Start Boundary

From: V B Kumar Jayanti <Vbkumar.Jayanti_at_Sun.COM>
Date: Thu, 09 Oct 2008 16:57:25 +0530

dloy wrote:

> Hi Kumar
> Thanks for the response. I tried -Dsaaj.mime.optimization=false also
> setting directly using System.setProperty("saaj.mime.optimization",
> "false");
>
> Both java 1.6 and the latest saaj with 1.5 fail:
> ***saaj.mime.optimization=false -
> endpoint=http://localhost:8084/ingest/receiver
>
Atleaset the stack trace should be different when you set
saaj.mime.optimization to false, do you see that ?.

You should no longer see this :

java.lang.Exception: Missing Start Boundary, or boundary does not start
on a new line
at
com.sun.xml.internal.messaging.saaj.packaging.mime.internet.BMMimeMultipart.getNextPart(BMMimeMultipart.java:238)


Can you confirm.

> I switched the jars to the old saaj on the servlet client (java 1.5)
> and it worked.
>
> The behavior was the same as my original note: 1.6 and new saaj were
> not multi-part message (but heading indicated it was) and 1.5 with old
> saaj was multi-part.
>
> I will try to bring together the code into a simpler test case for you
> - this will probably be next week.
>
> Just as a note. I'm using the DataHandler approach for adding the
> attachment:
> AttachmentPart attachment =
> soapMessage.createAttachmentPart(new DataHandler(ipComponent));
> attachment.setContentId(ipComponent.getName());
> soapMessage.addAttachmentPart(attachment);
>
> public class IPComponent
> implements DataSource
> {...}
>
Will wait for your testcase.

Thanks for Reporting the Issue,
kumar

> Thanks again
> David
>
>
> V B Kumar Jayanti wrote:
>
>> \It could be a possible bug. Can you send me the code to reproduce
>> this. Meantime, the workaround for you is to fall back to the old
>> implementation. Here is how you can do that.
>>
>> set system property or use a -D in the VM command line :
>> System.setProperty("saaj.mime.optimization", "false");
>>
>> regards,
>> kumar
>>
>> dloy wrote:
>>
>>> I hope this is the right forum for this issue.
>>>
>>> I am getting the Missing Start Boundary exception from both java 1.6
>>> and for the latest saaj release (run in both 1.5 and 1.6).
>>>
>>> java.lang.Exception: Missing Start Boundary, or boundary does not
>>> start on a new line
>>> at
>>> com.sun.xml.internal.messaging.saaj.packaging.mime.internet.BMMimeMultipart.getNextPart(BMMimeMultipart.java:238)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:429)
>>>
>>>
>>> The exception does not occur in java 1.5 using a 4 year old version
>>> of the saaj jars. With both java 1.6 and the latest saaj the
>>> attachment on the client side is dropped and the the server code
>>> fails because the message separators don't exist. Using the old saaj
>>> on the client and the new saaj on the server works (on java 1.5).
>>>
>>> Below are dumps of the http headers, soap message, and exception.
>>> Note that the 1.5/old saaj version transmits the attachment as
>>> multipart/related with separators. 1.6 transmits with a
>>> multipart/related header but does not transmit the SOAP message as
>>> multi-part.
>>>
>>> I hope someone has an idea what may have changed between early saaj
>>> and the java 1.6 implementation that would prevent the transmission
>>> of an attachment - and how to get this working on java 1.6.
>>>
>>> I'm willing to send code snippets but they are fairly standard. The
>>> code is the same for both the successful and failed versions.
>>>
>>> Any help would be terrific. This has become a deal breaker for
>>> migrating to java 1.6.
>>>
>>> Thanks
>>> David Loy
>>> *********************************************************
>>>
>>> Java 1.5 with old saaj:
>>>
>>> Http headers:
>>> ***content-type=multipart/related; type="text/xml";
>>> boundary=1440568.1223392493425.JavaMail.dloy.CDL-dloy-1
>>> ***content-length=12168
>>> ***soapaction=""
>>> ***cache-control=no-cache
>>> ***pragma=no-cache
>>> ***user-agent=Java/1.5.0_04
>>> ***host=localhost:8084
>>> ***accept=text/html
>>> ***accept=image/gif
>>> ***accept=image/jpeg
>>> ***accept=*; q=.2
>>> ***accept=*/*; q=.2
>>> ***connection=keep-alive
>>>
>>> ---------------------
>>> SOAP Message:
>>>
>>> --1440568.1223392493425.JavaMail.dloy.CDL-dloy-1
>>> Content-Type: text/xml
>>>
>>> <SOAP-ENV:Envelope
>>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header>
>>>
>>> <Content-ID
>>> xmlns="http://schemas.cdlib.org/ingest-api">AddVersion</Content-ID></SOAP-ENV:Header>
>>>
>>> <SOAP-ENV:Body><cdl:AddVersion
>>> xmlns:cdl="http://schemas.cdlib.org"><requestType>AddVersion</requestType>
>>>
>>> ...
>>> </SOAP-ENV:Body></SOAP-ENV:Envelope>
>>> --1440568.1223392493425.JavaMail.dloy.CDL-dloy-1
>>> Content-Type: text/xml
>>> Content-Id: metadata
>>> Content-Location: /dpr/
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <mets:mets LABEL="Disdéri Stereoscopic Camera,
>>> ....
>>> </mets:div>
>>> </mets:structMap>
>>> </mets:mets>
>>> --1440568.1223392493425.JavaMail.dloy.CDL-dloy-1--
>>>
>>> *********************************************************
>>>
>>> Java 1.6 or latest saaj jars on 1.5 and 1.6
>>>
>>> Http headers:
>>> ***accept=text/xml
>>> ***accept=text/html
>>> ***accept=image/gif
>>> ***accept=image/jpeg
>>> ***accept=*; q=.2
>>> ***accept=*/*; q=.2
>>> ***content-type=multipart/related; type="text/xml";
>>> boundary="----=_Part_0_12572266.1223416939416"
>>> ***content-length=1107
>>> ***cache-control=no-cache
>>> ***pragma=no-cache
>>> ***user-agent=Java/1.6.0
>>> ***host=localhost:8084
>>> ***connection=keep-alive
>>> ---------------------
>>> SOAP Message (note: not multipart):
>>>
>>> <SOAP-ENV:Envelope
>>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header>
>>>
>>> <Content-ID
>>> xmlns="http://schemas.cdlib.org/ingest-api">AddVersion</Content-ID></SOAP-ENV:Header>
>>>
>>> <SOAP-ENV:Body><cdl:AddVersion
>>> xmlns:cdl="http://schemas.cdlib.org"><requestType>AddVersion</requestType>
>>>
>>> ...
>>> </SOAP-ENV:Body>
>>> </SOAP-ENV:Envelope>
>>>
>>> ---------------------
>>> EXCEPTION:
>>> Tue Oct 07 15:02:19 PDT 2008 ** (00) [IngestService] IngestService:
>>> Encountered error during handling of the request:
>>> com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to
>>> internalize messageTrace:
>>> com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to
>>> internalize message
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:475)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:278)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:68)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:62)
>>>
>>> at org.cdlib.framework.service.SOAPService.doPost(SOAPService.java:129)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>
>>> at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>
>>> at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: java.lang.Exception: Missing Start Boundary, or boundary
>>> does not start on a new line
>>> at
>>> com.sun.xml.internal.messaging.saaj.packaging.mime.internet.BMMimeMultipart.getNextPart(BMMimeMultipart.java:238)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:429)
>>>
>>> ... 18 more
>>>
>>> CAUSE:
>>>
>>> java.lang.Exception: Missing Start Boundary, or boundary does not
>>> start on a new line
>>> at
>>> com.sun.xml.internal.messaging.saaj.packaging.mime.internet.BMMimeMultipart.getNextPart(BMMimeMultipart.java:238)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:429)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:278)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:68)
>>>
>>> at
>>> com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:62)
>>>
>>> at org.cdlib.framework.service.SOAPService.doPost(SOAPService.java:129)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>
>>> at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>
>>> at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>>
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>
>>> at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>
>>> at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>
>>> at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>>>
>>> at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>>
>>> at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>> at java.lang.Thread.run(Thread.java:619)
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
>>> For additional commands, e-mail: users-help_at_saaj.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
>> For additional commands, e-mail: users-help_at_saaj.dev.java.net
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
> For additional commands, e-mail: users-help_at_saaj.dev.java.net
>