Rule updation fails in Drools - drools

I am drools version 5.6.0.Final and facing below issue.
I am using declarative model for creating dynamic pojos.
--> All new pojos goes in decare.drl file
--> All rules using the above pojos(declared in declare.drl) goes in rules.drl file
When first time knowledge base is created, compilation goes well and all rules will be triggred correcly as expected. But when I update a rule in rules.dl file, knowledge agent fails in compiling this rules.drl file as it is has pojos declared in another file i.e. declare.drl
So agent gets only rules.drl file for compilation due to this is the only file updated and he does not get declare.drl. So incremental build fails.
Getting the below error: Server is a pojo declared in declare.drl file
Error Unable to resolve ObjectType 'Server'
Please let me know how to make it work and agent should be able to compile it properly.
Thank you in advance,
Hariprasad Taduru

Related

unreconized message type simulink ros message

I am trying to build a ROS controller using a custom message. I am able to run the model with no problem. Howeveer when I try to build and run the model it throws an error.
Top model targets built:
Model Action Rebuild Reason
===============================================================================
sliding_controller2 Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 26.061s
Unrecognized message type rbdl_server/RBDLInverseDynamics. Use rosmsg list to see available types.
when I run rosmsg list
I get the following
.
rbdl_server/RBDLInverseDynamicsRequest
rbdl_server/RBDLInverseDynamicsResponse
.
I am not sure what is happening. I think it has some thing to do with from the mathworks
Code Generation with Custom messages
Custom message and service types can be used with ROS Simulink blocks for generating C++ code for a standalone ROS node. The generated code (.tgz archive) will include Simulink definitions for the custom messages, but it will not include the ROS custom message packages. When the generated code is built in the destination Linux System, it expects the custom message packages to be available in the catkin workspace or on the ROS_PACKAGE_PATH. Ensure that you either install or copy the custom message package to your Linux system before building the generated code.
Does anyone have any idea how to solve this problem?
I was able to get the messages definitions to appear when I run rossrv list and matlab sees them so I dont know what is going on.
The solution was rather complicated. I add to use a VM that had a copy of my catkin_ws then set my model to compile to the VM in the ROS tab.
the messagetype rbdl_server/RBDLInverseDynamics that throws an error during creation is not equal to :
rbdl_server/RBDLInverseDynamicsRequest or
rbdl_server/RBDLInverseDynamicsResponse
Perhaps this causes your issues, as your messagetype that is being created should be of either request or response type as you defined them.

Can not start container in Drools workbench when rules generated from spreadsheet

In a project of Drools workbench, when rules are input with "Guided Rule", I can start the container correctly. But when rules are generated from spreadsheet (an *.xls file), I got the following error:
org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'firstApplicationTestCon' for module 'ppdrools:firstApplicationTestProj:1.0'
java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.compiler.DecisionTableProvider'
Did I miss something? Why did I fail to start the container while I can build the project successfully?
Hmm, it's a known bug. See the posts below:
[ENG] (6.1.z) Decision Table Spreadsheet on Execution Server
BZ-1214927: adding decision tables jar dependency to kie-server
And a duplicated bug report here on 2015-05-28:
Bug 1225979 - Kie sever starting error - ClassNotFoundException: org.drools.decisiontable.DecisionTableProviderImpl
Since this bug is reported and verified after 2015-03-05, which is the day 6.2 released, I think it's not solved yet. I'll have a try on 6.3.0.Beta2 later.

Build error with PostSharp 2.1.6 (NuGet)

I am evaluating PostSharp for a new project but cannot seem to get past the following error when I first build the project after changes:
Cannot copy file "C:\SourcePath\Output\Debug\MyApp.vshost.exe to
obj\Debug\Before-PostSharp\MyApp.vshost.exe: the file is locked by
process(es):MYAPP.VSHOST (8064)
The error only occurs in the first build attempt. If I immediately re-build, the error does not occur. I can only guess this is because the project isn't actually being rebuilt the second time.
I've read a few posts in the SharpCrafters forum that indicate this problem existed prior to v2.1 but was reportedly fixed. I am using v2.1.6.14 from NuGet (in VS 2010) and getting this error for every project I reference PostSharp. It is certainly not reasonable to require 2 builds every time, so I'm looking for a possible solution. I'm really pleased with what I've seen thus far but will have to go another direction if that can't be resolved.
UPDATE
Per Gael's request, I generated the diagnostic build log and sent it to him and it looks like he was able to resolve the problem in the latest release (2.1.6.14).
I believe part (or all) of the issue may be due to the fact that the build output for all of my projects is set to a common location (i.e. not the /bin/debug folder under each project). This is because we are using a MEF DirectoryCatalog which will discover Imports and Exports contained in the assemblies located in the output path. The PostSharp.targets file has the vshost.exe file excluded from the copy operation but only when it shares the name of the output assembly. In my case, the vshost.exe file has a different name and was, therefore, not being excluded.
The issue has been re-fixed in PostSharp 2.1.6.15.

tomcat6 and drool rules reloading

I have run into an issue where when I modify my drools rules(.drl) on the fileSystem it appears to work as a JUnit testcase but fails when try to test the same in the web application running under Tomcat6.
When I modify the drl file under Tomcat, I do see logs saying KnowledgeAgent is rebuilding the knowledgeBase and so on and I do see new a instance of KBase under KAgent in the debugger but still when I execute the rule it shows the original values.
Was wondering if there is any cache tomcat uses internally for rules and if yes whats the workaround?
Any help is appreciated.
As I understand your question, I think you have to reload your drl file when it gets changed.
Are you using ResourceFactory.newClassPathResource() method for loading your rule files? If yes, then use ResourceFactory.newInputStreamResource(stream) method. It always gets latest modified drl file.

Enterprise lib 5.0 not detecting app.config

I have a Solution which contains a Web project and a Class Library project. The Class library project contains Enterprise library 5.0 and app.config. When I try to perform a Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write, I get the following exception:
Resolution of the dependency failed,
type =
"Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter",
name = "(none)". Exception occurred
while: while resolving. Exception is:
InvalidOperationException - The type
LogWriter cannot be constructed. You
must configure the container to supply
this value.
----------------------------------------------- At the time of the exception, the
container was: Resolving
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(none)
If I move all the class files to the web project and have the Enterprise library configuration in the Web.config, everything works fine. I guess the issue is that the Enterprise library is not detecting the app.config which contains all the configuration.
Kindly help me with this regard.
Thanks in advance.
.NET dlls don't have config files. AppDomains do. You cannot put any configuration in a dll's "app.config" file and expect it to get automatically picked up. This is the way .NET config files work; it's not that "entlib is not automatically detecting" it, it's doing what the .NET framework defines the behavior of config files to be.
The answer is to leave the code in the library, but put the configuration in the web app's web.config file. Then everything will just work.
There are more advanced things you can do like manually loading the config file, but they're fairly advanced and, particularly with logging, can cause admin headaches later.