[
https://issues.apache.org/jira/browse/CAMEL-11382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16039712#comment-16039712
]
ASF GitHub Bot commented on CAMEL-11382:
----------------------------------------
GitHub user garyhodgson opened a pull request:
https://github.com/apache/camel/pull/1742
CAMEL-11382 - Creating IgniteComponent from Ignite Instance throws
IllegalStateException
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 it appears the lifecycleMode is ignored as it is only
set to COMPONENT_MANAGED and cannot be altered outside of the class.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/garyhodgson/camel CAMEL-11382
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1742.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1742
----
commit b99df4512b5403ff17f2250927b69f87a9b6619b
Author: Gary Hodgson <[email protected]>
Date: 2017-06-06T21:43:47Z
CAMEL-11382 - Creating IgniteComponent from Ignite Instance throws
IllegalStateException
----
> 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)