Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 44459 invoked from network); 21 Jan 2011 10:46:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jan 2011 10:46:11 -0000 Received: (qmail 51628 invoked by uid 500); 21 Jan 2011 10:46:11 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 51451 invoked by uid 500); 21 Jan 2011 10:46:08 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 51443 invoked by uid 500); 21 Jan 2011 10:46:07 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 51435 invoked by uid 99); 21 Jan 2011 10:46:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jan 2011 10:46:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jan 2011 10:46:06 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0LAjjZQ009992 for ; Fri, 21 Jan 2011 10:45:46 GMT Message-ID: <15148259.103621295606745889.JavaMail.jira@thor> Date: Fri, 21 Jan 2011 05:45:45 -0500 (EST) From: "Christian Schneider (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-3572) Camel transport for cxf does not forward exception to camel exchange In-Reply-To: <12343300.103351295606504984.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-3572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984673#action_12984673 ] Christian Schneider commented on CAMEL-3572: -------------------------------------------- I have tracked the problem to: public class CamelDestination extends AbstractDestination implements Configurable { protected class ConsumerProcessor implements Processor { public void process(Exchange exchange) { try { incoming(exchange); } catch (Throwable ex) { getLogger().log(Level.WARNING, "Failed to process incoming message: ", ex); } } } } By exchanging the logging with exchange.setException(ex); The processing error is correctly transmitted to the client and the exception on client side does not happen anymore. > 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.