[ https://issues.apache.org/jira/browse/CAMEL-3572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984734#action_12984734 ]
Christian Schneider commented on CAMEL-3572: -------------------------------------------- Yes. You are right about the marshalling but it is not so important as the exception in this place is rather a last resort. Normally the exceptions should be handled by cxf interceptors. > Camel transport for cxf does not forward exception to camel exchange > -------------------------------------------------------------------- > > Key: CAMEL-3572 > URL: https://issues.apache.org/jira/browse/CAMEL-3572 > Project: Camel > Issue Type: Bug > Components: camel-cxf > Reporter: Christian Schneider > Assignee: Christian Schneider > Fix For: 2.6.0 > > > I encountered a problem that happens if you run a route like > from("servlet:///test").to("direct:cxfendpoint") > Behind the direct endpoint there is a cxf jax-rs endpoint that is secured by > spring-security. If spring security denies access based on method annotations > it throws an AccessDeniedException. As JAX-RS does not handle it the > exception hits the CamelDestination. There it is only logged and swallowed. > As the client then gets no error it tries to handle the reponse with jaxb > which fails. (See below) > 21.01.2011 11:19:51 org.apache.cxf.jaxrs.provider.AbstractJAXBProvider > handleJAXBException > WARNUNG: javax.xml.bind.UnmarshalException > - with linked exception: > [com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog > at [row,col {unknown-source}]: [1,0]] > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:426) > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362) > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:332) > at > org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStream(JAXBElementProvider.java:229) > at > org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElementProvider.java:195) > at > org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:166) > at > org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:445) > at > org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:463) > at > org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:445) > at > org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:177) > at $Proxy18.getUsers(Unknown Source) > at client.RESTClient.sayHelloAsUser(RESTClient.java:63) > at client.RESTClient.main(RESTClient.java:34) > Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog > at [row,col {unknown-source}]: [1,0] > at > com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:682) > at > com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2090) > at > com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:1996) > at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100) > at > com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:160) > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360) > ... 11 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.