This is in the AttachmentInInterceptor which is VERY VERY early in the 
chain.   Very little has gone on at that point from a CXF side.   Thus, it 
looks like grails is still doing something funky with the input stream 
before CXF is getting it.   That's the area you may need to look at.

You can try registering the LoggingInInterceptor before the 
AttachmentInInterceptor and seeing what it sees.   It's a little tricky to 
do.  In spring, I think its:

<bean class="....LoggingInInterceptor">
    <property name="before">
         <list>
             <value>org.apache.cxf.interceptor.AttachmentInInterceptor</value>
          </list>
     </property>
</bean>



Dan


On Wednesday, March 07, 2012 01:00:49 PM Rahul Somasunderam wrote:
> I'm trying to create an endpoint using Grails + CXF. There is a WSDL that
> is provided by a standards body, and I have to use that as the contract
> for the web service. When I use JAXB to codegen from the WSDL, I get a
> class that looks like this:
> 
> public class ProvideAndRegisterDocumentSetRequestType {
>     ...
>     protected List<ProvideAndRegisterDocumentSetRequestType.Document>
> document;
> 
>     public static class Document {
>         @XmlValue
>         protected byte[] value;
> 
>         @XmlAttribute(name = "id", required = true)
>         @XmlSchemaType(name = "anyURI")
>         protected String id;
> 
>         ...
>     }
>     ...
> }
> 
> Now this document is what gets attached as a mime part.
> When I implemented this in a java project, it worked just fine. However
> when I started implementing this in a grails project I started getting an
> exception on calling the webservice.
> 
> 2012-03-07 11:27:41,464 [http-bio-8080-exec-8] ERROR StackTrace  - Full
> Stack Trace: org.apache.cxf.interceptor.Fault: Couldn't find MIME
> boundary: --MIMEBoundary_4a94e41e3eed5d193a8c2b8ac8fa17bec22927a6b89fb8a1
> at
> org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(Attachme
> ntInInterceptor.java:66) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCh
> ain.java:247) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiatio
> nObserver.java:113) at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestina
> tion.java:97) at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(Serv
> letController.java:458) at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletControll
> er.java:185) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSer
> vlet.java:148) at
> org.grails.cxf.GrailsCXFServlet.invoke(GroovyCXFServlet.groovy) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstra
> ctHTTPServlet.java:179) at
> org.grails.cxf.GrailsCXFServlet.handleRequest(GroovyCXFServlet.groovy) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPS
> ervlet.java:103) at
> org.grails.cxf.GrailsCXFServlet.doPost(GroovyCXFServlet.groovy) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTP
> Servlet.java:159) at
> org.grails.cxf.GrailsCXFServlet.service(GroovyCXFServlet.groovy)
> 
> I looked at another post
> (http://www.brimllc.com/2012/01/grails-cxf-web-service-with-mtom-attachme
> nts/) on Grails + CXF + MTOM that seems to suggest that I should be using
> DataHandler instead of byte[]. However since I'm building a
> contract-first webservice and using codegen, I can't do anything there.
> 
> I also implemented the suggestion that I should exclude '/services/*' in
> my UrlMappings to tell grails it shouldn't process what looks like
> attachments.
> 
> Does anyone have any suggestions?
> 
> R,
> rahul
-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to