cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I inspect or watch anything in debug mode anymore?

Former Member
0 Kudos

Hello,

Something has happened in my NWDS so that I can no longer inspect or watch variables in debug mode. I can set a breakpoint and right-click on a variable and choose watch or inspect. However, it doesn't show the value in the Expressions view.

For example, Given this code snippet...

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
   MYLoginForm loginForm = (MyLoginForm)form;
   String login = loginForm.getLogin();
   String password = loginForm.getPassword();

After I step over the login= and password= lines I choose inspect on login variable. Instead of showing me the value of login I see this:

"login"=(No explicit return value)

If I hover over the login variable in the debug pane I see the value of the login.

What would have caused this and how do I fix it?

Thanks in advance for any help.

David.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Perhaps the debug perspective configuratio has been changed.

Try to reset the perspective and see if it helps.

I am not in front of the NWDS now but if I remember correctly, while you are on the debug perspective go to Window->perspective->reset perspective.

Hope it helps,

Roy

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi David,

check this thread too

/thread/186675 [original link is broken]

Regards, Suresh KB

Former Member
0 Kudos

Roy,

Your memory was correct. That's a good tip but, unfortunately, it did not solve my problem.

Rewarding a couple points for the good tip, though.

Thanks!

Former Member
0 Kudos

Suresh,

Thanks for replying. The link you gave me doesn't really deal with my problem.

I know how to debug in NWDS. Been doing that for a couple of years.

My problem is that all of a sudden I can't get the "Expressions" pane to show the actual value of a variable I'm trying to inspect.

Thanks anyway.

Former Member
0 Kudos

This is really in response to the reply from "Torsten".

Torsten,

That is not the last line in my execute method. I just didn't put the rest of the code in there because it doesn't matter for the purposes of this post.

It happens in ANY class I try to debug. As I said in the original post, I can hover over the variable and see its value but when I do an "inspect" or "watch" on the variable I get the message I indicated in the "Expressions" pane.

Thanks!

Former Member
0 Kudos

Roy,

It turns out that your suggestion DID fix the problem so I went back in and reassigned the points to you.

All I had to do was restart NWDS after resetting the perspective.

Thanks a lot!

Answers (1)

Answers (1)

Torsten_
Advisor
Advisor
0 Kudos

Hello,

is this the last line in your execute methode:

 String password = loginForm.getPassword();

?

I belive so.

When I'm belive right is this the description:

The JRE (better the Garbage collection) do not need the local attributes password and login.

In java you can create everytime al local scope. A Methodebody is also a local scope.

All attributes you create in this scope (a scope begins with '{' and ends with '}' ) will only available in this scope.

Example;

// Scope 1
{
String test = "test";

// scope 2
  { 
    String innerscope = "test2";
  }

test = innerscope; // brings a compile error
}

Sometimes when I need the attribute only for debuging tests I insert a simple dummy line after the last line.

In your case it look like this:

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
   MYLoginForm loginForm = (MyLoginForm)form;
   String login = loginForm.getLogin();
   String password = loginForm.getPassword();

// set here a brakpoint and you can see the value fom password
   String dummy = "test";
}

Torsten