[JBoss JIRA] Created: (JGRP-459) disable_initial_coord not working
by Graeme Ahokas (JIRA)
disable_initial_coord not working
----------------------------------
Key: JGRP-459
URL: http://jira.jboss.com/jira/browse/JGRP-459
Project: JGroups
Issue Type: Bug
Affects Versions: 2.4.1 SP1
Environment: mac os x, Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Reporter: Graeme Ahokas
Assigned To: Bela Ban
We've got the following scenario: three applications, App1, App2, and App3. We want App3 to be the coordinator when the apps first start, so there is no confusion about multiple groups / coordinators. So, we set App1 and App2's disable_initial_coord = true, and App3's disable_initial_coord=false.
Then we start App1, and it will wait. Then we start App2, and App1 / App2 will determine a coordinator, even though disable_initial_coord is set to true for both, and we have not started App3 yet! This seems to conflict with the documentation which states:
Note that - if a member is started as first member of a group - but its property is set to true, then it will loop until another member whose disable_initial_coord property is set to false, is started.
We need disable_initial_coord to work as documented.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 1 month
[JBoss JIRA] Created: (JBRULES-532) Query feature doesnt seem to work if there is more than one query.
by Sridhar Chandrasekharan (JIRA)
Query feature doesnt seem to work if there is more than one query.
------------------------------------------------------------------
Key: JBRULES-532
URL: http://jira.jboss.com/jira/browse/JBRULES-532
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Sridhar Chandrasekharan
Assigned To: Mark Proctor
Consider the following:-
*******************************************************************************
1) Foo.java
package com.foo;
public class Foo {
private int a;
private int b;
public Foo(int a, int b) {
super();
this.a = a;
this.b = b;
}
public boolean test()
{
return (a > b);
}
public int getA() {
return a;
}
public int getB() {
return b;
}
}
*******************************************************************************************
2) FooTest.java
package com.foo;
import java.io.InputStreamReader;
import java.io.*;
import java.util.*;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
import org.drools.compiler.PackageBuilder;
import org.drools.rule.Package;
import org.drools.QueryResults;
import org.drools.QueryResult;
public class FooTest {
/**
* This is a sample file to launch a rule package from a rule source file.
*/
public static final void main(String[] args) {
try {
//load up the rulebase
RuleBase ruleBase = readRule();
WorkingMemory workingMemory = ruleBase.newWorkingMemory();
//go !
workingMemory.fireAllRules();
QueryResults results = workingMemory.getQueryResults( "Foo query" );
if(results == null)
{
System.out.println("Result is null");
return;
}
System.out.println( "we have " + results.size() );
for ( Iterator it = results.iterator(); it.hasNext(); ) {
QueryResult result = ( QueryResult ) it.next();
Foo foo = ( Foo ) result.get( "foo" );
System.out.println( "A="+foo.getA() + " B=" + foo.getB());
}
} catch (Throwable t) {
t.printStackTrace();
}
}
/**
* Please note that this is the "low level" rule assembly API.
*/
private static RuleBase readRule() throws Exception {
//read in the source
Reader source = new InputStreamReader( FooTest.class.getResourceAsStream( "/Foo.drl" ) );
//optionally read in the DSL (if you are using it).
//Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) );
//Use package builder to build up a rule package.
//An alternative lower level class called "DrlParser" can also be used...
PackageBuilder builder = new PackageBuilder();
//this wil parse and compile in one step
//NOTE: There are 2 methods here, the one argument one is for normal DRL.
builder.addPackageFromDrl( source );
//Use the following instead of above if you are using a DSL:
//builder.addPackageFromDrl( source, dsl );
//get the compiled package (which is serializable)
Package pkg = builder.getPackage();
//add the package to a rulebase (deploy the rule package).
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
return ruleBase;
}
}
**************************************************
3) Foo.drl
#created on: Oct 9, 2006
package com.foo
rule "Initialization rule"
when
#conditions
then
assert(new Foo(1,1));
assert(new Foo(2,1));
assert(new Foo(2,3));
assert(new Foo(3,2));
assert(new Foo(3,4));
assert(new Foo(4,3));
end
query "Foo query"
foo : Foo()
end
****************************************
The output is as follows:-
we have 6
A=1 B=1
A=2 B=1
A=2 B=3
A=3 B=2
A=3 B=4
A=4 B=3
*****************************************
Now add another query to the Foo.drl file
query "Bar query"
foo : Foo()
end
and the output is
Result is null
Adding a second query caused the first query to stop working properly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (JBRULES-372) QueryResult.get fires ClassCastException when using the string argument
by Giovanni Cuccu (JIRA)
QueryResult.get fires ClassCastException when using the string argument
-----------------------------------------------------------------------
Key: JBRULES-372
URL: http://jira.jboss.com/jira/browse/JBRULES-372
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Environment: JBoss Rules 3.0.1 and JBoss Rules as downloaded from svn trunk as of 12/07/06
Reporter: Giovanni Cuccu
Assigned To: Mark Proctor
here is the simple test case:
package simpletest;
public class AssertedObject {
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public AssertedObject(String value) {
// TODO Auto-generated constructor stub
this.value = value;
}
}
package simpletest;
import simpletest.AssertedObject;
rule rule1
when
then
assert( new AssertedObject( "value1") );
assert( new AssertedObject( "value2") );
end
query "assertedobjquery"
assertedobj : AssertedObject( value=="value1" )
end
package simpletest;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import mit.rules.test.Prestazione;
import mit.rules.test.StrutturaErogante;
import mit.rules.test.TempiAttesa;
import mit.rules.test.TestRules;
import org.drools.QueryResult;
import org.drools.QueryResults;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
import org.drools.audit.WorkingMemoryFileLogger;
import org.drools.compiler.PackageBuilder;
public class TestQuery {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( TestQuery.class.getResourceAsStream( "testquery.drl" ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final WorkingMemory workingMemory = ruleBase.newWorkingMemory();
fireRules(workingMemory);
}
public static void fireRules(WorkingMemory workingMemory) {
final WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger( workingMemory );
logger.setFileName( "log/testquery" );
workingMemory.fireAllRules();
QueryResults results = workingMemory.getQueryResults( "assertedobjquery" );
if (results==null || !results.iterator().hasNext()) {
System.err.println("Empty list");
} else {
for ( Iterator it = results.iterator(); it.hasNext(); ) {
QueryResult result = ( QueryResult )it.next();;
AssertedObject assertedObject=(AssertedObject)result.get( "assertedobj" );
System.out.println("AssertedObject with value " + assertedObject.getValue());
}
}
logger.writeToDisk();
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (JBPM-956) jBPM 3.2.x: enhance MockConnection to allow for using JDK 1.6
by Arjan van Bentem (JIRA)
jBPM 3.2.x: enhance MockConnection to allow for using JDK 1.6
-------------------------------------------------------------
Key: JBPM-956
URL: http://jira.jboss.com/jira/browse/JBPM-956
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Affects Versions: jBPM jPDL 3.2
Environment: Win32, JDK 1.6
Reporter: Arjan van Bentem
Assigned To: Tom Baeyens
Priority: Optional
Since JDK 1.6, the interface java.sql.Connection includes numerous new methods, such as createArray and createBlob. Adding some dummy methods to org.jbpm.persistence.db.MockConnection allows for using JDK 1.6
API: http://java.sun.com/javase/6/docs/api/java/sql/Connection.html
FIX: add the following lines to http://fisheye.labs.jboss.com/browse/JBPM/jbpm.3/jpdl/jar/src/test/java/o...
public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
throw new UnsupportedOperationException();
}
public Blob createBlob() throws SQLException {
throw new UnsupportedOperationException();
}
public Clob createClob() throws SQLException {
throw new UnsupportedOperationException();
}
public NClob createNClob() throws SQLException {
throw new UnsupportedOperationException();
}
public SQLXML createSQLXML() throws SQLException {
throw new UnsupportedOperationException();
}
public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
throw new UnsupportedOperationException();
}
public Properties getClientInfo() throws SQLException {
throw new UnsupportedOperationException();
}
public String getClientInfo(String name) throws SQLException {
throw new UnsupportedOperationException();
}
public boolean isValid(int timeout) throws SQLException {
throw new UnsupportedOperationException();
}
public void setClientInfo(Properties properties) throws SQLClientInfoException {
throw new UnsupportedOperationException();
}
public void setClientInfo(String name, String value) throws SQLClientInfoException {
throw new UnsupportedOperationException();
}
public boolean isWrapperFor(Class arg0) throws SQLException {
throw new UnsupportedOperationException();
}
public Object unwrap(Class arg0) throws SQLException {
throw new UnsupportedOperationException();
}
Just for the JIRA search:
The type MockConnection must implement the inherited abstract method Connection.createArrayOf(String, Object[])
The type MockConnection must implement the inherited abstract method Connection.createBlob()
The type MockConnection must implement the inherited abstract method Connection.createClob()
The type MockConnection must implement the inherited abstract method Connection.createNClob()
The type MockConnection must implement the inherited abstract method Connection.createSQLXML()
The type MockConnection must implement the inherited abstract method Connection.createStruct(String, Object[])
The type MockConnection must implement the inherited abstract method Connection.getClientInfo()
The type MockConnection must implement the inherited abstract method Connection.getClientInfo(String)
The type MockConnection must implement the inherited abstract method Connection.isValid(int)
The type MockConnection must implement the inherited abstract method Connection.setClientInfo(Properties)
The type MockConnection must implement the inherited abstract method Connection.setClientInfo(String, String)
The type MockConnection must implement the inherited abstract method Wrapper.isWrapperFor(Class)
The type MockConnection must implement the inherited abstract method Wrapper.unwrap(Class)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months