This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Strange doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Strange doubt" Watch "Strange doubt" New topic
Author

Strange doubt

Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Hi,
This may sound numb but I terribly need a solution for this.
I've written an abstract class (say ABC.java) and an implementation code for it (say ABCImpl.java).

Now that in some other java class(Main.java), I'm using using an object of type ABC. But how to debug into methods of implementation part ABCImpl.java) when I wish to do so.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18503
    
  40

Now that in some other java class(Main.java), I'm using using an object of type ABC. But how to debug into methods of implementation part ABCImpl.java) when I wish to do so.


Well, you can use a debugger. For somewhat small applications, within a single JVM, the standard debugger with most IDEs are fine.

Otherwise, you should consider using logging (or just sysouts) to keep track of what is going on.


Personally, I recommend doing both. If possible, write small testing classes, which can be used to debug individual components. While use logging when you want to test the whole (large) application.

Henry
[ December 17, 2008: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Henry, Thanks for the speedy reply.

The problem is neither the debugger nor the Sysouts work. I can't use a logger as of now for some internal reasons.

When I use debugger, I couldn't step onto the lines in the implemented code. All I can see is some blank white window. I should also make a point that, I use spring configurations for declaring, defining and creating objects on the fly.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18503
    
  40

I should also make a point that, I use spring configurations for declaring, defining and creating objects on the fly.


Yea, spring does add a level of indirection that makes it harder to debug. But why won't sysout work? You can sysout to a file, if the stdout had been routed.

Henry
Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Writing to a file was a great idea!! Why did I miss that one?

Thanks a lot, Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange doubt
 
Similar Threads
multiple implementations for interface - use default implementation for auto wiring
RMI method invocation return value
JVM implementation
"rpc.ServiceException"
Trouble naming interface