debug

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

debug

grandjean
Hi
I am a newbie and i would like to use debugging mode under eclipse indigo sr2 with drools 5.3.

So, I created a very simple drools Helloworld project.

I added two breakpoints, one in the 'then' section of the 'goodbye' rule and the other one in the line where I call fireAllRules();

I selected the main class and right clicked so as to select 'Debug As Drools Application'

So, it stops on the FireeAllRules() but it doesn't stop on the rule breakpoint.

In addition, the Agenda, Working Memory views are totally blank

How can I get a working debug mode?

Thks in advance

Bruno Grandjean
Reply | Threaded
Open this post in threaded view
|

Re: debug

caroleyang
Same here, I was using eclipse 3.6.2 (helios service pack 2), I download the jbosstool 3.2.x (compatible with the eclipse version).  The debugger point never stop at rule.

Can someone share some insight?  

It will be nice if we can stop the debug point at those rules.


Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: debug

grandjean
Hello
 
I just downloaded the eclipse helios 3.6.2 (instead of 3.7.2) & installed the drools plugin corresponding to this eclipse version (add new software in local) and the debug mode works fine now.
 
maybe a pb of version? too recent?
 
bruno grandjean
Reply | Threaded
Open this post in threaded view
|

Re: debug

caroleyang
Hi Bruno,

It looks like the rule debugging (debugger stop at break point defined at rule consequence)?

I was using the same version of eclipse that you are using,   3.6.2.   And I installed the eclipse plugin at

JBoss Tools 3.2 - Stable Release - http://download.jboss.org/jbosstools/updates/stable/helios

From there, I picked the following eclipse plugins to install.

JBoss Drools Core
JBoss Drools Guvnor
JBoss Drools Task


Also for the application I was running debugger, I tried all those drools expert run time:  
520
530
540b2


None of those permutation will make debugger stop at the breakpoint defined at rule consequence logic.

I am running eclipse at windows.   What is the discrepancy with my result vs yours.

Appreciate any input.


Carole
Reply | Threaded
Open this post in threaded view
|

Re: debug

grandjean
Hello

here is my way to proceed:

download this drools version:

http://download.jboss.org/drools/release/5.3.0.Final/drools-distribution-5.3.0.Final.zip

unzip it

download this:

http://download.jboss.org/drools/release/5.3.0.Final/droolsjbpm-tools-distribution-5.3.0.Final.zip

unzip it

- Open Eclipse.
- Open the menu "Help", menu item "Install new software..."
- Click on the button "Add..." to add a new software site.
- Fill in the name "drools local update site"
- Click on the button "Local..." and select ".../binaries/org.drools.updatesite" (where u downloaded the droolsjbpm-tools-distribution-5.3.0.Final.zip)
- Select all the plugins. Click the buttons "Next" and "Finish".

U can create an "helloword" project so as to test quickly the debugger.

& the breakpoint must be inside the THEN section.

That's it!

bruno
Reply | Threaded
Open this post in threaded view
|

Re: debug

benq2188
Hello,

I faced with the same problem. Breakpoints are not being hit by debugger. I have Eclipse SDK version: 4.2.1 and went through the reference manual of Drools and followed each step carefully.

-Installed GEF
- Downloaded drools-distribution-5.4.0.Final.zip
-Unzipped it into Eclipse main folder
-Restarted Eclipse
-Defined run time based on the latest Drools project jars included in the plugin
itself.
-Created Drools Project
-Created new launch configuration for Drools Application.
-Put a breakpoint in the helloworld simple project on the first line of the section "then".

When I debug it as Drools Application, debugger stops in Java breakpoints but doesn't stop in drl rule.

Also tried what Bruno suggested but it did not worked too.

Any other solutions, how can I fix it?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

Mattias Nilsson Grip
Hi,

release notes for 5.4.0.Final mention that "Breakpoints in Rule RHS are not working with Java dialect".

Try adding this attribute to your rule and see if that makes debugging work:
dialect "mvel"
 
Regards,
Mattias

----- Ursprungligt meddelande -----
Från: "benq2188" <[hidden email]>
Till: [hidden email]
Skickat: onsdag, 31 okt 2012 10:58:06
Ämne: Re: [rules-users] debug

Hello,

I faced with the same problem. Breakpoints are not being hit by debugger. I
have Eclipse SDK version: 4.2.1 and went through the reference manual of
Drools and followed each step carefully.

-Installed GEF
- Downloaded drools-distribution-5.4.0.Final.zip
-Unzipped it into Eclipse main folder
-Restarted Eclipse
-Defined run time based on the latest Drools project jars included in the
plugin
itself.
-Created Drools Project
-Created new launch configuration for Drools Application.
-Put a breakpoint in the helloworld simple project on the first line of the
section "then".

When I debug it as Drools Application, debugger stops in Java breakpoints
but doesn't stop in drl rule.

Also tried what Bruno suggested but it did not worked too.

Any other solutions, how can I fix it?

Thanks in advance.



--
View this message in context: http://drools.46999.n3.nabble.com/debug-tp3889772p4020597.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

benq2188
Hello Mattias,

Awesome, putting dialect"mvel" keyword solved the problem.

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

Kevin Kelleher
Hi,

As I see it , this is a big problem.

I was looking at drools about 10 months ago (5.3.0 Final) and debug worked just fine ...  ... so similar to earlier comment of Bruno here.

Today I downloaded drools 5.5.0 Final & eclipse Juno  and debug is broken ... 

Can we expect a patch? I can't see how we could proceed if this issue is not resolved.

Any suggestions welcome.

Regards,
Kevin
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

Mattias Nilsson Grip
Hi Kevin,

did you try the workaround I suggested; setting rule dialect to mvel? That works for me.

There is a JIRA issue for the problem with debugging Java rules here:
https://issues.jboss.org/browse/JBRULES-3676

I created a pull request for it a few weeks ago but I don't think anyone from the core team have had a look at it yet. So if you think this is an important bug you could always vote for the JIRA! :-)

Regards,
Mattias

----- Original Message -----

> From: "Kevin Kelleher" <[hidden email]>
> To: [hidden email]
> Sent: Thursday, 29 November, 2012 3:20:18 PM
> Subject: Re: [rules-users] debug
>
> Hi,
>
> As I see it , this is a big problem.
>
> I was looking at drools about 10 months ago (5.3.0 Final) and debug
> worked
> just fine ...  ... so similar to earlier comment of Bruno here.
>
> Today I downloaded drools 5.5.0 Final & eclipse Juno  and debug is
> broken
> ...
>
> Can we expect a patch? I can't see how we could proceed if this issue
> is not
> resolved.
>
> Any suggestions welcome.
>
> Regards,
> Kevin
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/debug-tp3889772p4021012.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

Kevin Kelleher
Hi Mattias,

Thanks for your very quick reply ....

What I'm seeing is very strange!!!

I tried the workaround with eclipse juno & it did not work,

I tried the workaround with eclipse helios & it "partially" worked ...

The debugger stopped in the helloworld drl file but when "stepping through" the debugger seems to be going to the wrong lines . i.e. I'm not seeing the same jumps that I'm seeing for the same drl file in drools 5.3.0 final.

I hope I'm clear but if not happy to elaborate ... I'll look into how to "JIRA" vote.

Regards,
Kevin
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] debug

Kevin Kelleher
Guys,

Is there a fix coming for this issue?

I do not see how we can use 5.5.0 core if the eclipse debugger does not work.

The mvel workaround does not work for me. Even if it did, I wrote a load of java dialect rules for 5.3.0 which I don't want to rewrite.

Please advise? Should I stay with 5.3.0? I really want to start our project with the "latest & greatest".

Any thoughts welcome ....

Regards,
Kevin
Reply | Threaded
Open this post in threaded view
|

Re: debug

john_v_kelly
In reply to this post by grandjean
Hi Guys,

Just wondering if this issue has been fixed yet or if anybody could take a look at it ? Eclipse debugger not working is a major road block and slowing down development.

Thanks,
John.
Reply | Threaded
Open this post in threaded view
|

Re: debug

Kevin Kelleher
Hi All,

I'm wondering what the status is re this "debug not working" drools issue.

It's been out there for quite a while now. It would be great to get feedback re this.

Folks out there must be using 5.5.0 core, so I'm wondering how they are coping this issue.

Regards,
Kevin
Reply | Threaded
Open this post in threaded view
|

Re: debug

Valon
This post was updated on .
Eclipse debugging started working for me when I added dialect "mvel" after the rule declaration.    It was not until I did this.  And to Kevin's issues, I can correctly single step and view objects and values with my Indigo version of Eclipse.  

I have:  
drools-distribution-5.5.0.Final

Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 1
Build id: 20110909-0630

JDK 1.6

Here is an example rule:
rule "purchase over 15 and less than 25 dollars"
dialect "mvel"
when
        $p : Purchase ( total > 15 && <= 25 )
then
        System.out.println("purchase over 15 and less than 25 dollars");
        $p.setDiscount(0.10);  // 10% discount.
        System.out.println("Level 1 Discount: " + $p.getFmtDiscount());
end

Thanks Mattias for the suggestion.  

Regards,
Valon