Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7A4C9200C8C for ; Tue, 6 Jun 2017 23:43:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 78F81160BC6; Tue, 6 Jun 2017 21:43:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9BE2D160BB7 for ; Tue, 6 Jun 2017 23:43:22 +0200 (CEST) Received: (qmail 1195 invoked by uid 500); 6 Jun 2017 21:43:21 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 1169 invoked by uid 99); 6 Jun 2017 21:43:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2017 21:43:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5A718188A93 for ; Tue, 6 Jun 2017 21:43:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id jjtSMwmGH3xY for ; Tue, 6 Jun 2017 21:43:20 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id B649460DC5 for ; Tue, 6 Jun 2017 21:43:19 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1C0BEE0352 for ; Tue, 6 Jun 2017 21:43:19 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7758621E13 for ; Tue, 6 Jun 2017 21:43:18 +0000 (UTC) Date: Tue, 6 Jun 2017 21:43:18 +0000 (UTC) From: "Gary Hodgson (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-11382) Creating IgniteComponent from Ignite Instance throws IllegalStateException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 06 Jun 2017 21:43:23 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Hodgson updated CAMEL-11382: --------------------------------- Description: Creating an IgniteComponent from configuration works fine, but when I try and create one from an existing Ignite instance it throws an IllegalStateException when starting the component: "No configuration resource or IgniteConfiguration was provided to the Ignite component." Looking at the code [here|https://github.com/apache/camel/blob/master/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java#L77] it appears the lifecycleMode is ignored as it is only set to COMPONENT_MANAGED and cannot be altered outside of the class. The following patch sets the lifecycleMode USER_MANAGED when an ignite instance is set, which appears to resolve the problem. {code} diff --git a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java index eaf6583..e9efc79 100644 --- a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java +++ b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java @@ -121,6 +108,7 @@ */ public void setIgnite(Ignite ignite) { this.ignite = ignite; + lifecycleMode = IgniteLifecycleMode.USER_MANAGED; } /** {code} (github pull request to follow) was: Creating an IgniteComponent from configuration works fine, but when I try and create one from an existing Ignite instance it throws an exception when starting the component. Looking at the code [here|https://github.com/apache/camel/blob/master/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java#L77] it appears the lifecycleMode is ignored as it is only set to COMPONENT_MANAGED and cannot be altered outside of the class. The following patch sets the lifecycleMode USER_MANAGED when an ignite instance is set, which appears to resolve the problem. {code} diff --git a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java index eaf6583..e9efc79 100644 --- a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java +++ b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java @@ -121,6 +108,7 @@ */ public void setIgnite(Ignite ignite) { this.ignite = ignite; + lifecycleMode = IgniteLifecycleMode.USER_MANAGED; } /** {code} (github pull request to follow) > Creating IgniteComponent from Ignite Instance throws IllegalStateException > -------------------------------------------------------------------------- > > Key: CAMEL-11382 > URL: https://issues.apache.org/jira/browse/CAMEL-11382 > Project: Camel > Issue Type: Bug > Components: camel-ignite > Affects Versions: 2.19.0 > Reporter: Gary Hodgson > Priority: Minor > > Creating an IgniteComponent from configuration works fine, but when I try and create one from an existing Ignite instance it throws an IllegalStateException when starting the component: "No configuration resource or IgniteConfiguration was provided to the Ignite component." > Looking at the code [here|https://github.com/apache/camel/blob/master/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java#L77] it appears the lifecycleMode is ignored as it is only set to COMPONENT_MANAGED and cannot be altered outside of the class. > The following patch sets the lifecycleMode USER_MANAGED when an ignite instance is set, which appears to resolve the problem. > {code} > diff --git a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java > index eaf6583..e9efc79 100644 > --- a/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java > +++ b/components/camel-ignite/src/main/java/org/apache/camel/component/ignite/AbstractIgniteComponent.java > @@ -121,6 +108,7 @@ > */ > public void setIgnite(Ignite ignite) { > this.ignite = ignite; > + lifecycleMode = IgniteLifecycleMode.USER_MANAGED; > } > > /** > {code} > (github pull request to follow) -- This message was sent by Atlassian JIRA (v6.3.15#6346)