Processing xml with control characters in droolserver
by Shameer E S
Hi,
I am sending xml to initiate rule execution in drools server 5.4. When
there is control character in the xml, it is failing with following error,
is there any way to overcome this?
16 Jul 2014 00:03:28,852 ERROR
[org.apache.camel.processor.DefaultErrorHandler] (http--0.0.0.0-8080-239)
Failed delivery for exchangeId:
ID-svl-prod-prwf04-juniper-net-51091-1404737660521-0-3260214. Exhausted
after delivery attempt: 1 caught:
com.thoughtworks.xstream.converters.ConversionException: : Illegal
character ((CTRL-CHAR, code 8)) [note: in XML 1.1, it could be included via
entity expansion]
at [row,col {unknown-source}]: [30,126] : : Illegal character
((CTRL-CHAR, code 8)) [note: in XML 1.1, it could be included via entity
expansion]
at [row,col {unknown-source}]: [30,126]
---- Debugging information ----
message : : Illegal character ((CTRL-CHAR, code 8)) [note: in
XML 1.1, it could be included via entity expansion]
at [row,col {unknown-source}]: [30,126]
cause-exception : com.thoughtworks.xstream.io.StreamException
cause-message : : Illegal character ((CTRL-CHAR, code 8)) [note: in
XML 1.1, it could be included via entity expansion]
at [row,col {unknown-source}]: [30,126]
class : java.lang.String
required-type : java.lang.String
converter-type :
com.thoughtworks.xstream.converters.SingleValueConverterWrapper
wrapped-converter :
com.thoughtworks.xstream.converters.basic.StringConverter
path : /batch-execution/set-global[7]/map/entry[50]/string[2]
line number : 2
class[1] : java.util.HashMap
converter-type[1] :
com.thoughtworks.xstream.converters.collections.MapConverter
class[2] : org.drools.command.runtime.SetGlobalCommand
converter-type[2] :
org.drools.runtime.help.impl.XStreamXML$SetGlobalConverter
class[3] : org.drools.command.runtime.BatchExecutionCommandImpl
converter-type[3] :
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : null
Thanks & Regards,
Shameer
11 years, 7 months
Getting Errors Deploying kie-drools-wb-distribution-6.0.1.Final
by Nguyen, Chieu X
I am trying to deploy the kie-drools-wb on Tomcat7, but I keep getting these errors.
SEVERE: Error listenerStart
Jul 23, 2014 10:03:26 AM org.apache.catalina.core.StandardContext
startInternal
SEVERE: Context [/rule-mgnt-6.0.1] startup failed due to previous errors Jul 23, 2014 10:03:26 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/rule-mgnt-6.0.1] appears to have started a thread named [pool-4-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Jul 23, 2014 10:03:26 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/rule-mgnt-6.0.1] created a ThreadLocal with key of type [org.jboss.solder.servlet.beanManager.ServletContextAttributeProvider$1]
(value
[org.jboss.solder.servlet.beanManager.ServletContextAttributeProvider$1@323acc6f])
and a value of type [org.apache.catalina.core.ApplicationContextFacade]
(value [org.apache.catalina.core.ApplicationContextFacade@3243a52c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jul 23, 2014 10:03:26 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/rule-mgnt-6.0.1] created a ThreadLocal with key of type [org.jboss.errai.config.util.ClassScanner$1] (value
[org.jboss.errai.config.util.ClassScanner$1@7711057b]) and a value of type [java.lang.Boolean] (value [true]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
I have follow the instructions provided from this link:http://drools.46999.n3.nabble.com/rules-users-Problems-deploying-war...
1. I have added these 3 jar files in my tomcat_home/lib directory
a. javax.security.jacc-api-1.5.jar
b. kie-tomcat-integration-6.1.0.CR2.jar
c. slf4j-api-1.7.7.jar
2. Modified the server.xml in tomcat_home/conf directory by adding the line below in the <Host> tag
<Valve className="org.kie.integration.tomcat.JACCValve" /> 3. Added the following in tomcat-users.xml
<role rolename="admin"/>
<role rolename="analyst"/>
<role rolename="manager-gui"/>
<role rolename="user"/>
<user username="admin" password="dummy" roles="admin"/>
<user username="tomcat" password="dummy2" roles="manager-gui"/> 4. Delete org.uberfire.security.auth.AuthenticationSource inside WEB-INF/classes/META-INF/services 5. Rename org.uberfire.security.auth.AuthenticationSource-TOMCAT-JEE-SECURITY to org.uberfire.security.auth.AuthenticationSource inside WEB-INF/classes/META-INF/services 6. Created a setenv.sh in tomcat_home/bin directory, which has this as it content
export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"
7. Finally, uncomment the section in web.xml from the WAR file.
I am using Tomcat 7.0.54 and running on 64 bit Linux server. I would appreciate any suggestions.
Thank You,
Chieu Nguyen
Chieu.nguyen(a)verizon.com
11 years, 7 months
Re: [rules-users] Drools Applications Google Group
by Mark Proctor
I’m currently setting a google group, won’t touch nabble. It allows welcome messages, sticky nodes, and if necessary moderation.
Mark
On 22 Jul 2014, at 18:24, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> As long as Nabble is kept out.
>
> Stackoverflow is, at present, quite reasonable, with a high percentage
> of what I consider as interesting, i.e., the "hard core" Expert/Fusion
> questions.
>
> Cheers
> Wolfgang
>
> On 22/07/2014, Mark Proctor <mproctor(a)codehaus.org> wrote:
>> A while back there was a discussion on the volume of posts and the range of
>> post discussions. OptaPlanner already has it's own google group, which has
>> helped reduce the volume. There is still the discussion on whether to split
>> Drools.
>>
>> My initial idea is to leave this list for installation, setup,
>> configuration, deployment and getting started (hello world won't run) - this
>> tends to be a fairly shallow knowledge area, that new people will need to
>> deal with. Then also create a separate google group for those wanting help
>> on writing rule applications, that's authoring (drl, score cards, decision
>> tables etc) and running (insert, fireAllRules etc); this would become a deep
>> knowledge area. In the google group you would not ask how to install the
>> workbench, or how to deploy your app, or how to setup HA etc.
>>
>> Thoughts?
>>
>> We are about to do 6.1 final. For this we are revamping the websites, and
>> sorting out our communications (lists etc) at the same time.
>>
>> Mark
>>
>>
11 years, 7 months
KieContainer#updateToVersion fails when both versions of a drl file contain an event type declaration for an existing class
by mikedev9000
I am using the latest drools 6.1.0-SNAPSHOT. I have two jars containing
different versions of a KieModule, and they each contain a drl file with an
event type declaration for an existing class. If I try to update the
container from one version to the other, the call to
KieContainer#updateToVersion returns a Results instance that contains errors
related to the @timestamp attribute on that event declaration. Here is an
example of the error message: "[Message [id=1, level=ERROR, path=r0.drl,
line=3, column=0
text=Error creating field accessors for timestamp field 'mytime' for type
'FooEvent']]".
The following .patch file can be used to add a unit test to the
IncrementalCompilationTest.java file that demonstrates this problem.
test_container_update_problem.patch
<http://drools.46999.n3.nabble.com/file/n4030100/test_container_update_pro...>
After applying the patch, and running this unit test, I see the following
test failure:
java.lang.AssertionError: Errors detected on updateToVersion: [Message
[id=1, level=ERROR, path=r0.drl, line=3, column=0
text=Error creating field accessors for timestamp field 'mytime' for type
'FooEvent']]
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertFalse(Assert.java:64)
at
org.drools.compiler.integrationtests.IncrementalCompilationTest.testUpdateWithDeclarationPresent(IncrementalCompilationTest.java:95)
This error makes it nearly impossible for me to rely on and use
KieContainer#updateToVersion, because I need to allow frequent changes to be
made to drl files at run time, and I would prefer not to recreate the
KieContainer, and all of its KieBases and KieSessions on every update.
Is this a known issue? If so, are there plans to fix it before the
6.1.0.Final release?
--
View this message in context: http://drools.46999.n3.nabble.com/KieContainer-updateToVersion-fails-when...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Drools Applications Google Group
by Mark Proctor
A while back there was a discussion on the volume of posts and the range of post discussions. OptaPlanner already has it’s own google group, which has helped reduce the volume. There is still the discussion on whether to split Drools.
My initial idea is to leave this list for installation, setup, configuration, deployment and getting started (hello world won’t run) - this tends to be a fairly shallow knowledge area, that new people will need to deal with. Then also create a separate google group for those wanting help on writing rule applications, that’s authoring (drl, score cards, decision tables etc) and running (insert, fireAllRules etc); this would become a deep knowledge area. In the google group you would not ask how to install the workbench, or how to deploy your app, or how to setup HA etc.
Thoughts?
We are about to do 6.1 final. For this we are revamping the websites, and sorting out our communications (lists etc) at the same time.
Mark
11 years, 7 months
how to count distinct nested property?
by richardhands
Hi,
I’m trying to wrap my head around how to use a combination of accumulate
from and collect from to get a count of how many unique items there are of a
nested child property and run the RHS of a rule if it’s > 1
So I have
Many of Object A
Each one contains
An object B
An object C
Object C contains a nested child property
So
A
+-+-B
|
+-C – property myId
(many of these in the working memory)
The rule I’m working with right now is
rule "B must only be at 1 myId per day"
when
$b : B()
$c : C()
$aList : ArrayList (size > 1)
from collect(
A(b == $b, c.getDate() == $c.getDate()) )
eval ( RulesUtils.countIdsForC ($aList) > 1 )
then
//fire some rules here
end
and the RulesUtils method is
public static int countIdsForC (List aList)
{
Set<Integer> myIds = new HashSet<Integer>();
for (A a : aList)
{
myIds.add(a.getC().getMyId());
}
return myIds.size();
}
Now I’m well aware that this is sub-optimal, and indeed is firing lots of
extra times and is really (Really) slow. I can vizualise that this should
easily be possible with some combination of compound accumulate and collect
statements, but for the life of me I can’t work out the correct arrangement
(This is actually for use in an optaplanner ruleset so it will potentially
be working on lots of data, over many iterations).
Any suggestions on how to do this the way I know it needs to be, greatfully
appreciated
--
View this message in context: http://drools.46999.n3.nabble.com/how-to-count-distinct-nested-property-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Using java enums in guvnor test scenarios (6.0.1Final)
by pacovalsera
Hi all, I'm defining a test scenario within guvnor (now called kie-workbench)
and I'm experiencing some issues about using java enums.
The case is simple, I have a java model (deploying a jar) with a class
having a member of enum type. The enum is defined in the same package but in
a different java file, not an inner class. This is packed in a jar that I
deploy manually uploading the file to the embedded maven repo using the
workbench.
/
public class ClassWithMemberAsEnum { private EnumType enumMember;
/*getters/setters included*/}
public enum EnumType {HELLO, BYE}
/
Then I write a dummy rule with the guided editor like this:
/
import es.shin.test.ClassWithMemberAsEnum;
import es.shin.test.EnumType;
rule "DummyRule"
dialect "mvel"
when
x : ClassWithMemberAsEnum( enumMember == EnumType.HELLO )
then
x.setEnumMember( EnumType.BYE );
end
/
And finally a test scenario inserting a ClassWithMemberAsEnum initialized
with enumMember=EnumType.HELLO and checking that it is changed to
EnumType.BYE after firing all rules.
The error message returned in the reporting console is:
/
EnumTest : [Error: unable to resolve method using strict-mode:
java.lang.Object.es()] [Near : {... es.shin.test.EnumType.HELLO ....}] ^
[Line: 1, Column: 1]
/
I have tried the same case but defining the class in the data modeler and
the enum with the enumeration editor, without using any jar artifact. The
case worked as expected.
Has anybody experienced the same issue? Thanks for your help.
--
View this message in context: http://drools.46999.n3.nabble.com/Using-java-enums-in-guvnor-test-scenari...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Question about getObjects() on workspace with defeasible belief system
by Borris
I am trying the Defeasible belief system (it ties in pretty well with
some of how I want
to structure my project).
After fixing many typos, the rule behaviour seems to be what it should
for a defeasible
rule being correctly defeated (my clash spotter doesn't fire, which it
does if any
part of the defeasible chain is broken). Which is all jolly fun and good
and exciting.
But, my question.
I have a simple workspace dump based upon getting all objects (via
ksession.getObjects() )
and then doing my own tidy presentation. This still shows the defeated
fact as present.
So I know there is still record somewhere of the defeated fact, because
if the workspace
changed such that my defeater was retracted, then it needs to make the
fact visible again.
But I wasn't expecting to see it via getObjects(). Is that the intended
behaviour? If so,
is there a way to enquire whether a fact is in the "defeated state" or
not that I could
add to my tidy workspace dumper?
Thanks!
Borris
11 years, 7 months