[JBoss JIRA] (DROOLS-574) str operator in 'accumulate', with operand from 'from', results in NPE at KB build
by Matteo Mortari (JIRA)
[ https://issues.jboss.org/browse/DROOLS-574?page=com.atlassian.jira.plugin... ]
Matteo Mortari commented on DROOLS-574:
---------------------------------------
ps: for option 1 I've considered it, as I expect it would fall back to the MVEL's {{contains}} operator, not strictly the Drool's operator which by the doc should work only on Collections; in this case I understand the MVEL's operator kicks in and work between two String.
> str operator in 'accumulate', with operand from 'from', results in NPE at KB build
> ----------------------------------------------------------------------------------
>
> Key: DROOLS-574
> URL: https://issues.jboss.org/browse/DROOLS-574
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.1.0.Final
> Reporter: Matteo Mortari
> Assignee: Mark Proctor
> Attachments: 20140813.drools6test.strStandardEvInAccumulate.zip
>
>
> This is an exercise for "group by" words.
> Consider the following pattern for realizing a "group by" by means of from/accumulate/count : the goal is to count Messages which starts with preferred keyword, if the count for a keyword is >= 2, then rule should fire.
> {code}
> declare GroupByString
> groupId : String
> groups : String[]
> end
> rule "init words of my interest"
> no-loop
> when
> then
> GroupByString grp = new GroupByString();
> grp.setGroupId("wordGroup");
> grp.setGroups(new String[]{"ciao", "bella"});
> insert(grp);
> end
> rule "group by word and count if >=2 then "
> no-loop
> when
> $group : GroupByString( groupId == "wordGroup")
> $word : String() from $group.groups
> accumulate ( $msg : Message( text str[startsWith] $word ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
> insert(new Integer($count.intValue()));
> end
> {code}
> However trying to compile the KB with the kie-maven-plugin fails with this NPE and stacktrace (snippet):
> {noformat}
> java.lang.NullPointerException
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.buildExternalFunctionCall(JavaAccumulateBuilder.java:182)
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:101)
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:66)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:320)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:138)
> at org.drools.compiler.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:66)
> at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:89)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addRule(KnowledgeBuilderImpl.java:1652)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRules(KnowledgeBuilderImpl.java:968)
> {noformat}
> I've also noticed the following 2 aspects:
> 1-/ If you use another operator instead of {{str startsWith}}, for instance you replace with the {{contains}} operators, it does compile the KB successfully. In this scenario would change the exercise to "count Messages which _contains_ the preferred keyword", but it works:
> {code}
> rule "group by word and count if >=2 then "
> no-loop
> when
> $group : GroupByString( groupId == "wordGroup")
> $word : String() from $group.groups
> accumulate ( $msg : Message( text contains $word ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
> insert(new Integer($count.intValue()));
> end
> {code}
> 2-/ If you use an hard-coded operand in the {{str startsWith}}, it works too. For instance if you hard-code the rule as:
> {code}
> rule "group by word and count if >=2 then "
> no-loop
> when
> accumulate ( $msg : Message( text str[startsWith] "ciao" ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> insert(new Integer($count.intValue()));
> end
> {code}
> It does not give NPE at KB build and executes as expected.
> For my application it's okay to deal with the first option above, but anyway I thought worthy to report a JIRA. I will attach reproducer. Ciao
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (JGRP-1866) Broken Links on JBoss.org
by Paul Robinson (JIRA)
[ https://issues.jboss.org/browse/JGRP-1866?page=com.atlassian.jira.plugin.... ]
Paul Robinson commented on JGRP-1866:
-------------------------------------
[~dcoughlin1] yes, you need to request [~lvlcek] to re-index the project data. It is currently done manually.
> Broken Links on JBoss.org
> -------------------------
>
> Key: JGRP-1866
> URL: https://issues.jboss.org/browse/JGRP-1866
> Project: JGroups
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: Daniel Coughlin
> Assignee: Bela Ban
> Fix For: 3.5
>
>
> The following broken link is currently listed against this project on www.jboss.org/projects.
> git@github.com:belaban/JGroups.git - Committer Git
> If you maintain a project.properties file that you have told the jboss.org team about, then you just need to fix it in there and the change will be reflected on the site. Otherwise, you need to update the data on this project's Magnolia page.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (DROOLS-574) str operator in 'accumulate', with operand from 'from', results in NPE at KB build
by Matteo Mortari (JIRA)
[ https://issues.jboss.org/browse/DROOLS-574?page=com.atlassian.jira.plugin... ]
Matteo Mortari updated DROOLS-574:
----------------------------------
Attachment: 20140813.drools6test.strStandardEvInAccumulate.zip
Attaching the reproducer.
> str operator in 'accumulate', with operand from 'from', results in NPE at KB build
> ----------------------------------------------------------------------------------
>
> Key: DROOLS-574
> URL: https://issues.jboss.org/browse/DROOLS-574
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.1.0.Final
> Reporter: Matteo Mortari
> Assignee: Mark Proctor
> Attachments: 20140813.drools6test.strStandardEvInAccumulate.zip
>
>
> This is an exercise for "group by" words.
> Consider the following pattern for realizing a "group by" by means of from/accumulate/count : the goal is to count Messages which starts with preferred keyword, if the count for a keyword is >= 2, then rule should fire.
> {code}
> declare GroupByString
> groupId : String
> groups : String[]
> end
> rule "init words of my interest"
> no-loop
> when
> then
> GroupByString grp = new GroupByString();
> grp.setGroupId("wordGroup");
> grp.setGroups(new String[]{"ciao", "bella"});
> insert(grp);
> end
> rule "group by word and count if >=2 then "
> no-loop
> when
> $group : GroupByString( groupId == "wordGroup")
> $word : String() from $group.groups
> accumulate ( $msg : Message( text str[startsWith] $word ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
> insert(new Integer($count.intValue()));
> end
> {code}
> However trying to compile the KB with the kie-maven-plugin fails with this NPE and stacktrace (snippet):
> {noformat}
> java.lang.NullPointerException
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.buildExternalFunctionCall(JavaAccumulateBuilder.java:182)
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:101)
> at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:66)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:320)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:138)
> at org.drools.compiler.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:66)
> at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:89)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addRule(KnowledgeBuilderImpl.java:1652)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRules(KnowledgeBuilderImpl.java:968)
> {noformat}
> I've also noticed the following 2 aspects:
> 1-/ If you use another operator instead of {{str startsWith}}, for instance you replace with the {{contains}} operators, it does compile the KB successfully. In this scenario would change the exercise to "count Messages which _contains_ the preferred keyword", but it works:
> {code}
> rule "group by word and count if >=2 then "
> no-loop
> when
> $group : GroupByString( groupId == "wordGroup")
> $word : String() from $group.groups
> accumulate ( $msg : Message( text contains $word ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
> insert(new Integer($count.intValue()));
> end
> {code}
> 2-/ If you use an hard-coded operand in the {{str startsWith}}, it works too. For instance if you hard-code the rule as:
> {code}
> rule "group by word and count if >=2 then "
> no-loop
> when
> accumulate ( $msg : Message( text str[startsWith] "ciao" ) over window:time( 5m ) ;
> $list : collectList( $msg ),
> $count : count( $msg );
> $count >= 2
> )
> then
> insert(new Integer($count.intValue()));
> end
> {code}
> It does not give NPE at KB build and executes as expected.
> For my application it's okay to deal with the first option above, but anyway I thought worthy to report a JIRA. I will attach reproducer. Ciao
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (DROOLS-574) str operator in 'accumulate', with operand from 'from', results in NPE at KB build
by Matteo Mortari (JIRA)
Matteo Mortari created DROOLS-574:
-------------------------------------
Summary: str operator in 'accumulate', with operand from 'from', results in NPE at KB build
Key: DROOLS-574
URL: https://issues.jboss.org/browse/DROOLS-574
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 6.1.0.Final
Reporter: Matteo Mortari
Assignee: Mark Proctor
This is an exercise for "group by" words.
Consider the following pattern for realizing a "group by" by means of from/accumulate/count : the goal is to count Messages which starts with preferred keyword, if the count for a keyword is >= 2, then rule should fire.
{code}
declare GroupByString
groupId : String
groups : String[]
end
rule "init words of my interest"
no-loop
when
then
GroupByString grp = new GroupByString();
grp.setGroupId("wordGroup");
grp.setGroups(new String[]{"ciao", "bella"});
insert(grp);
end
rule "group by word and count if >=2 then "
no-loop
when
$group : GroupByString( groupId == "wordGroup")
$word : String() from $group.groups
accumulate ( $msg : Message( text str[startsWith] $word ) over window:time( 5m ) ;
$list : collectList( $msg ),
$count : count( $msg );
$count >= 2
)
then
System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
insert(new Integer($count.intValue()));
end
{code}
However trying to compile the KB with the kie-maven-plugin fails with this NPE and stacktrace (snippet):
{noformat}
java.lang.NullPointerException
at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.buildExternalFunctionCall(JavaAccumulateBuilder.java:182)
at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:101)
at org.drools.compiler.rule.builder.dialect.java.JavaAccumulateBuilder.build(JavaAccumulateBuilder.java:66)
at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:320)
at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:138)
at org.drools.compiler.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:66)
at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:89)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addRule(KnowledgeBuilderImpl.java:1652)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRules(KnowledgeBuilderImpl.java:968)
{noformat}
I've also noticed the following 2 aspects:
1-/ If you use another operator instead of {{str startsWith}}, for instance you replace with the {{contains}} operators, it does compile the KB successfully. In this scenario would change the exercise to "count Messages which _contains_ the preferred keyword", but it works:
{code}
rule "group by word and count if >=2 then "
no-loop
when
$group : GroupByString( groupId == "wordGroup")
$word : String() from $group.groups
accumulate ( $msg : Message( text contains $word ) over window:time( 5m ) ;
$list : collectList( $msg ),
$count : count( $msg );
$count >= 2
)
then
System.out.println("group by " + $word + " count is "+ $count + " list: " + $list);
insert(new Integer($count.intValue()));
end
{code}
2-/ If you use an hard-coded operand in the {{str startsWith}}, it works too. For instance if you hard-code the rule as:
{code}
rule "group by word and count if >=2 then "
no-loop
when
accumulate ( $msg : Message( text str[startsWith] "ciao" ) over window:time( 5m ) ;
$list : collectList( $msg ),
$count : count( $msg );
$count >= 2
)
then
insert(new Integer($count.intValue()));
end
{code}
It does not give NPE at KB build and executes as expected.
For my application it's okay to deal with the first option above, but anyway I thought worthy to report a JIRA. I will attach reproducer. Ciao
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (WFLY-3729) config-properties should be "read-write" by CLI
by Tomaz Cerar (JIRA)
[ https://issues.jboss.org/browse/WFLY-3729?page=com.atlassian.jira.plugin.... ]
Tomaz Cerar moved JBJCA-1207 to WFLY-3729:
------------------------------------------
Project: WildFly (was: IronJacamar)
Key: WFLY-3729 (was: JBJCA-1207)
Issue Type: Enhancement (was: Bug)
Workflow: GIT Pull Request workflow (was: classic default workflow)
Affects Version/s: (was: 1.0.17.Final)
Component/s: JCA
(was: AS)
> config-properties should be "read-write" by CLI
> -----------------------------------------------
>
> Key: WFLY-3729
> URL: https://issues.jboss.org/browse/WFLY-3729
> Project: WildFly
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: JCA
> Environment: EAP 6.1.0
> RHEL 6.5
> Reporter: Jooho Lee
> Assignee: Jesper Pedersen
> Labels: eap6, jboss
>
> Using CLI, it is possible to control websphere message server but config-properties can not be modified or created because its access-type is read-only.
> For example,
> {code:title=CLI Command|borderStyle=solid}
> /profile=MMPS-dev-03-profile/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=FDSLPublishQueue/config-properties=baseQueueName:write-attribute(name=value,value=test)
> {
> "outcome" => "failed",
> "failure-description" => "JBAS014639: Attribute value is not writable",
> "rolled-back" => true
> }
> {code}
> This is because the fact that baseQueueName(config-properties)' access-type is read-only but I don't see any reasons why this attritbute couldn't be writable.
> Is there any reasons the attribute has to be read-only? otherwise, it should be read-write.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months