]
David Ward commented on DROOLS-340:
-----------------------------------
Just noting that I think this is a bigger issue than just developers wanting to use maven
to deploy their applications. This becomes more critical when administrators want to
remotely deploy applications from their operation consoles.
ClasspathKieProject fails vfs: path for jar deployments using mvn
jboss-as:deploy
---------------------------------------------------------------------------------
Key: DROOLS-340
URL:
https://issues.jboss.org/browse/DROOLS-340
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 6.0.0.CR5
Environment: JBoss EAP 6.1.1.GA + Drools 6.0.0.CR5 BRMS modules
Reporter: David Ward
Assignee: Mark Proctor
Priority: Critical
Attachments: jbossas-deploy-reproducer.zip
When copying a jar file into EAP’s standalone/deployments/ directory, creating a kie
classpath container works fine. However, when using maven to deploy the artifact (using
command mvn jboss-as:deploy), creating the kie classpth container fails.
I have a simple ejb3 jar deployment with a startup method that does simply this:
{code:java}
@PostConstruct
public void startup() {
KieServices.Factory.get().getKieClasspathContainer().newStatelessKieSession().execute("Success!");
}
{code}
When using mvn to deploy, error appear in the console:
{code}
08:27:45,230 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.1.1.GA
(AS 7.2.1.Final-redhat-10) started in 2034ms - Started 123 of 177 services (53 services
are passive or on-demand)
08:38:09,419 INFO [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900:
Content added at location
/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/data/content/8e/c31250ef5c6c166c43dcfa4cd54139db83f394/content
08:38:09,431 INFO [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015876:
Starting deployment of "jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar"
(runtime-name: "jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar")
08:38:09,566 INFO
[org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC
service thread 1-7) JNDI bindings for session bean named ReproducerStartup in deployment
unit deployment "jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar" are as follows:
java:global/jbossas-deploy-reproducer-0.0.1-SNAPSHOT/ReproducerStartup!org.reproducer.ReproducerStartup
java:app/jbossas-deploy-reproducer-0.0.1-SNAPSHOT/ReproducerStartup!org.reproducer.ReproducerStartup
java:module/ReproducerStartup!org.reproducer.ReproducerStartup
java:global/jbossas-deploy-reproducer-0.0.1-SNAPSHOT/ReproducerStartup
java:app/jbossas-deploy-reproducer-0.0.1-SNAPSHOT/ReproducerStartup
java:module/ReproducerStartup
08:38:09,765 INFO [org.drools.compiler.kie.builder.impl.ClasspathKieProject]
(ServerService Thread Pool -- 48) Found kmodule:
vfs:/content/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar/META-INF/kmodule.xml
08:38:09,767 INFO [org.drools.compiler.kie.builder.impl.ClasspathKieProject]
(ServerService Thread Pool -- 48) Virtual file physical path =
/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/tmp/vfs/temp2e479d76b6a51146/content-20c6cba0313c0c8d/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar
08:38:09,871 ERROR [org.drools.compiler.kie.builder.impl.ClasspathKieProject]
(ServerService Thread Pool -- 48) Unable to load pom.properties
from/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/tmp/vfs/temp2e479d76b6a51146/content-20c6cba0313c0c8d/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar
as jarPath cannot be found
/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/tmp/vfs/temp2e479d76b6a51146/content-20c6cba0313c0c8d/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar
08:38:09,871 ERROR [org.drools.compiler.kie.builder.impl.ClasspathKieProject]
(ServerService Thread Pool -- 48) Unable to load pom.properties
from/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/tmp/vfs/temp2e479d76b6a51146/content-20c6cba0313c0c8d/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar
/Users/errantepiphany/Packages/jboss/eap/jboss-eap-6.1/standalone/tmp/vfs/temp2e479d76b6a51146/content-20c6cba0313c0c8d/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar
(No such file or directory)
08:38:09,872 ERROR [org.drools.compiler.kie.builder.impl.ClasspathKieProject]
(ServerService Thread Pool -- 48) Unable to build index of kmodule.xml
url=vfs:/content/jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar/META-INF/kmodule.xml
null
08:38:09,876 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 48)
MSC000001: Failed to start service
jboss.deployment.unit."jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar".component.ReproducerStartup.START:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar".component.ReproducerStartup.START:
java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component
instance
at
org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at
org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:126)
at
org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
... 6 more
Caused by: javax.ejb.EJBException: java.lang.RuntimeException: Cannot find a default
StatelessKieSession
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:165)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:250)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:344)
at
org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at
org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
... 10 more
Caused by: java.lang.RuntimeException: Cannot find a default StatelessKieSession
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.findKieSessionModel(KieContainerImpl.java:271)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.newStatelessKieSession(KieContainerImpl.java:281)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.newStatelessKieSession(KieContainerImpl.java:277)
at org.reproducer.ReproducerStartup.startup(ReproducerStartup.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
at
org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at
org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
[jboss-as-ee-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248)
... 19 more
08:38:10,089 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870:
Deploy of deployment "jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar" was rolled
back with the following failure message:
{"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar\".component.ReproducerStartup.START"
=> "org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar\".component.ReproducerStartup.START:
java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component
instance
Caused by: javax.ejb.EJBException: java.lang.RuntimeException: Cannot find a default
StatelessKieSession
Caused by: java.lang.RuntimeException: Cannot find a default
StatelessKieSession"}}
08:38:10,103 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877:
Stopped deployment jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar (runtime-name:
jbossas-deploy-reproducer-0.0.1-SNAPSHOT.jar) in 14ms
{code}
The problem can be found by digging into this section of the code:
{code:java}
org.drools.compiler.kie.builder.impl.ClasspathKieProject.fetchKModule(URL) {
fetchKModule(URL, fixURLFromKProjectPath(url));
}
{code}
Basically, there is an assumption made that the jar is available inside the tmp/vfs/
directory. This is NOT the case when using the mvn jboss-as:deploy command. It IS the
case, however, when one copies/pastes the artifact into the standalone/deployments/
directory manually.
Please refer to the "Steps to Reproduce" section above for instructions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: