Unexpected, Unclear, Unperiodic error
by abhinay_agarwal
I have a piece of code which builds the kbase, when i run it from my local
system as a java application with guvnor deployed, the code works fine.
When i try and access from the admin module, it calls the same method
readKnowledgeBase(), it works.
But, when i call the same piece of code
(the same method readKnowledgeBase()) from user module, no extra parameter,
the same changeset is being used, it throws the following exception.
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:796)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1103)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:844)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:684)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:207)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:186)
at
com.infosys.fps.drools.adapter.DroolsAdapter.readKnowledgeBase(DroolsAdapter.java:58)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.calculateFee(GoalFeeCommissionHelper.java:189)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFee(GoalFeeCommissionHelper.java:167)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFeeCalculation(GoalFeeCommissionHelper.java:126)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeGoalCreation(GoalFeeCommissionHelper.java:77)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeFee(GoalFeeCommissionHelper.java:55)
at
com.infosys.fps.client.goal.service.EduGoalNeedsService.saveEducationNeeds(EduGoalNeedsService.java:932)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy57.saveEducationNeeds(Unknown Source)
at
com.infosys.fps.client.goal.delegate.EducationGoalDelegate.saveEducationNeeds(EducationGoalDelegate.java:217)
at
com.infosys.fps.client.goal.controller.EduGoalNeedsController.saveAfterGoalId(EduGoalNeedsController.java:865)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 502 for
URL:
http://bbsrprd02:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Goal...
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:759)
... 85 more
Any idea about this weird behaviour ?
Thanks,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Unexpected-Unclear-Unperiodic-error-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
What is the JBoss Knowledge Base Builder?
by Thomas Grayson
My Eclipse project includes the "JBoss Knowledge Base Builder." What does this builder do? I don't know how it was added to my project. Regardless, it does not automatically compile my rule files, as far as I can tell, since I didn't see any messages of that kind until I added the (different) "Drools Builder" to my project.
Tom Grayson
12 years, 10 months
Make Eclipse Drools Builder ignore .csv files
by Thomas Grayson
I have an existing Eclipse project that I just converted to a Drools project so that I could get the benefit of automatic compilation of my rule files and decision tables. This worked, but with an unfortunate side effect. My project also contains .csv files that are not Drools decision tables. The Drools Builder flags these files with an error. Can I configure my project so that the Drools Builder will ignore these files? If not, is there a good workaround? The .csv files open nicely in Excel, so I don't want to change the file extension unless I can get the same effect. I am using Drools 5.5.0.Final.
Best wishes,
Tom
12 years, 10 months
JPAKnowledgeService with ProtobufMarshaller
by Dilyan Dokov
Hi,
everybody.
Can I use Google's Protobuf instead of java.io.Serialization for automatic
knowledge session persistence?
I'm trying to figure this out for several hours now and I think I'm missing
something.
I'm using drools 5.5.0 and JPAKnowledgeService for automatic persistence of
the knowledge session in a mysql database. Ofcourse, there are backward
compatability problems because it is using vanilla java serialization. I can
see there is a ProtobufMarshaller implementation in the sources but can I
configure JPAKnowledgeService to use it instead.
Best regards,
Dilyan Dokov.
--
View this message in context: http://drools.46999.n3.nabble.com/JPAKnowledgeService-with-ProtobufMarsha...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
do I have to use temporary variable to overcome data casting issue ?
by Martin Minka
I continue to play with the code attached to
https://issues.jboss.org/browse/DROOLS-136 in src.zip. Updated invoice.drl
is attached in this mail.
I changed the rule "calculate totalPrice per item" to MVEL and trying to
calculate and set totalPrice with one liner:
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
but that fails with message: java.lang.IllegalArgumentException: object is
not an instance of declaring class
On the other hand using temporary variable of type Double will work. Here
is the complete rule which works up to the comment "// THIS IS DOESN'T
WORK":
rule "calculate totalPrice per item"
salience -10
no-loop
when
$q:Message(id=="item", answered==true,
value instanceof DataItemPrice, $v:value
)
then
System.out.println("setting totalPrice on item: " +
((DataItemPrice)$v).getName());
System.out.println("qty*unitPrice=" +
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
* Double d =
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice();
((DataItemPrice)$v).setTotalPrice(d);
* System.out.println("setting via temporary variable worked");
// THIS IS DOESN'T WORK
*
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
*
System.out.println("setting directly works ???");
update($q);
end
Am I again wrongly hoping that MVEL will simplify data types casting ? Or
should I fail a bug ?
12 years, 10 months
is property type casting into variable supported ?
by Martin Minka
I filled bug https://issues.jboss.org/browse/DROOLS-136 because the way I
tried to use # symbol hangs Drools.
I would like to ask the group if following type casting is supported in
Drools in Java or in MVEL:
rule "calculate totalPrice per item"
salience -10
no-loop
dialect "java"
when
$q:Message(id=="item", answered==true, $v:value#DataItemPrice)
then
System.out.println("this works: " + ((DataItemPrice)$v).getName());
// will this also work ? at least in MVEL
System.out.println("will this work ?: " + $v.getName());
end
thank you,
Martin Minka
12 years, 10 months
Room to optimize or bug? Unnecessary calls to unused method
by Sonata
Hi, I am using 5.5.0.final on jdk7(64bit). To repeat the test, simply create
a new Drools project in Eclipse. Tick the option to create a default Hello
World project. Go to the DroolsTest.java file, edit main() to
and edit getMessage() to
Next, remove the two rules in Sample.drl, use this simple rule instead
Then you can see the output
Which means, getMessage() is called 4 times in this simple rule. I really
wonder why. Is this a bug? Some non-optimized routine? An edge case?
Now try this
and the output is
Just once. It seems all good. Because getMessage() is needed to call once to
check with null, which is very fair to me.
Now something really funny
and the output
An extra call to getMessage() at the end, total 5 times!
TBH, I really only expect calling getMessage() once in all these tests.
Please put it to my face and tell me my test is so flawed.
--
View this message in context: http://drools.46999.n3.nabble.com/Room-to-optimize-or-bug-Unnecessary-cal...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
[Planner] Planning problem - looking for tips, and advices for complicated case
by Mz
Hello,
I'm having a problem to plan my solver, I'm wondering if it's possible to
configure the solver, so that it picks the best solution from multiple
collections of planning variables. Here is an example, to be more precise:
I have 3 planning variables: X, Y, Z. and many collections of values of
these variables. For example, collection A contains three X values, five Y
values, and two Z values; other collection would contain different values
etc. And the problem is that the values from different collections can't be
mixed with each other, and I don't know how to prevent that.
I have tried different approaches but with no luck... Tried to mix all of
the values together identifying them with a collection ID, and setting in
rules a negative score for the ones that are not from the same collection,
but its very inefficient, and the solver never stops (despite the fact that
the timeout was set for 120sec).
I was thinking about using multiple @PlanningEntities, but as far as I know
it is not supported, so I have resigned from this idea.
I have also tried using @ValueRange type FROM_PLANNING_ENTITY_PROPERTY, and
in MoveFactory I have changed planningEntityProperty according to the
collection I was using, but it led to exception "Corrupted Undo Move", and
all in all I think it was a bad idea.
My last idea, which I have not tested yet, is to make two different solvers,
one would find best solution for the given collection, and from all of the
best solutions from these collections, the next solver would pick the best
one, but I think this might be a very inefficient way of doing it.
I'm really sorry if I made this post very hard to understand, but my problem
is a bit more complicated then it sound, and its hard to describe it :P I
would appreciate any tips/ideas how I could configure/plan my solver, and
rules so it would work better.
Thanks in advance,
Mateusz
--
View this message in context: http://drools.46999.n3.nabble.com/Planner-Planning-problem-looking-for-ti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
Agenda-group in fact insert time
by Sonata
Hi, I just noticed that even I have different agenda-groups, all groups are
evaluated during fact inset time.
In an extreme case, if I have 1000 rules in agenda-group "A", and 1 rule in
agenda-group "B"
even though I just want to fire the 1 rule in agenda-group "B" by adding
AgendaFilter in fireAllRules()
all those 1000 rules in agenda-group "A" will be evaluated (i.e. methods in
the "when" part are being called)
even worst if I have complex logic in the "when" part for these 1000 rules,
e.g. accumulate/from, not to mention eval
Isn't that quite a performance impact? And forcing people to put their
logic/checking/matching in the "then" part?
How would you justify this? Or is there something I've missed that you can
actually evaluate the rule in agenda-group "B" ONLY, when fact is being
inserted?
Thank you
--
View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months