[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
Geoffrey De Smet created DROOLS-1478:
----------------------------------------
Summary: Call ActivationUnMatchListener also when a rule rematches
Key: DROOLS-1478
URL: https://issues.jboss.org/browse/DROOLS-1478
Project: Drools
Issue Type: Enhancement
Components: core engine
Reporter: Geoffrey De Smet
Assignee: Mario Fusco
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (that doesn't work for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1478?page=com.atlassian.jira.plugi... ]
Geoffrey De Smet updated DROOLS-1478:
-------------------------------------
Description:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
was:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (that doesn't work for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
> Call ActivationUnMatchListener also when a rule rematches
> ---------------------------------------------------------
>
> Key: DROOLS-1478
> URL: https://issues.jboss.org/browse/DROOLS-1478
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
>
> ActivationUnMatchListener is part of kie-internal, so its *not public API*.
> *ActivationUnMatchListener is only used by OptaPlanner* (probably):
> jBPM and downstream drools module don't use it:
> https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
> Community users probably don't use it either, because no one mentions it on StackOverflow:
> https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
> The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
> For example, given this rule
> {code}
> global int score = 0;
> rule R
> when
> Wine(age < 10, $age : age)
> then
> score += $age;
> addUnmatchListener(() -> score -= $age);
> end
> {code}
> This works for a normal match and unmatch event:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 0; // GOOD
> {code}
> So events are like this:
> {code}
> RHS
> unmatch
> {code}
> However if we have a rematch:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 4;
> update(w);
> fireAllRules(); => no unmatch triggers => score = 13; // should be 6!
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 7; // should be 0!
> {code}
> Because the events are unbalanced:
> {code}
> RHS
> RHS
> unmatch
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (WFLY-8382) Elytron, unable to create custom principal transformer
by Jan Kalina (JIRA)
[ https://issues.jboss.org/browse/WFLY-8382?page=com.atlassian.jira.plugin.... ]
Jan Kalina moved WFCORE-2404 to WFLY-8382:
------------------------------------------
Project: WildFly (was: WildFly Core)
Key: WFLY-8382 (was: WFCORE-2404)
Component/s: Security
(was: Security)
> Elytron, unable to create custom principal transformer
> ------------------------------------------------------
>
> Key: WFLY-8382
> URL: https://issues.jboss.org/browse/WFLY-8382
> Project: WildFly
> Issue Type: Bug
> Components: Security
> Reporter: Martin Choma
> Assignee: Jan Kalina
> Priority: Blocker
>
> When I try to register custom principal transformer I get {{NoClassDefFoundError}}
> {code}
> 07:11:37,203 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.wildfly.extras.creaper.commands.elytron.mapper.AddCustomPrincipalTransformerImpl in Module "org.jboss.customprincipaltransformerimpl" from local module loader @282ba1e (finder: local module finder @13b6d03 (roots: /home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules,/home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules/system/layers/base)): java.lang.NoClassDefFoundError: Failed to link org/wildfly/extras/creaper/commands/elytron/mapper/AddCustomPrincipalTransformerImpl (Module "org.jboss.customprincipaltransformerimpl" from local module loader @282ba1e (finder: local module finder @13b6d03 (roots: /home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules,/home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules/system/layers/base))): org/wildfly/extension/elytron/capabilities/PrincipalTransformer
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:448)
> at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:276)
> at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:79)
> at org.jboss.modules.Module.loadModuleClass(Module.java:708)
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:192)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
> at org.wildfly.extension.elytron.CustomComponentDefinition$ComponentAddHandler.createValue(CustomComponentDefinition.java:156)
> at org.wildfly.extension.elytron.CustomComponentDefinition$ComponentAddHandler.lambda$performRuntime$1(CustomComponentDefinition.java:135)
> at org.wildfly.extension.elytron.TrivialService.start(TrivialService.java:53)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> 07:11:37,204 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service org.wildfly.security.principal-transformer.CreaperTestAddCustomPrincipalTransformer: org.jboss.msc.service.StartException in service org.wildfly.security.principal-transformer.CreaperTestAddCustomPrincipalTransformer: Failed to start service
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1978)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NoClassDefFoundError: Failed to link org/wildfly/extras/creaper/commands/elytron/mapper/AddCustomPrincipalTransformerImpl (Module "org.jboss.customprincipaltransformerimpl" from local module loader @282ba1e (finder: local module finder @13b6d03 (roots: /home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules,/home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules/system/layers/base))): org/wildfly/extension/elytron/capabilities/PrincipalTransformer
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:448)
> at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:276)
> at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:79)
> at org.jboss.modules.Module.loadModuleClass(Module.java:708)
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:192)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
> at org.wildfly.extension.elytron.CustomComponentDefinition$ComponentAddHandler.createValue(CustomComponentDefinition.java:156)
> at org.wildfly.extension.elytron.CustomComponentDefinition$ComponentAddHandler.lambda$performRuntime$1(CustomComponentDefinition.java:135)
> at org.wildfly.extension.elytron.TrivialService.start(TrivialService.java:53)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
> ... 3 more
> 07:11:37,207 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) WFLYCTL0013: Operation ("add") failed - address: ([
> ("subsystem" => "elytron"),
> ("custom-principal-transformer" => "CreaperTestAddCustomPrincipalTransformer")
> ]) - failure description: {
> "WFLYCTL0080: Failed services" => {"org.wildfly.security.principal-transformer.CreaperTestAddCustomPrincipalTransformer" => "org.jboss.msc.service.StartException in service org.wildfly.security.principal-transformer.CreaperTestAddCustomPrincipalTransformer: Failed to start service
> Caused by: java.lang.NoClassDefFoundError: Failed to link org/wildfly/extras/creaper/commands/elytron/mapper/AddCustomPrincipalTransformerImpl (Module \"org.jboss.customprincipaltransformerimpl\" from local module loader @282ba1e (finder: local module finder @13b6d03 (roots: /home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules,/home/mchoma/workspace/git-repositories/creaper/testsuite/standalone/target/jboss-as/modules/system/layers/base))): org/wildfly/extension/elytron/capabilities/PrincipalTransformer"},
> "WFLYCTL0412: Required services that are not installed:" => ["org.wildfly.security.principal-transformer.CreaperTestAddCustomPrincipalTransformer"]
> }
> {code}
> That works in DR11 without issue
> Here is implementation of used custom prncipal transformer
> {code:java|title=AddCustomPrincipalTransformerImpl.java}
> package org.wildfly.extras.creaper.commands.elytron.mapper;
> import org.wildfly.extension.elytron.Configurable;
> import java.security.Principal;
> import java.util.Map;
> import org.wildfly.extension.elytron.capabilities.PrincipalTransformer;
> public class AddCustomPrincipalTransformerImpl implements PrincipalTransformer, Configurable {
> @Override
> public Principal apply(Principal p) {
> return p;
> }
> @Override
> public void initialize(Map<String, String> configuration) {
> if (configuration.containsKey("throwException")) {
> throw new IllegalStateException("Only test purpose. This exception was thrown on demand.");
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (WFCORE-482) Add log4j2 support for WildFly
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-482?page=com.atlassian.jira.plugin... ]
James Perkins commented on WFCORE-482:
--------------------------------------
I've actually got a project that will actually write log4j2 messages to the logging subsystem, https://github.com/jamezp/log4j2-jboss-logmanager. A new project could be created and added to WildFly without too much of a problem.
The problem is I don't really know what users expect. If they include a log4j2 configuration file, then that will not be used. Things like async-loggers won't be used either.
I suppose the easiest approach is to just make the log4j2-jboss-logmanager an official project so logs are written via the logging subsystem. If users expect log4j2 to work with their own configuration they're going to have to exclude the dependencies provided by the server and handle it that way.
> Add log4j2 support for WildFly
> ------------------------------
>
> Key: WFCORE-482
> URL: https://issues.jboss.org/browse/WFCORE-482
> Project: WildFly Core
> Issue Type: Task
> Components: Logging
> Environment: Spring 3, Hibernate, Wicket, JBoss AS7
> Reporter: Amarkanth Ranganamayna
> Assignee: James Perkins
> Priority: Optional
>
> I am trying to use Flume Appender which comes with Log4j2 (log4j 1.x doesn't support flume appender) (AND) inorder to acheive this, I am looking at how to configure JBoss AS7 to use log4j2.
> Looks like Jboss AS7 by default use log4j 1.x
> Are you guys already working on using log4j2 ?
> If NOT, can you please suggest how to configure Jboss AS7 such that it picks up "log4j2.xml" file and doesn't use its own logging.
> Thanks,
> Amar
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month