Skip to content

Instantly share code, notes, and snippets.

View DuncanDoyle's full-sized avatar

Duncan Doyle DuncanDoyle

View GitHub Profile
@DuncanDoyle
DuncanDoyle / gist:7784986
Created December 4, 2013 09:50
ISPN ClassCastException with RemoteCache.keySet() on Cache<String, String> with <compatibility enabled="true" />.
10:44:13,965 ERROR [org.infinispan.server.hotrod.HotRodDecoder] (HotRodServerWorker-3) ISPN005009: Unexpected error before any request parameters read: org.infinispan.commons.CacheException: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.String cannot be cast to [B
at org.infinispan.distexec.mapreduce.MapReduceTask.execute(MapReduceTask.java:360) [infinispan-core-6.0.0.Final.jar:6.0.0.Final]
at org.infinispan.distexec.mapreduce.MapReduceTask.execute(MapReduceTask.java:634) [infinispan-core-6.0.0.Final.jar:6.0.0.Final]
at org.infinispan.server.hotrod.util.BulkUtil.getAllKeys(BulkUtil.java:36) [infinispan-server-hotrod-6.0.0.Final.jar:6.0.0.Final]
at org.infinispan.server.hotrod.AbstractEncoder1x.writeResponse(AbstractEncoder1x.scala:111) [infinispan-server-hotrod-6.0.0.Final.jar:6.0.0.Final]
at org.infinispan.server.hotrod.HotRodEncoder.encode(HotRodEncoder.scala:47) [infinispan-server-hotrod-6.0.0.Final.jar:6.0.0.Final]
at org.jboss.netty.handler.codec.oneone.OneToOneEn
<plist version="1.0">
<dict>
<key>Label</key>
<string>Localhost2</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/ifconfig</string>
<string>lo0</string>
<string>alias</string>
<string>127.0.0.2</string>
package org.jboss.ddoyle.drools.rules
import org.jboss.ddoyle.drools.model.SimpleEvent
import org.jboss.ddoyle.drools.model.NoExpirationSimpleEvent
declare SimpleEvent
@role( event )
@timestamp( timestamp )
@expires( 10s )
end
package org.jboss.ddoyle.drools.rules
import org.jboss.ddoyle.drools.model.SimpleEvent
declare SimpleEvent
@role( event )
@timestamp( timestamp )
@expires( 120s )
end
rule "SimpleEvent_retract"
when
$s: SimpleEvent()
$clock: SessionClock(currentTime after [300s] $s.timestamp)
then
System.out.println("Retracting event: " + $s.getId());
System.out.println("Current clock-time: " + $clock.getCurrentTime());
retract($s);
end
package org.jboss.ddoyle.drools.rules
import org.jboss.ddoyle.drools.model.SimpleEvent
import org.kie.api.time.SessionClock
declare SimpleEvent
@role( event )
@timestamp( timestamp )
//There is a bug in Drools which causes disabling event expiration with @expires( -1 ) not to work: https://issues.jboss.org/browse/DROOLS-984
//So we set expiration to a very large value.
rule "Average weight of last 5 bags that entered Sorting stage."
enabled true
when
$number: Number() from accumulate ($b:BagScannedEvent(location == Location.SORTING) over window:length(5), average($b.getWeight()))
then
System.out.println("\nAverage weight of last 5 bags: " + $number + ". CurrentTime: " + drools.getWorkingMemory().getSessionClock().getCurrentTime());
end
<batch-execution>
<insert out-identifier="applicant">
<com.redhat.loandemo.Applicant>
<name>Eric D. Schabell</name>
<creditScore>230</creditScore>
</com.redhat.loandemo.Applicant>
</insert>
<insert out-identifier="loan">
<com.redhat.loandemo.Loan>
<amount>2500</amount>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Container container-loan1.0 successfully called.">
<results>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;execution-results&gt;
&lt;results&gt;
&lt;item key="loan"&gt;
&lt;value xsi:type="jaxbListWrapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;type&gt;LIST&lt;/type&gt;
&lt;/value&gt;
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Container container-loan1.0 successfully called.">
<results>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;execution-results&gt;
&lt;results&gt;
&lt;item key="loan"/&gt;
&lt;item key="applicant"/&gt;
&lt;/results&gt;
&lt;facts&gt;
&lt;item key="loan"/&gt;