[jboss-jira] [JBoss JIRA] (DROOLS-474) java.lang.IllegalStateException: There's already another KieContainer created from a different ClassLoader

Mario Fusco (JIRA) issues at jboss.org
Mon May 5 11:02:57 EDT 2014


     [ https://issues.jboss.org/browse/DROOLS-474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-474.
--------------------------------

    Resolution: Rejected


I agreed with Charles that is not a bug in drools, but the problem was caused by the duplicated pom.properties file.

He correctly suggested that we could give a more understandable error message but at the moment I don't see how we could discover that the problem depends on the duplicated pom file there. The same exception could be actually caused by other similar misconfiguration, so just catching the exception and telling the user in a log message that he has a duplicated pom could be misleading.

> java.lang.IllegalStateException: There's already another KieContainer created from a different ClassLoader
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-474
>                 URL: https://issues.jboss.org/browse/DROOLS-474
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.1.0.Beta3
>            Reporter: Charles Moulliard
>            Assignee: Mario Fusco
>
> The following error/warn is generated when we deploy on Karaf the feature
> drools-decision-kie-blueprint-camel-example
> using kie-aries-blueprint
> {code}
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: kie://ksession1?action=insertBody due to: Cannot lookup: ksession1 from registry: org.apache.camel.blueprint.BlueprintContainerRegistry at 5d13728f with expected type: interface org.kie.api.runtime.CommandExecutor due: Error when instantiating bean ksession1 of class class org.kie.aries.blueprint.factorybeans.KieObjectsFactoryBean
> 	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:870)[322:org.apache.camel.camel-core:2.10.3]
> 	... 48 more
> Caused by: org.apache.camel.NoSuchBeanException: Cannot lookup: ksession1 from registry: org.apache.camel.blueprint.BlueprintContainerRegistry at 5d13728f with expected type: interface org.kie.api.runtime.CommandExecutor due: Error when instantiating bean ksession1 of class class org.kie.aries.blueprint.factorybeans.KieObjectsFactoryBean
> 	at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:58)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:62)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.kie.camel.component.KieEndpoint.configure(KieEndpoint.java:152)[384:org.kie.camel:6.1.0.20140429-1736]
> 	at org.kie.camel.component.KieEndpoint.<init>(KieEndpoint.java:114)[384:org.kie.camel:6.1.0.20140429-1736]
> 	at org.kie.camel.component.KieComponent.createEndpoint(KieComponent.java:56)[384:org.kie.camel:6.1.0.20140429-1736]
> 	at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)[322:org.apache.camel.camel-core:2.10.3]
> 	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461)[322:org.apache.camel.camel-core:2.10.3]
> 	... 57 more
> Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean ksession1 of class class org.kie.aries.blueprint.factorybeans.KieObjectsFactoryBean
> 	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:315)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_51]
> 	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:754)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:47)[330:org.apache.camel.camel-blueprint:2.10.3]
> 	at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:49)[322:org.apache.camel.camel-core:2.10.3]
> 	... 63 more
> Caused by: java.lang.IllegalStateException: There's already another KieContainer created from a different ClassLoader
> 	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:74)
> 	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:59)
> 	at org.kie.aries.blueprint.factorybeans.KieObjectsResolver.init(KieObjectsResolver.java:47)[386:org.kie.aries.blueprint:6.1.0.20140429-1736]
> 	at org.kie.aries.blueprint.factorybeans.KieObjectsResolver.<init>(KieObjectsResolver.java:42)[386:org.kie.aries.blueprint:6.1.0.20140429-1736]
> 	at org.kie.aries.blueprint.factorybeans.KieObjectsFactoryBean.createKieSession(KieObjectsFactoryBean.java:70)[386:org.kie.aries.blueprint:6.1.0.20140429-1736]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51]
> 	at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51]
> 	at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:313)[8:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
> 	... 74 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list