Hello,
i have a problem to use entity-beans (ejb 3.0) in a DRL-file.
If i use java-beans everything works fine, but when I use the following rule
with the "pruefungs"-entity object i get an exception. What is the problem,
can i use EJB 3.0 entitybeans with drools?
My rules are the following:
rule "Test Entity"
when
p : Pruefung( name : pruefungsName )
then
System.out.println( name )
end
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
and the exception that occurs:
12:29:31,093 INFO [STDOUT] cannot read rule file:
/drools/rules/testRule.drl
12:29:31,093 ERROR [STDERR] org.drools.rule.InvalidRulePackage: Rule
Compilation error : [Rule name=Test Entity, agendaGroup=MAIN, salience=0,
no-loop=false]
drools/rules/Rule_Test_Entity_0.java (8:25) : File
drools/rules/Rule_Test_Entity_0.java, Line 8, Column 25: Expression
"System.out.println(name)" is not a type
12:29:31,093 ERROR [STDERR] at
org.drools.rule.Package.checkValidity(Package.java:424)
12:29:31,093 ERROR [STDERR] at
org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:361)
12:29:31,093 ERROR [STDERR] at
drools.session.RuleEngineWrapper.<init>(RuleEngineWrapper.java:131)
12:29:31,093 ERROR [STDERR] at
drools.session.RuleEngineWrapper.<init>(RuleEngineWrapper.java:59)
12:29:31,093 ERROR [STDERR] at
drools.session.droolsManagementBean.startRuleEngineWrapper(droolsManagementB
ean.java:35)
12:29:31,093 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:29:31,093 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
12:29:31,093 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
12:29:31,093 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown
Source)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:11
2)
12:29:31,093 ERROR [STDERR] at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextIm
pl.java:166)
12:29:31,093 ERROR [STDERR] at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Intercepto
rsInterceptor.java:63)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,093 ERROR [STDERR] at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(Trans
actionScopedEntityManagerInterceptor.java:54)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,093 ERROR [STDERR] at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsIntercep
tor.java:46)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,093 ERROR [STDERR] at
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
12:29:31,093 ERROR [STDERR] at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,093 ERROR [STDERR] at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationIntercepto
r.java:76)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,093 ERROR [STDERR] at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstan
ceInterceptor.java:62)
12:29:31,093 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,109 ERROR [STDERR] at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationIn
terceptor.java:77)
12:29:31,109 ERROR [STDERR] at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Authenticat
ionInterceptor.java:102)
12:29:31,109 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,109 ERROR [STDERR] at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.ja
va:47)
12:29:31,109 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,109 ERROR [STDERR] at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInter
ceptor.java:106)
12:29:31,109 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:10
1)
12:29:31,109 ERROR [STDERR] at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer
.java:263)
12:29:31,109 ERROR [STDERR] at
org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
12:29:31,109 ERROR [STDERR] at
org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingIn
vocationHandler.java:82)
12:29:31,109 ERROR [STDERR] at
org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
12:29:31,109 ERROR [STDERR] at
org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
12:29:31,109 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThr
ead.java:358)
12:29:31,109 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412
)
12:29:31,109 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
12:29:31,109 INFO [STDOUT] exception in
'droolsManagementBean.startRuleEngineWrapper(String, ArrayList<Object>)',
cannot handle it...