[rules-users] Drools function not working with Javassist facts

Wolfgang Laun wolfgang.laun at gmail.com
Wed May 16 09:03:20 EDT 2012


I removed all this servlet stuff and then I added
   msgCtClass.writeFile();
after building the class in FactGenerator and it works.

-W



On 16/05/2012, Ayush <ayush.vatsyayan at alcatel-lucent.com> wrote:
> Please find the attached code as zip. It contains following files
> 1) index.jsp: contains just a link to servlet which will initiate the
> process.
> 2) servlets.DroolsInvokerServlet.java
> 3) test.FactGenerator.java
> 4) testRule.drl
>
> Please deploy the project as .war project in jboss6 and add the following
> in
> web.xml
> /<?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_ID" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> 	<display-name>BIRT_Chart_JS_API_Samples</display-name>
> 	
> 	<servlet>
> 		<servlet-name>DroolsInvokerServlet</servlet-name>
> 		<servlet-class>servlets.DroolsInvokerServlet</servlet-class>
> 	</servlet>
> 	
> 	<servlet-mapping>
> 		<servlet-name>DroolsInvokerServlet</servlet-name>
> 		<url-pattern>/DroolsInvokerServlet</url-pattern>
> 	</servlet-mapping>
> </web-app>/
>
>
> Here is my code using which I'm able to reproduce the issue.
>
> Following is the error I'm receiving
>
> /java.lang.RuntimeException: Error importing :
> 'defaultpkg.LogMessage.logMessage'
> [ function logMessagelogMessage (line:7): Only a type can be imported.
> drools.dynamic.Message resolves to a package
>  ]
> Error importing : 'defaultpkg.LogMessage.logMessage'
>
>
> servlets.DroolsInvokerServlet.createKnowledgeBase(DroolsInvokerServlet.java:84)
> 	servlets.DroolsInvokerServlet.myCode(DroolsInvokerServlet.java:57)
> 	servlets.DroolsInvokerServlet.service(DroolsInvokerServlet.java:38)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:847)/
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-function-not-working-with-Javassist-facts-tp3996584p3996901.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list