drools-camel-server-example exception
by Maxime Falaize
Hello,
I was testing SOAP requests with the drools-camel-server-example and I have
trouble with it.
Everything is fine when I run org.drools.server.CxfSoapClientServerTest but
I noted that the SOAP request is sent to a spring reference of the cxf
endpoint and when I want to change it to
cxfrs://http://localhost:9002/soapto be more realistic, it raises this
exception :
Caused by: org.apache.cxf.interceptor.Fault: .No message body writer has
been found for class : class
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl, ContentType
: text/plain.
at
org.apache.cxf.jaxrs.client.WebClient$BodyWriter.handleMessage(WebClient.java:938)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
~[cxf-api-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:839)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
... 90 common frames omitted
Caused by: org.apache.cxf.jaxrs.client.ClientWebApplicationException: .No
message body writer has been found for class : class
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl, ContentType
: text/plain.
at
org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:635)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:401)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.WebClient$BodyWriter.handleMessage(WebClient.java:930)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
... 92 common frames omitted
I don't know how to correct this issue.
To be more precise, I edited the camel-client-test.xml and changed in the
soap route <to uri="cxf://bean://soapServer"/> to <to uri="cxfrs://
http://localhost:9002/soap"/>.
Thanks for your help.
--
Maxime FALAIZE
11 years, 9 months
BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error
by Gopu Shrestha
It is so annoying to see an error marks in Eclipse Juno with Drools Plug in. However the code is working fine...
How can clean up this error??? Please advise...
[cid:image001.png@01CF4908.1AF0D2F0]
Error Message!!!!!
BuildError: Unable to Analyse Expression System.out.println(".......java (getter/setter)...providerClaimNumber.."+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());
System.out.println("......mvel...providerClaimNumber.."+$claim.claimIdentificationInfo.providerClaimNumber.value);
System.out.println("...ctype..."+$ct.value);:
[Error: unable to resolve method using strict-mode: java.lang.String.getValue()]
[Near : {... oviderClaimNumber().getValue()); ....}]
^
[Line: 32, Column: 0]
Console Output:....
.......java (getter/setter)...providerClaimNumber..130430007701
......mvel...providerClaimNumber..130430007701
...ctype...I
11 years, 9 months
KnowledgeAgentImpl memory leak (5.5.0.Final)
by alineasol
Hello,
We have a KnowledgeAgent with this configuration:
* drools.resource.scanner.interval = 900
* drools.agent.monitorChangeSetEvents = "true"
* drools.agent.scanResources = "true"
* drools.agent.scanDirectories = "true"
* drools.agent.newInstance = "false"
* drools.resource.urlcache = /path/cache
We have noticed a memory leak in the class KnowledgeAgentImpl when the
resources are down. The KnowledgeAgentImpl begins to reload from cache all
the resources every scanner interval they are not reachable. The
KnowledgeAgentImpl object increases its size every loop causing a Java Perm
Gen error.
We use:
* drools release 5.5.0.Final
* jdk1.6.0_45
* apache tomcat 7.0.42
Any suggestion?
Thank you.
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgentImpl-memory-leak-5-5-0-Fi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Editing Action in Guided decision table ruins the action.
by Ioannis Christodoulou
Hello everyone,
I'm using the latest stable kie workbench (6.0.1.Final) and I have created
a guided decision table containing an action with free form brl.
Whenever I try to edit this action and press apply changes, kie workbench
will duplicate the action (creating the new/edited action, while keeping
the old one) and will not allow me to remove (by clicking on the minus
icon) the old action.
If I try to validate the guided decision table, I get an error saying
"Unable to complete your request. The following exception occurred: rowData
contains a different number of columns to those provided".
The only solution I found is to remove the action that I need to edit and
re-create it. But this means that I have to re-enter the parameters in my
rules.
Example action:
/*MyUtils is a custom class and I am calling a static method passing
arguments: a string taken as a parameter from each rule and a Level object
matched in the rule.
*/
MyUtils.calculateLevel( "@{level_value}", $level);
The issue appears if I try to change that by clicking on the edit (pencil)
icon to (or any other change actually):
MyUtils.calculateLevel("@{level_value}", "@{another_value}", $level);
Kind regards
11 years, 9 months
When Guvnor is down.
by san_hegde
Hi All,
We are facing a problem i.e. when Guvnor is down our application then fails to scan the resource in Guvnor, and after that even if Guvnor comes up, the scanner wont scan that resource. In the log I can see that number of resource scanning is 0.
That means if that happens then our application goes for toss forever till we next restart our application.
We are using spring integration for resource scanning. Below is the code used for that
<drools:resource id="resource"
source="ruleEngineURL"
type="CHANGE_SET" />
<drools:resource-change-scanner id="s1"
interval="3600" />
I also read that we can configure such a way that when Guvnor is down then local cached resource can be used, and when Guvnor comes up then it starts reading from Guvnor.
Do you know what configuration I have to use to achieve that.
We are using drools and Guvnor 5.2 version.
Thank you
Santhosh Hegde A
--
View this message in context: http://drools.46999.n3.nabble.com/When-Guvnor-is-down-tp4028983.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
6.0.1.F Need help in getting recanned rules into new session
by SrjTx
I've have been unable to figure out how to get drools to rescan and then use
the updated rules in a new session. I currently have to restart jboss to
pick up the changes. The scanning seems to happen, but I don't see the
changes that should be included.
I have looked at lots of example code on the web and also at the Switchyard
source. When I do this in tandem with SY, I can get it to work, but I
need/want to have it work on its own.
I have tried some different combinations with no luck.
In addition to the "why doesn't it work", I would like to clearly
understand:
Do I need a KieBase, or should I just be creating sessions off of the
container?
What do I need to have in Envinonment?.
What do I need to have in ksessionConfiguration?
Related, what is the proper mechanism to pass in the Session Name?
GAD is: com.xyz.policy, cep, 1.0
Drools session is stateful and named "DroolsSession", stream processing
mode, realtime
I initialized KIE with the following.
kieServices = KieServices.Factory.get();
releaseId = kieServices.newReleaseId("com.xyz.policy", "cep",
"LATEST");
kieFileSystem = kieServices.newKieFileSystem().generateAndWritePomXML(
releaseId);
kieBuilder = kieServices.newKieBuilder(kieFileSystem);
kieBuilder.buildAll();
Results results = kieBuilder.getResults();
if (results.hasMessages(Message.Level.ERROR)) {
StringBuilder sb = new StringBuilder();
for (Message message : results.getMessages(Message.Level.ERROR)) {
if (sb.length() != 0) {
sb.append(" -- ");
}
sb.append(message.toString().trim());
}
log("Unable to initialize KIE " + sb.toString());
} else {
env = kieServices.newEnvironment();
kieContainer = kieServices.newKieContainer(releaseId);
kieScanner = kieServices.newKieScanner(kieContainer);
kieBaseConfiguration = kieServices.newKieBaseConfiguration();
kieBase = kieContainer.newKieBase(kieBaseConfiguration);
kieSessionConfiguration = kieServices.newKieSessionConfiguration();
kieSessionConfiguration.setProperty("sessionName", "DroolsSession");
kieSessionConfiguration.setProperty("drools.clockType", "realtime");
kieSessionConfiguration.setProperty("drools.evenProcessingMode",
"stream");
Later when I determine it is time to rescan, I do the following:
kieScanner.scanNow();
System.err.println("Scanning...");
currentKieSessionThread = new KieSessionThread(
kieBase.newKieSession(kieSessionConfiguration, env));
executorBean.execute(currentKieSessionThread);
--
View this message in context: http://drools.46999.n3.nabble.com/6-0-1-F-Need-help-in-getting-recanned-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
inserted object now working
by Gopu Shrestha
I am struggling to identify why my another object (Claim) inserted into ksession is not working..
However, I tried the object Message() is working but not Claim(). I printed values of Claim Object its working but not in rule.
Where I missed??? Please help...
Here is the code.
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// go !
Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
TClaim claim = loadFile();
System.out.println("......CategoryOfService---------"+claim.getClaimIdentificationInfo().getCategoryOfService().getValue());//working
System.out.println("......ProviderclaimNumber--"+claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue()); //working
ksession.insert(message);
ksession.insert(claim);
ksession.fireAllRules();
private static TClaim loadFile() throws JAXBException, FileNotFoundException {
JAXBContext jaxbContext = JAXBContext.newInstance("com.sample");
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<?> unmarshalledObject = (JAXBElement<?>) unmarshaller.unmarshal(new FileInputStream("Encounter.xml"));
TClaim claim = (TClaim) unmarshalledObject.getValue();
return claim;
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("setBaseECN.drl"), ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error: errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
----Rule file setBaseECN.drl----
rule "testing claim rule"
when
Claim();
then
System.out.println("..........Executing.......claim...rule.");//not working
end
rule "testing message rule"
when
Message()
then
System.out.println("........Executing......message rule");//working
end
11 years, 9 months
Problem Itegrating Spring 3.2 with Drools 6.0.0
by milen igrachev
Hello,
I experience a problem autowiring my KieSession object into my Controller field in Spring.
I read the Spring integration configuration part of Drools documentation and edited my Spring
configuration as adviced. However on deploying I receive one and the same well know exception:
"org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.kie.api.runtime.KieSession] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {(a)org.springframework.beans.factory.annotation.Autowired(required=true), @org.kie.api.cdi.KSession(name=, value=ksession-rules)}"
My application's web.xml defines my spring configuration entries as follows:
mvc-dispatcher
......
mvc-dispatcher
/
contextConfigLocation
/WEB-INF/beans.xml,
/WEB-INF/security.xml,
/WEB-INF/entityManager.xml
As guided by Drools documentation I entered the following Drools configuration in my spring configuration (I try to put the bean both in mvc-dispatcher-servlet.xml configuration and in beans.xml the result is the same).
I have this package
"com.my.sample.drools.rulespackage"
with
a simple and tested rule in it.
In my Controller class I am trying to autowire the KieSession bean to a field as follows:
@Controller
@RequestMapping(value = "/")
public class BaseController extends AbstractController {
private static final Logger log = Logger.getLogger(BaseController.class);
@Autowired
@KSession("ksession-rules")
KieSession mySession;
.............
}
I tryed with @Inject instead of spring's @Autowire, the result is the same.
I am using the following Drools dependencies with their versions:
drools-core - 6.0.0.FINAL; drools-compiler - 6.0.0.FINAL; kie-spring - 6.0.0.FINAL; (I am trying to keep it simple as my first integration try.)
The spring version that I am using is 3.2.4.RELEASE.
I debugged
KModuleBeanFactoryPostProcessor
and I can clearly see that an object tree with
KieModuleModelImpl,
KieBaseModelImpl,
KieSessionModelImpl,
with the corresponding details that I entered in the configuration above (packages, name, type, etc.) is created!. However it seems that a KieSession bean is not registered
spring's container.
What I do wrong? Can anyone please help?
Thanks in advance!
Best Regards,
Milen
11 years, 9 months