[rules-users] JBoss AS 4.0.5 GA + Drools 4.0.1

Edson Tirelli tirelli at post.com
Mon Sep 24 15:05:19 EDT 2007


    I updated the wiki page with the API code for Drools 4.x:

http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat

    []s
    Edson

2007/9/24, Guardian <d.h.j. at gmx.de>:
>
>  Let me get this right, i musst use the JANINO-Compiler to avoid problems
> with JBoss AS resp. Tomcat?
>
>
>
> There is another problem: the PackageBuilderConfiguration-Method "setCompiler(PackageBuilderConfiguration.JANINO)" does not exists in Drools 4.0.1
>
>
>
>
>  ------------------------------
>
> *Von:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *Im Auftrag von *Edson Tirelli
> *Gesendet:* Montag, 24. September 2007 15:48
> *An:* Rules Users List
> *Betreff:* Re: [rules-users] JBoss AS 4.0.5 GA + Drools 4.0.1
>
>
>
>
>     This is a known conflict between JDT versions used by tomcat and
> drools.
>
> http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat
>
>     []s
>     Edson
>
> 2007/9/24, Guardian <d.h.j. at gmx.de>:
>
> Hello,
>
> I have many problems to integrate Drools in my existing Application that
> is running on JBoss AS 4.0.5 GA.
>
> When I try to load and execute the rule-file I get the following
> Exception:
>
>
>
> *java.lang.RuntimeException* : java.lang.NoSuchMethodError:
> org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
> ()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
>
> *javax.ejb.EJBException* : *java.lang.RuntimeException* :
> java.lang.NoSuchMethodError:
> org.eclipse.jdt.internal.compiler.CompilationResult.getProblems
> ()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
>
>       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(* **
> Ejb3TxPolicy.java:69*)
>
>       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(* **TxPolicy.java:83*
> )
>
>       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(* **
> TxInterceptor.java:191*)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(* **
> TxPropagationInterceptor.java:76*)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(*
> StatelessInstanceInterceptor.java:62** *)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(*
> AuthenticationInterceptor.java:77** *)
>
>       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(*
> Ejb3AuthenticationInterceptor.java:102 *)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(* **
> ENCPropagationInterceptor.java:47*)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(* **
> AsynchronousInterceptor.java:106*)
>
>       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(* **
> MethodInvocation.java:101*)
>
>       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(* **
> StatelessContainer.java:263*)
>
>       at org.jboss.aop.Dispatcher.invoke(* Dispatcher.java:106*)
>
>       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(*
> AOPRemotingInvocationHandler.java:82 *)
>
>       at org.jboss.remoting.ServerInvoker.invoke(* **ServerInvoker.java
> :828*)
>
>       at org.jboss.remoting.ServerInvoker.invoke(* **ServerInvoker.java
> :681*)
>
>       at
> org.jboss.remoting.transport.socket.ServerThread.processInvocation(*
> ServerThread.java:358 *)
>
>       at org.jboss.remoting.transport.socket.ServerThread.dorun(*
> ServerThread.java:412* )
>
>
>
>
>
>
>
>
>
>
>
> My Application consists of the following parts:
>
>
>
> The rule-file:
>
> #created on: 04.09.2007
>
> *package* drools.rules
>
>
>
> #list any import classes here.
>
> *import* drools.session.Message;
>
>
>
> #declare any global variables here
>
>
>
> *rule* "Hello World"
>
>       *when*
>
>             m : Message( status == Message.HELLO, message : message )
>
>       *then*
>
>             System.out.println( message );
>
>             m.setMessage( "Goodbye cruel world" );
>
>             m.setStatus( Message.GOODBYE );
>
>             *update*( m );
>
> *end*
>
>
>
> *rule* "GoodBye"
>
>       *no-loop* *true*
>
>       *when*
>
>             m : Message( status == Message.GOODBYE, message : message )
>
>       *then*
>
>             System.out.println( message );
>
>             m.setMessage( message );
>
>
>
> *end*
>
>
>
>
>
>
>
> a Class to encapsulate the rule-initialisation and rule-execution
> (wrapper-Class):
>
>
>
> *public* *class** *RuleEngineWrapper
>
> {
>
>
>
>         *private* WorkingMemory workingMemory;
>
>
>
>         *private* *boolean* debugMode = *false*;
>
>
>
>         *private* DebugAgendaEventListener debugListener;
>
>
>
>
>
>         *public* RuleEngineWrapper(WorkingMemory wm) {
>
>             *this*. workingMemory = wm;
>
>             debugListener = *new* DebugAgendaEventListener();
>
>         }
>
>
>
>         /**
>
>          * construct a RuleEngineWrapper with only a rule- file- name, no
> idea of
>
>          * callers' class. Assume the rule file is located
>
>          *
>
>          * *@param* rulesFile
>
>          */
>
>         *public* RuleEngineWrapper(String rulesFile) {
>
>             *this*(RuleEngineWrapper.* class*, rulesFile);
>
>         }
>
>
>
>         /**
>
>          * construct a RuleEngineWrapper with only a calling object known
>
>          *
>
>          * *@param* caller
>
>          * *@param* rulesFile
>
>          */
>
>         *public* RuleEngineWrapper(Object caller, String rulesFile) {
>
>             *this*(caller.getClass(), rulesFile);
>
>         }
>
>
>
>         /**
>
>          * construct a RuleEngineWrapper with Class caller and rule- file-name
> known.
>
>          * We load the rule- file as classpath resource.
>
>          *
>
>          * *@param* caller
>
>          * *@param* rulesFile
>
>          */
>
>         *public* RuleEngineWrapper(Class caller, String rulesFile) {
>
>             *super*();
>
>             *try* {
>
>                 *final* PackageBuilder builder = *new* PackageBuilder();
>
>                 System.*out* .println(caller);
>
>
>
>                 builder.addPackageFromDrl(* new* InputStreamReader(caller
>
>                         .getResourceAsStream(rulesFile)));
>
>
>
>                 *final* RuleBase ruleBase = RuleBaseFactory.*newRuleBase *
> ();
>
>                 ruleBase.addPackage(builder.getPackage());
>
>
>
>                 workingMemory = ruleBase.newStatefulSession();
>
>
>
>                 debugListener = *new* DebugAgendaEventListener();
>
>
>
>             } *catch* (Exception e) {
>
>                 System.* out*.println( "cannot read rule file: " +
> rulesFile);
>
>             }
>
>         }
>
>
>
>
>
>         /**
>
>          * Allow to add arbitrary objects as facts. Users can add any
> objects to
>
>          * workingMemory
>
>          *
>
>          * *@param* o
>
>          *            the fact to be added
>
>          */
>
>         *public* *void* addFact(Object o) {
>
>             workingMemory.insert(o);
>
>         }
>
>
>
>         /**
>
>          * Execute rules.
>
>          *
>
>          */
>
>         *public* *void* executeRules() {
>
>             workingMemory.fireAllRules();
>
>         }
>
> ...
>
> [Mensagem cortada]
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070924/62fb3f73/attachment.html 


More information about the rules-users mailing list