Chintalapaty, Sreedhar | 2 May 15:58 2005

[drools-user] Snagging Code Generated by Drools

Hi,

>From what I understand, Drools uses the .drl files to generate a class
file (using Janino) which will then be used for evaluation. Is there a
way to snag the java source and class files generated as part of this
operation?  

I'd greatly appreciate any help, advice or pointers.

Best Regards,
Sreedhar
Mark Proctor | 2 May 16:46 2005

Re: [drools-user] Snagging Code Generated by Drools

In java yes there is as you can print the decompiled java code, the line 
is commented out at the moment, but you can re-enable it - line 144 - 
dont forget to recompile :)

http://cvs.drools.codehaus.org/viewrep/drools/drools/drools-java/src/main/org/drools/semantics/java/JavaScriptEvaluator.java?r=1.5.2.4

You can also do the same for the function blocks by pasting the same 
lines into ImporterClassBodyEvaluator before the compileAndLoad at line 122:
http://cvs.drools.codehaus.org/viewrep/drools/drools/drools-java/src/main/org/drools/semantics/java/ImporterClassBodyEvaluator.java?r=1.1.2.4

Mark
Chintalapaty, Sreedhar wrote:

>Hi,
> 
>>From what I understand, Drools uses the .drl files to generate a class
>file (using Janino) which will then be used for evaluation. Is there a
>way to snag the java source and class files generated as part of this
>operation?  
> 
>I'd greatly appreciate any help, advice or pointers.
> 
>Best Regards,
>Sreedhar
>
>  
>

Chintalapaty, Sreedhar | 2 May 17:08 2005

RE: [drools-user] Snagging Code Generated by Drools

Thanks, Mark.

I am sure I'll have more questions when I start trying this :)

Best Regards,
Sreedhar

-----Original Message-----
From: Mark Proctor [mailto:mproctor <at> codehaus.org] 
Sent: Monday, May 02, 2005 10:46 AM
To: user <at> drools.codehaus.org
Subject: Re: [drools-user] Snagging Code Generated by Drools

In java yes there is as you can print the decompiled java code, the line

is commented out at the moment, but you can re-enable it - line 144 - 
dont forget to recompile :)

http://cvs.drools.codehaus.org/viewrep/drools/drools/drools-java/src/mai
n/org/drools/semantics/java/JavaScriptEvaluator.java?r=1.5.2.4

You can also do the same for the function blocks by pasting the same 
lines into ImporterClassBodyEvaluator before the compileAndLoad at line
122:
http://cvs.drools.codehaus.org/viewrep/drools/drools/drools-java/src/mai
n/org/drools/semantics/java/ImporterClassBodyEvaluator.java?r=1.1.2.4

Mark
Chintalapaty, Sreedhar wrote:

(Continue reading)

Manavalan, Anoubhama | 4 May 18:05 2005

[drools-user] UnsupportedClassVersionError

Hi,

I downloaded the 2.0 beta 21 jar yesterday and was trying to build a small test program, and I got
UnsupportedClassVersionError. 

In debug, I found this value for the class that was reported unsupported,

org/drools/semantics/annotation/smf/SMFAnnotationRuleFactory (Unsupported major.minor version 49.0)

I don't believe I have any other version lingering around anywhere, since this is my first download.

Any ideas why I got this problem ?

thanks,
-Anou

Manavalan, Anoubhama | 4 May 18:41 2005

RE: [drools-user] UnsupportedClassVersionError

Stepping through it, I found the properties are read from the drools-annotation.conf file in the
annotation jar and also looked at the Manifest file. Seems like it was built in jdk1.5. 

I have jdk 1.4, could that be the reason for this unsupportedClassVersion error ? If it is, can you point me to
where I can download the drools that was built in jdk1.4 ? I tried at
http://dist.codehaus.org/drools/jars/ all of them seems to be the 2.0 build.

thanks,
-Anou

-----Original Message-----
From: Manavalan, Anoubhama 
Sent: Wednesday, May 04, 2005 10:06 AM
To: user <at> drools.codehaus.org
Subject: [drools-user] UnsupportedClassVersionError

Hi,

I downloaded the 2.0 beta 21 jar yesterday and was trying to build a small test program, and I got
UnsupportedClassVersionError. 

In debug, I found this value for the class that was reported unsupported,

org/drools/semantics/annotation/smf/SMFAnnotationRuleFactory (Unsupported major.minor version 49.0)

I don't believe I have any other version lingering around anywhere, since this is my first download.

Any ideas why I got this problem ?

thanks,
(Continue reading)

David Kingma | jool.nl | 4 May 19:01 2005
Picon

Re: [drools-user] UnsupportedClassVersionError

Quoting "Manavalan, Anoubhama" <anoubhama.manavalan <at> gwl.com>:

> Hi,
> 
> I downloaded the 2.0 beta 21 jar yesterday and was trying to build a small
> test program, and I got UnsupportedClassVersionError. 
> 
> In debug, I found this value for the class that was reported unsupported,
> 
> org/drools/semantics/annotation/smf/SMFAnnotationRuleFactory (Unsupported
> major.minor version 49.0)
> 
> I don't believe I have any other version lingering around anywhere, since
> this is my first download.
> 
> Any ideas why I got this problem ?

Annotations is a Java 1.5 feature, you're probably using 1.4.x. Remove the
annotations jar or install java 1.5 should solve the problem.

Regards,
David

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Manavalan, Anoubhama | 4 May 20:16 2005

RE: [drools-user] UnsupportedClassVersionError

Great thanks, that solved the problem, I could run my sample test now.

thanks,
-Anou

-----Original Message-----
From: David Kingma | jool.nl [mailto:D.Kingma <at> jool.nl]
Sent: Wednesday, May 04, 2005 11:02 AM
To: user <at> drools.codehaus.org
Subject: Re: [drools-user] UnsupportedClassVersionError

Quoting "Manavalan, Anoubhama" <anoubhama.manavalan <at> gwl.com>:

> Hi,
> 
> I downloaded the 2.0 beta 21 jar yesterday and was trying to build a small
> test program, and I got UnsupportedClassVersionError. 
> 
> In debug, I found this value for the class that was reported unsupported,
> 
> org/drools/semantics/annotation/smf/SMFAnnotationRuleFactory (Unsupported
> major.minor version 49.0)
> 
> I don't believe I have any other version lingering around anywhere, since
> this is my first download.
> 
> Any ideas why I got this problem ?

Annotations is a Java 1.5 feature, you're probably using 1.4.x. Remove the
annotations jar or install java 1.5 should solve the problem.
(Continue reading)

doug.baker | 5 May 04:13 2005

[drools-user] How to Determine Which Rule is Throwing Exception

Hi:

Here's the situation - we have a rule that tests for the existence of one
object in another object.  If the object exists, its asserts it into working
memory and other rules get fired because of that assertion.  

The problem is, sometimes a property in that asserted object may be null.
Is there any way we can inspect an exception and determine which rule threw
the exception?  We are trying to do this now, but the exception reports the
first rule that asserted the object and not the second rule that actually
threw an exception.

Please see the example below.   Any tips on how we can determine which rule
is throwing the exception?  We have many rules in our drl file and this is a
simplified example.

Thanks,
Doug

RULES
*****
<rule name="1. Get Policy from EndorsementRequest">
	<parameter identifier="endorsementRequest">
		<java:class>EndorsementRequest</java:class>
	</parameter>
	<java:condition>	
		 endorsementRequest.getPolicyData().getPolicyData() != null
	</java:condition>
	<java:consequence>
		Policy policy =
(Continue reading)

Kaur Sukhneer | 5 May 11:13 2005
Picon

RE: [drools-user] UnsupportedClassVersionError

How to retrive the Consequense from drl file??????????

-----Original Message-----
From: Manavalan, Anoubhama [mailto:anoubhama.manavalan <at> gwl.com] 
Sent: Wednesday, May 04, 2005 9:36 PM
To: user <at> drools.codehaus.org
Subject: [drools-user] UnsupportedClassVersionError

Hi,

I downloaded the 2.0 beta 21 jar yesterday and was trying to build a small
test program, and I got UnsupportedClassVersionError. 

In debug, I found this value for the class that was reported unsupported,

org/drools/semantics/annotation/smf/SMFAnnotationRuleFactory (Unsupported
major.minor version 49.0)

I don't believe I have any other version lingering around anywhere, since
this is my first download.

Any ideas why I got this problem ?

thanks,
-Anou

David Kingma | jool.nl | 5 May 11:17 2005
Picon

Re: [drools-user] How to Determine Which Rule is Throwing Exception

Hi Doug,

I'm not sure how it works with the Exception. The reason you get the first rule
as the rule causing the exception might be that the first rule triggers the
second rule (in this example).
You might want to try using the drools debugger interface.

Regards,

David

Quoting doug.baker <at> ficoh.com:

> Hi:
> 
> Here's the situation - we have a rule that tests for the existence of one
> object in another object.  If the object exists, its asserts it into working
> memory and other rules get fired because of that assertion.  
> 
> The problem is, sometimes a property in that asserted object may be null.
> Is there any way we can inspect an exception and determine which rule threw
> the exception?  We are trying to do this now, but the exception reports the
> first rule that asserted the object and not the second rule that actually
> threw an exception.
> 
> Please see the example below.   Any tips on how we can determine which rule
> is throwing the exception?  We have many rules in our drl file and this is a
> simplified example.
> 
> Thanks,
(Continue reading)


Gmane