[JBoss JIRA] (DROOLS-5406) Consolidated approach for dumping generated sources
by Mykhaylo Adamovych (Jira)
Mykhaylo Adamovych created DROOLS-5406:
------------------------------------------
Summary: Consolidated approach for dumping generated sources
Key: DROOLS-5406
URL: https://issues.redhat.com/browse/DROOLS-5406
Project: Drools
Issue Type: Story
Components: core engine
Affects Versions: 7.28.0.Final
Reporter: Mykhaylo Adamovych
Assignee: Mario Fusco
Using `drools.dump.dir = <String>` from KnowledgeBuilderConfiguration one can configure directory for dumping generated sources. New DRLs are generated out of decision tables and new java classes are generated out of DRLs into that location which makes it possible to analyze errors and have better understanding how code will actually work.
DSL parser uses different approach for dumping. It looks for `#result` switch and one need to configure logging for respective classes to see result of the parsing, see
{code}
org.drools.compiler.lang.dsl.DefaultExpander.expand(String drl)
{code}
Could it be consolidated approach used for all generated sources? Dump directory as a single place for all generated sources looks very handy. Could you please add respective logic for DefaultExpander to mimic
{code}
org.drools.compiler.builder.impl.KnowledgeBuilderImpl.generatedDrlToPackageDescr
{code} and dump generated sources into one place if respective property set?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson commented on DROOLS-5362:
----------------------------------------
While this is actually a bug in the implementation of the Maven client, changing this report to a "Feature Request" as workarounds seem to exist where needed. Note that this could trigger miscellaneous failures in various client projects where imported libraries are NOT compliant with this requirement.
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, Maven, kie-server, maven
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson updated DROOLS-5362:
-----------------------------------
Labels: Kie-Server Maven kie-server maven (was: Kie-Server kie-server)
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, Maven, kie-server, maven
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson commented on DROOLS-5362:
----------------------------------------
For the Gradle based folks, a workaround is to add the following to the build.gradle file:
{code}
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
jar {
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenJavaPublication }
rename ".*", "pom.xml"
}
}
{code}
I've tested this and this works. Additional details can be found at:
[https://stackoverflow.com/questions/37875932/generate-pom-xml-in-jar-with...]
[Gradle-1278|https://github.com/gradle/gradle/issues/1278]
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, kie-server
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson edited comment on DROOLS-5362 at 6/3/20 4:02 PM:
----------------------------------------------------------------
While the inclusion of the pom.xml & pom.properties file occurs by default for Maven projects:
http://maven.apache.org/shared/maven-archiver/#archive
this does not happen in all published projects and should therefore NOT be considered the "Correct" way of formatting a Jar. Apache Ant based projects are especially notorious for this. Some randomly picked libraries published to the Central Maven Repo without pom.xml files included:
mockito-core-1.9.5.jar
Requires:
* org.hamcrest:hamcrest-core
* org.objenesis:objenesis
xmlbeans-2.6.0.jar
Requires:
* stax:stax-api
commons-logging-api-1.1.jar
Requires:
* avalon-framework:avalon-framework
* javax.servlet:servlet-api
* log4j:log4j
* logkit:logkit
poi-3.17.jar (Java access to Microsoft Office files)
Requires:
* commons-codec:commons-codec
* org.apache.commons:commons-collections4
was (Author: northgorky):
While the inclusion of the pom.xml & pom.properties file occurs by default for Maven projects:
http://maven.apache.org/shared/maven-archiver/#archive
this does not happen in all published projects and should therefore NOT be considered the "Correct" way of formatting a Jar. Apache Ant based projects are especially notorious for this. Some randomly picked libraries published to the Central Maven Repo without pom.xml files included:
mockito-core-1.9.5.jar
Requires:
org.hamcrest:hamcrest-core
org.objenesis:objenesis
xmlbeans-2.6.0.jar
Requires:
stax:stax-api
commons-logging-api-1.1.jar
Requires:
avalon-framework:avalon-framework
javax.servlet:servlet-api
log4j:log4j
logkit:logkit
poi-3.17.jar (Java access to Microsoft Office files)
Requires:
commons-codec:commons-codec
org.apache.commons:commons-collections4
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, kie-server
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson updated DROOLS-5362:
-----------------------------------
Description:
If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
Initial Description:
When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
{code}
May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
SEVERE: Unable to build KieBaseModel:default-dependency-demo
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
Rule Compilation error : [Rule name='Inventory Item 001']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
Rule Compilation error : [Rule name='Inventory Item 002']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
Error importing : 'com.j2eeguys.demo.data.DemoData'
May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)
{code}
was:
If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
Initially:
When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
{code}
May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
SEVERE: Unable to build KieBaseModel:default-dependency-demo
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
Rule Compilation error : [Rule name='Inventory Item 001']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
Rule Compilation error : [Rule name='Inventory Item 002']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
Error importing : 'com.j2eeguys.demo.data.DemoData'
May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)
{code}
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, kie-server
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Dependencies not necessarily loaded
by Steve Davidson (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Steve Davidson updated DROOLS-5362:
-----------------------------------
Issue Type: Feature Request (was: Bug)
Description:
If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
Initially:
When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
{code}
May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
SEVERE: Unable to build KieBaseModel:default-dependency-demo
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
Rule Compilation error : [Rule name='Inventory Item 001']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
Rule Compilation error : [Rule name='Inventory Item 002']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
Error importing : 'com.j2eeguys.demo.data.DemoData'
May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)
{code}
was:
When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
{code}
May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
SEVERE: Unable to build KieBaseModel:default-dependency-demo
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
Rule Compilation error : [Rule name='Inventory Item 001']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
Rule Compilation error : [Rule name='Inventory Item 002']
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
Error importing : 'com.j2eeguys.demo.data.DemoData'
May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
jds cannot be resolved
jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Thread.java:834)
{code}
Priority: Minor (was: Major)
While the inclusion of the pom.xml & pom.properties file occurs by default for Maven projects:
http://maven.apache.org/shared/maven-archiver/#archive
this does not happen in all published projects and should therefore NOT be considered the "Correct" way of formatting a Jar. Apache Ant based projects are especially notorious for this. Some randomly picked libraries published to the Central Maven Repo without pom.xml files included:
mockito-core-1.9.5.jar
Requires:
org.hamcrest:hamcrest-core
org.objenesis:objenesis
xmlbeans-2.6.0.jar
Requires:
stax:stax-api
commons-logging-api-1.1.jar
Requires:
avalon-framework:avalon-framework
javax.servlet:servlet-api
log4j:log4j
logkit:logkit
poi-3.17.jar (Java access to Microsoft Office files)
Requires:
commons-codec:commons-codec
org.apache.commons:commons-collections4
> Dependencies not necessarily loaded
> -----------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, kie-server
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initially:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (WFLY-13556) Memory leak in FlashScope - expired elements are not cleared
by Farah Juma (Jira)
[ https://issues.redhat.com/browse/WFLY-13556?page=com.atlassian.jira.plugi... ]
Farah Juma updated WFLY-13556:
------------------------------
Description:
Objects in FlashScope is not cleared and keep accumulating even if POST-REDIRECT-BACK is completed.
If we put a huge object to FlashScope continuously as the following code, Java heap space will be exhausted soon.
{code:java}
@Model
public class Action {
private static final int oneHundredMB = 1024 * 1024 * 100;
public String next() {
Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
flash.putNow("huge", new byte[oneHundredMB]);
return "index.xhtml?faces-redirect=true";
}
}
{code}
When OutOfMemoryError is happened, flashInnerMap field in com.sun.faces.context.flash.ELFlash is bloated.
{noformat}
Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------
java.lang.Thread @ 0xeea24380 default task-1 Thread | 1 | 120 | 64 | 20,800
'- <Java Local> com.sun.faces.context.flash.ELFlash @ 0xee9e4608 | 1 | 40 | 64 | 64
'- flashInnerMap java.util.concurrent.ConcurrentHashMap @ 0xee9e4630| 1 | 64 | 64 | 314,574,048
-----------------------------------------------------------------------------------------------------------------------------------------
{noformat}
was:
*This is a regression agains the 7.2.z stream.*
Objects in FlashScope is not cleared and keep accumulating even if POST-REDIRECT-BACK is completed.
If we put a huge object to FlashScope continuously as the following code, Java heap space will be exhausted soon.
{code:java}
@Model
public class Action {
private static final int oneHundredMB = 1024 * 1024 * 100;
public String next() {
Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
flash.putNow("huge", new byte[oneHundredMB]);
return "index.xhtml?faces-redirect=true";
}
}
{code}
When OutOfMemoryError is happened, flashInnerMap field in com.sun.faces.context.flash.ELFlash is bloated.
{noformat}
Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------
java.lang.Thread @ 0xeea24380 default task-1 Thread | 1 | 120 | 64 | 20,800
'- <Java Local> com.sun.faces.context.flash.ELFlash @ 0xee9e4608 | 1 | 40 | 64 | 64
'- flashInnerMap java.util.concurrent.ConcurrentHashMap @ 0xee9e4630| 1 | 64 | 64 | 314,574,048
-----------------------------------------------------------------------------------------------------------------------------------------
{noformat}
> Memory leak in FlashScope - expired elements are not cleared
> ------------------------------------------------------------
>
> Key: WFLY-13556
> URL: https://issues.redhat.com/browse/WFLY-13556
> Project: WildFly
> Issue Type: Bug
> Components: JSF
> Reporter: Farah Juma
> Assignee: Bartosz Spyrko-Smietanko
> Priority: Major
>
> Objects in FlashScope is not cleared and keep accumulating even if POST-REDIRECT-BACK is completed.
> If we put a huge object to FlashScope continuously as the following code, Java heap space will be exhausted soon.
> {code:java}
> @Model
> public class Action {
> private static final int oneHundredMB = 1024 * 1024 * 100;
> public String next() {
> Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
> flash.putNow("huge", new byte[oneHundredMB]);
> return "index.xhtml?faces-redirect=true";
> }
> }
> {code}
> When OutOfMemoryError is happened, flashInnerMap field in com.sun.faces.context.flash.ELFlash is bloated.
> {noformat}
> Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
> -----------------------------------------------------------------------------------------------------------------------------------------
> java.lang.Thread @ 0xeea24380 default task-1 Thread | 1 | 120 | 64 | 20,800
> '- <Java Local> com.sun.faces.context.flash.ELFlash @ 0xee9e4608 | 1 | 40 | 64 | 64
> '- flashInnerMap java.util.concurrent.ConcurrentHashMap @ 0xee9e4630| 1 | 64 | 64 | 314,574,048
> -----------------------------------------------------------------------------------------------------------------------------------------
> {noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months