[JBoss JIRA] (DROOLS-5549) Drools model compilation fails when using object builders within method calls
by Ciprian Chiru (Jira)
[ https://issues.redhat.com/browse/DROOLS-5549?page=com.atlassian.jira.plug... ]
Ciprian Chiru updated DROOLS-5549:
----------------------------------
Description:
Given the example rule below:
{code:java}
import org.example.drools.model.*;
import java.util.Map;
global java.util.Set controlSet;
function String dummyFunction(Map m) {
return "test";
}
rule "will execute per each Measurement having ID color"
no-loop
when
Measurement( id == "color", $colorVal : val )
$val: String() from dummyFunction(Map.of($colorVal))
then
controlSet.add($colorVal);
end{code}
compiling the rule with kie-maven-plugin, it throws the error:
{code:java}
...target/generated-sources/drools-model-compiler/main/java/rules/Rules57a04348fad44377b9eacd9bb5741999RuleMethods0.java:[30,117] cannot find symbol
[ERROR] symbol: variable $colorVal
[ERROR] location: class rules.Rules57a04348fad44377b9eacd9bb5741999RuleMethods0{code}
Same rule when not pre-compiled returns the error:
{code:java}
[org.example.drools.service.RulesSession] (main) Message [id=1, kieBase=defaultKieBase, level=ERROR, path=/home/vagrant/git/drools-rules-engine-prototypes/drools-kjar-project/rules/target/classes/rules/dummy-rule.drl, line=-1, column=0
text=Unable to Analyse Expression dummyFunction(Map.of($colorVal)):
[Error: unable to resolve method using strict-mode: java.util.Map.of(java.lang.String)]
[Near : {... dummyFunction(Map.of($colorVal)) ....}] {code}
was:
Given the example rule below:
{code:java}
import org.example.drools.model.*;
import java.util.Map;
global java.util.Set controlSet;
function String dummyFunction(Map m) {
return "test";
}
rule "will execute per each Measurement having ID color"
no-loop
when
Measurement( id == "color", $colorVal : val )
$val: String() from dummyFunction(Map.entry($colorVal))
then
controlSet.add($colorVal);
end{code}
compiling the rule with kie-maven-plugin, it throws the error:
{code:java}
...target/generated-sources/drools-model-compiler/main/java/rules/Rules57a04348fad44377b9eacd9bb5741999RuleMethods0.java:[30,117] cannot find symbol
[ERROR] symbol: variable $colorVal
[ERROR] location: class rules.Rules57a04348fad44377b9eacd9bb5741999RuleMethods0{code}
Same code works fine if the rules are not pre-compiled.
> Drools model compilation fails when using object builders within method calls
> -----------------------------------------------------------------------------
>
> Key: DROOLS-5549
> URL: https://issues.redhat.com/browse/DROOLS-5549
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.31.0.Final, 7.32.0.Final, 7.33.0.Final, 7.34.0.Final, 7.35.0.Final, 7.36.0.Final, 7.37.0.Final, 7.38.0.Final, 7.39.0.Final, 7.40.0.Final
> Reporter: Ciprian Chiru
> Assignee: Mario Fusco
> Priority: Major
>
> Given the example rule below:
> {code:java}
> import org.example.drools.model.*;
> import java.util.Map;
> global java.util.Set controlSet;
> function String dummyFunction(Map m) {
> return "test";
> }
> rule "will execute per each Measurement having ID color"
> no-loop
> when
> Measurement( id == "color", $colorVal : val )
> $val: String() from dummyFunction(Map.of($colorVal))
> then
> controlSet.add($colorVal);
> end{code}
>
> compiling the rule with kie-maven-plugin, it throws the error:
> {code:java}
> ...target/generated-sources/drools-model-compiler/main/java/rules/Rules57a04348fad44377b9eacd9bb5741999RuleMethods0.java:[30,117] cannot find symbol
> [ERROR] symbol: variable $colorVal
> [ERROR] location: class rules.Rules57a04348fad44377b9eacd9bb5741999RuleMethods0{code}
>
> Same rule when not pre-compiled returns the error:
> {code:java}
> [org.example.drools.service.RulesSession] (main) Message [id=1, kieBase=defaultKieBase, level=ERROR, path=/home/vagrant/git/drools-rules-engine-prototypes/drools-kjar-project/rules/target/classes/rules/dummy-rule.drl, line=-1, column=0
> text=Unable to Analyse Expression dummyFunction(Map.of($colorVal)):
> [Error: unable to resolve method using strict-mode: java.util.Map.of(java.lang.String)]
> [Near : {... dummyFunction(Map.of($colorVal)) ....}] {code}
>
>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (WFLY-13697) JBoss CLI can't find java:app/AppName
by Michal Petrov (Jira)
[ https://issues.redhat.com/browse/WFLY-13697?page=com.atlassian.jira.plugi... ]
Michal Petrov commented on WFLY-13697:
--------------------------------------
[~cfang], can you advise? As far as I can tell the batch operation would have to retrieve the proper namespace context from the DeploymentUnit for this to work.
> JBoss CLI can't find java:app/AppName
> -------------------------------------
>
> Key: WFLY-13697
> URL: https://issues.redhat.com/browse/WFLY-13697
> Project: WildFly
> Issue Type: Bug
> Components: Batch, Management
> Affects Versions: JBoss AS7 7.2.0.Final
> Reporter: José Fernando Tepedino Martins
> Assignee: Michal Petrov
> Priority: Minor
> Labels: CLI, JNDI
>
> With a JEE aplication in a WAR package, when starting a functionality, as a Batch Job, via CLI, CDI injection and JNDI lookup fail to find resources 'java:app/AppName' and 'java:module/ModuleName'.
> For example, a job listener or other job artifact with the following code
> {code:java}
> @Resource(lookup="java:app/AppName")
> private String applicationName;{code}
> or
> {code:java}
> private String applicationName;
> @PostConstruct
> protected void initialize() throws NamingException {
> applicationName = InitialContext.doLookup("java:app/AppName");
> }{code}
> when the batch job is started from JBoss CLI, the following error will be logged:
> {code:java}
> javax.naming.NameNotFoundException: java:app/AppName
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (DROOLS-5549) Drools model compilation fails when using object builders within method calls
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5549?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-5549.
---------------------------------
Resolution: Rejected
Your code is invalid since in Java the method Map.entry(...) ( see [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Ma...] )
# take 2 arguments instead of one
# returns a Map.Entry and not a Map so you cannot use it as an argument to be passed to your dummy function
> Drools model compilation fails when using object builders within method calls
> -----------------------------------------------------------------------------
>
> Key: DROOLS-5549
> URL: https://issues.redhat.com/browse/DROOLS-5549
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.31.0.Final, 7.32.0.Final, 7.33.0.Final, 7.34.0.Final, 7.35.0.Final, 7.36.0.Final, 7.37.0.Final, 7.38.0.Final, 7.39.0.Final, 7.40.0.Final
> Reporter: Ciprian Chiru
> Assignee: Mario Fusco
> Priority: Major
>
> Given the example rule below:
> {code:java}
> import org.example.drools.model.*;
> import java.util.Map;
> global java.util.Set controlSet;
> function String dummyFunction(Map m) {
> return "test";
> }
> rule "will execute per each Measurement having ID color"
> no-loop
> when
> Measurement( id == "color", $colorVal : val )
> $val: String() from dummyFunction(Map.entry($colorVal))
> then
> controlSet.add($colorVal);
> end{code}
>
> compiling the rule with kie-maven-plugin, it throws the error:
> {code:java}
> ...target/generated-sources/drools-model-compiler/main/java/rules/Rules57a04348fad44377b9eacd9bb5741999RuleMethods0.java:[30,117] cannot find symbol
> [ERROR] symbol: variable $colorVal
> [ERROR] location: class rules.Rules57a04348fad44377b9eacd9bb5741999RuleMethods0{code}
>
> Same code works fine if the rules are not pre-compiled.
>
>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (WFLY-13721) Transaction JTS module misses dependencies to proper handling context propagation async calls
by Kabir Khan (Jira)
Kabir Khan created WFLY-13721:
---------------------------------
Summary: Transaction JTS module misses dependencies to proper handling context propagation async calls
Key: WFLY-13721
URL: https://issues.redhat.com/browse/WFLY-13721
Project: WildFly
Issue Type: Bug
Components: Transactions
Affects Versions: 20.0.0.Beta1
Reporter: Ondrej Chaloupka
Assignee: Ondrej Chaloupka
Fix For: 20.0.0.Final
The transaction JTS module misses the dependency with libraries which manage the reactive asynchronous handling for context propagation.
This is connected to JBTM-3246 which added the context propagation async handling capabilities to Narayana codebase.
The Narayana CDI interceptor is capable to handle reactive async code but it's dependent on reactive streams classes which have to be added as optional dependencies for `jts` module.
When the context propagation feature pack (https://github.com/kabir/wildfly-mp-reactive-feature-pack/) is deployed then these modules are provided into WildFly and the `jts` module will be then capable to use them and provide the context propagation capabilities managed in the feature pack.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (WFLY-13719) Error deploying EJB in WildFly when using @EJB
by Eduardo Martins (Jira)
[ https://issues.redhat.com/browse/WFLY-13719?page=com.atlassian.jira.plugi... ]
Eduardo Martins commented on WFLY-13719:
----------------------------------------
Assuming that the old behaviour was not correct I believe the system property solution makes more sense. We could also defer resolving the EJB to when needed but not sure that would not imply major changes and performance hit for the proper use cases.
> Error deploying EJB in WildFly when using @EJB
> ----------------------------------------------
>
> Key: WFLY-13719
> URL: https://issues.redhat.com/browse/WFLY-13719
> Project: WildFly
> Issue Type: Bug
> Components: EE, EJB
> Affects Versions: 20.0.1.Final
> Reporter: Chao Wang
> Priority: Major
> Attachments: reproducer.zip
>
>
> The following example does *not* get deployed on Wildfly 20.0.1.Final (since WFLY 13.0.0.Final):
> ~~~
> public class PleaseIgnoreMeThanks
> { @EJB private NonExistentEjbExampleLocal nonExistentEjbExample; }
> ~~~
> The issue seems to be on the @EJB annotation.
>
> Generated error:
> {code:xml}
> 10:19:19,025 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."ejb-in-war.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejb-in-war.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "ejb-in-war.war"
> at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
> at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
> at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
> at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
> at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
> at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
> at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEJB0406: No EJB found with interface of type 'org.jboss.as.quickstarts.ejbTimer.NonExistentEjbExampleLocal' for binding org.jboss.as.quickstarts.ejbTimer.PleaseIgnoreMeThanks/nonExistentEjbExample
> at org.jboss.as.ejb3@20.0.1.Final//org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:90)
> at org.jboss.as.ee@20.0.1.Final//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:269)
> at org.jboss.as.ee@20.0.1.Final//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:200)
> at org.jboss.as.server@12.0.3.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
> ... 8 more
> ~~{code}
>
> !moz-extension://4f9dc55f-98eb-44f6-97f9-1c9d85f3a188/icons/logo.png!
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (WFLY-13720) ee global-modules should not allow duplicates
by Bartosz Spyrko-Smietanko (Jira)
[ https://issues.redhat.com/browse/WFLY-13720?page=com.atlassian.jira.plugi... ]
Bartosz Spyrko-Smietanko moved JBEAP-20012 to WFLY-13720:
---------------------------------------------------------
Project: WildFly (was: JBoss Enterprise Application Platform)
Key: WFLY-13720 (was: JBEAP-20012)
Workflow: GIT Pull Request workflow (was: CDW with loose statuses v1)
Component/s: EE
(was: EE)
Fix Version/s: (was: 7.3.3.GA)
> ee global-modules should not allow duplicates
> ---------------------------------------------
>
> Key: WFLY-13720
> URL: https://issues.redhat.com/browse/WFLY-13720
> Project: WildFly
> Issue Type: Bug
> Components: EE
> Reporter: Bartosz Spyrko-Smietanko
> Assignee: Bartosz Spyrko-Smietanko
> Priority: Minor
>
> ee global-modules should not allow duplicates since once it is added once, it does not make sense to add a duplicate.
>
> {code:java}
> [standalone@embedded /] /subsystem=ee:list-add(name=global-modules, value={name=javax.api}) {code}
> Resulting in:
> {code:java}
> <subsystem xmlns="urn:jboss:domain:ee:4.0">
> <global-modules>
> <module name="javax.api"/>
> <module name="javax.api"/>
> </global-modules> {code}
>
> Or
> {code:java}
> [standalone@embedded /] /subsystem=ee:write-attribute(name=global-modules,value=[{name=javax.api},{name=javax.api}, {name=javax.api}])
> {code}
> Resulting in:
> {code:java}
> <subsystem xmlns="urn:jboss:domain:ee:4.0">
> <global-modules>
> <module name="javax.api"/>
> <module name="javax.api"/>
> <module name="javax.api"/>
> </global-modules> {code}
>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (DROOLS-5538) DMN strongly typed class compile errors for collection types
by Toshiya Kobayashi (Jira)
[ https://issues.redhat.com/browse/DROOLS-5538?page=com.atlassian.jira.plug... ]
Toshiya Kobayashi updated DROOLS-5538:
--------------------------------------
Description:
If we have an itemDefinition with isCollection="true", it will cause a compile error for InputSet and OutputSet when typesafe is enabled. Note that itemComponent with isCollection="true" works fine.
DMNRuntimeTypesTest.testCollectionType()
{code:xml}
<semantic:itemDefinition label="tPersonList" name="tPersonList" isCollection="true">
<semantic:typeRef>tPerson</semantic:typeRef>
</semantic:itemDefinition>
{code}
Consider separating TypeSafe specific tests:
https://github.com/kiegroup/drools/pull/2993#discussion_r463500865
was:
If we have an itemDefinition with isCollection="true", it will cause a compile error for InputSet and OutputSet when typesafe is enabled. Note that itemComponent with isCollection="true" works fine.
DMNRuntimeTypesTest.testCollectionType()
{code:xml}
<semantic:itemDefinition label="tPersonList" name="tPersonList" isCollection="true">
<semantic:typeRef>tPerson</semantic:typeRef>
</semantic:itemDefinition>
{code}
> DMN strongly typed class compile errors for collection types
> ------------------------------------------------------------
>
> Key: DROOLS-5538
> URL: https://issues.redhat.com/browse/DROOLS-5538
> Project: Drools
> Issue Type: Bug
> Components: dmn engine
> Affects Versions: 7.40.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> If we have an itemDefinition with isCollection="true", it will cause a compile error for InputSet and OutputSet when typesafe is enabled. Note that itemComponent with isCollection="true" works fine.
> DMNRuntimeTypesTest.testCollectionType()
> {code:xml}
> <semantic:itemDefinition label="tPersonList" name="tPersonList" isCollection="true">
> <semantic:typeRef>tPerson</semantic:typeRef>
> </semantic:itemDefinition>
> {code}
> Consider separating TypeSafe specific tests:
> https://github.com/kiegroup/drools/pull/2993#discussion_r463500865
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (DROOLS-5555) Solve test dmn files duplication
by Toshiya Kobayashi (Jira)
Toshiya Kobayashi created DROOLS-5555:
-----------------------------------------
Summary: Solve test dmn files duplication
Key: DROOLS-5555
URL: https://issues.redhat.com/browse/DROOLS-5555
Project: Drools
Issue Type: Task
Components: dmn engine
Affects Versions: 7.40.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Solve duplicated dmn files in strongly typed test cases.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months
[JBoss JIRA] (DROOLS-5554) Enhance generated sources annotation for DMNTypes
by Toshiya Kobayashi (Jira)
[ https://issues.redhat.com/browse/DROOLS-5554?page=com.atlassian.jira.plug... ]
Toshiya Kobayashi updated DROOLS-5554:
--------------------------------------
Description:
Add annotation to describe DMNTypes in generated sources (InputSet, OutputSet, composite types) for Swagger/OpenAPI. Especially, time related DMN types like time, duration are treated as Java interfaces like Temporal or TemporalAmount in order to accept several Java classes (for output purpose). So this kind of description is needed.
FYI)
https://github.com/kiegroup/drools/pull/2993#issuecomment-660898266
was:
Add annotation to describe DMNTypes to generated sources (InputSet, OutputSet, composite types) for Swagger/OpenAPI. Especially, time related DMN types like time, duration are treated as Java interfaces like Temporal or TemporalAmount in order to accept several Java classes (for output purpose). So this kind of description is needed.
FYI)
https://github.com/kiegroup/drools/pull/2993#issuecomment-660898266
> Enhance generated sources annotation for DMNTypes
> -------------------------------------------------
>
> Key: DROOLS-5554
> URL: https://issues.redhat.com/browse/DROOLS-5554
> Project: Drools
> Issue Type: Enhancement
> Components: dmn engine
> Affects Versions: 7.40.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> Add annotation to describe DMNTypes in generated sources (InputSet, OutputSet, composite types) for Swagger/OpenAPI. Especially, time related DMN types like time, duration are treated as Java interfaces like Temporal or TemporalAmount in order to accept several Java classes (for output purpose). So this kind of description is needed.
> FYI)
> https://github.com/kiegroup/drools/pull/2993#issuecomment-660898266
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 5 months