Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C7174CD4C for ; Sat, 19 May 2012 10:07:38 +0000 (UTC) Received: (qmail 99891 invoked by uid 500); 19 May 2012 10:07:38 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 99736 invoked by uid 500); 19 May 2012 10:07:38 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 99719 invoked by uid 99); 19 May 2012 10:07:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2012 10:07:37 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.45 as permitted sender) Received: from [209.85.215.45] (HELO mail-lpp01m010-f45.google.com) (209.85.215.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2012 10:07:31 +0000 Received: by lahc1 with SMTP id c1so3213397lah.32 for ; Sat, 19 May 2012 03:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=JvU29C2UO627ZqmBPUlr8ZdS7ePqiMkfcaBs4oxy1nc=; b=GJHFwRVd6/hksgdPxXfCt8sIZdZIQuORxgeDjD0ExfNed8cLyXIvc6bKeN1azr2U6f L+CwU9HL56/DyNesMTUvC3xyH0sLNtdnfBk6hIm8EwNempRhZyPCYAUxsUoWDyiqjYuj VnhM/ww7gRlBixAuvxdSiZlnPD9l6ZaLkw6LgebBq1A9jHpcoyt8SfpkYWV3rpkhNrwv fxSvOGBOW0lIoReGOhwkeRsMtZ7bbwmS2AdiXL56cKMxNn1b5S7e4g1sakmpliNtLf1D sKskg/+ki0mD3FOtK0P40eQvNRB0qFn1vZK0dgQl2Xk7CiDb8fuhHlEs4zL+LskYxqM2 46mA== Received: by 10.152.104.44 with SMTP id gb12mr13879702lab.29.1337422031292; Sat, 19 May 2012 03:07:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.146.7 with HTTP; Sat, 19 May 2012 03:06:51 -0700 (PDT) In-Reply-To: <1337325204820-5711762.post@n5.nabble.com> References: <1337325204820-5711762.post@n5.nabble.com> From: Claus Ibsen Date: Sat, 19 May 2012 12:06:51 +0200 Message-ID: Subject: Re: with osgi service reference To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ThrowException must be a Throwable, not an interface. On Fri, May 18, 2012 at 9:13 AM, m.jimen.blazquez wrote: > Hi, > > I am trying to rethrow an excepcion in a . > > When I have this code: > > > =A0 =A0 =A0 =A0 > > > xmlns=3D"http://camel.apache.org/schema/spring"> > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 uri=3D"cxfrs:/servicios?resourceClasses=3DmyPackage.myEndpointService" /> > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 java.lang.= Exception > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > The exception is rethrown normally, but if I want the exception to be > rethrown by my own class registered as an osgi service: > > =A0 =A0 =A0 =A0interface=3D"myOtherPackage.ExceptionManager" /> > > xmlns=3D"http://camel.apache.org/schema/spring"> > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 uri=3D"cxfrs:/servicios?resourceClasses=3DmyPackage.myEndpointService" /> > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 java.lang.= Exception > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > public interface ExceptionManager{ > > =A0 =A0 =A0 =A0public void throwException(Exception e) throws Exception; > } > > I get the following exception: > > Caused by: java.lang.IllegalArgumentException: exception or ref must be > specified on: ThrowExc />eption[ref:exceptionManager] > at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:296) > =A0 =A0 =A0 =A0at > org.apache.camel.model.ThrowExceptionDefinition.createProcessor(ThrowExce= ptionDefinition.java:70) > =A0 =A0 =A0 =A0at > org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(Process= orDefinition.java:391) > =A0 =A0 =A0 =A0at > org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(Process= orDefinition.java:130) > > > Am I missing something? or this way of rethrowing only works with local > beans and no with osgi service references? > > kindest regards > > -- > View this message in context: http://camel.465427.n5.nabble.com/throwExce= ption-ref-with-osgi-service-reference-tp5711762.html > Sent from the Camel - Users mailing list archive at Nabble.com. --=20 Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/