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 AB9F6D777 for ; Fri, 6 Jul 2012 14:23:33 +0000 (UTC) Received: (qmail 16158 invoked by uid 500); 6 Jul 2012 14:23:32 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 16123 invoked by uid 500); 6 Jul 2012 14:23:32 -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 16098 invoked by uid 99); 6 Jul 2012 14:23:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 14:23:31 +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 (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.217.173 as permitted sender) Received: from [209.85.217.173] (HELO mail-lb0-f173.google.com) (209.85.217.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 14:23:27 +0000 Received: by lbok6 with SMTP id k6so2351732lbo.32 for ; Fri, 06 Jul 2012 07:23:06 -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; bh=kx/2AuOtPO7+CWL4vWj60iK9zT8CdnzHpkaLGjyeZTs=; b=g9IcWSlIuhKBDiKPWrPuJ+vtpglActBoVzPnKS9e7zNAzw9w6F13dviJPQquDcZ/wZ ydRO1fo8o3B3w+SGL/8VoJy6vKqMi8EQRMKUniyP1Go8PfWTgqbJYuQJ7DO/Ju77/SS/ PBB7lgx/iyZqMh2kzFLs4lYIQfjlYCIVqbiMcO3ECsj+ybZjhRUjrxcOPwXnsC0UExB8 qv6yfhrWsnSbXozriPBuU3v99t64IEVvac+NpLcLlDTAFYcg1h0CJTWEM0AA3g5LN1cy uWbIIIWbm9zKTQJ0e040U4PoW2cYRExphGS668sotrewXZXveQtzYpPfXaYFDE6eOPPo D4iw== Received: by 10.152.114.3 with SMTP id jc3mr30523835lab.11.1341584586161; Fri, 06 Jul 2012 07:23:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.49.73 with HTTP; Fri, 6 Jul 2012 07:22:45 -0700 (PDT) In-Reply-To: <1341583461587-5715628.post@n5.nabble.com> References: <1341583461587-5715628.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 6 Jul 2012 16:22:45 +0200 Message-ID: Subject: Re: Attributes from RouteBuilder as beans in route To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Make sure to set the params attribue before Camel is starting, so its != null On Fri, Jul 6, 2012 at 4:04 PM, Hilde wrote: > Hello! > > We use the Java DSL to model Camel Routes. > The RouteBuilder class that we use for this very Route has an attribute and > we would like to use this > attribute as a bean inside the Route. > > Here is the code snippet: > > public class CreateScriptRoute extends RouteBuilder { > ... > private ScriptParams params; > > @Override > public void configure() throws Exception { > from("direct:createScriptTransformDBInit") > .routeId("createScriptTransformDBInit") > .bean(params) // that fails!!! > .choice() > > ... > > } > > However when I try I get the following error: > > Caused by: java.lang.IllegalArgumentException: bean, ref or beanType must be > provided > at > org.apache.camel.model.BeanDefinition.createProcessor(BeanDefinition.java:202) > at > org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:441) > at > org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179) > > Is there a way to use the attribute in the bean section of the Route anyway? > I need that instance > because it is injected especially for testing. > > Cheers > Hilde > > -- > View this message in context: http://camel.465427.n5.nabble.com/Attributes-from-RouteBuilder-as-beans-in-route-tp5715628.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen