aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes When running in remote mode i cannot debug or printout lines... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "When running in remote mode i cannot debug or printout lines..." Watch "When running in remote mode i cannot debug or printout lines..." New topic
Author

When running in remote mode i cannot debug or printout lines...

Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
When i run my application in remote mode, all works fine, but somehow i cannot debug in this mode. I use eclipse, it doesn't reach the breakpoints and when i add System.out.printlines it doesn't print them out... What could this be, does it have anything to do with the stub? Code works perfectly but i just want to see what happens in debugging mode... Can someone please help me?

Thanks!!!
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11503
    
  95

Hi Ricardo,

It is a bit hard to guess at what the problem is with what you have described.

Your System.out.println() statements should always work, so this implies that the debug messages are not being run at all.

Is it the server side code that you are trying to debug or the client side?

Where in the program are you trying to add the debug messages? Near which methods?

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Hi Andrew,

it is client code. I have (in short) the following outline :

1 interface (both for local and remote)
local implementation
remote implementation (delegates to local implementation so remote book() method => local.book())

The remote class extends unicast remote object and the server makes sure there is a registry and stub class is bound.

I set the debug markers in the local code, which will be reached through remote method invocation. For instance when i put a marker in local book() method or Lockmanager.lockRecord() the code just goes on, works perfectly but it doesn't stop at the marker.

Hope this helps you in figuring out what's wrong. I guess it's an awkward problem i'm having here...

Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11503
    
  95

Hi Ricardo,

Are you running separate threads for booking records / accessing the data?

Regards, Andrew
Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
It's a single thread

ClientGUIController.bookContractor()
(clientgui)

dataAccess.book(selectedRecord, clientGUI.getCustomerText().getText())
(this is either remote or local in this case remote)

databaseRMIImpl.book()
(extends unicast remote object)

database.book()
(local implementation)

Debugging mode cannot find the source for the unicast reference. And there it stops...

And when i put the marker on the local database.book() (which it must reach...) It just doesn't stop at the breakpoint....
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11503
    
  95

Hi Ricardo,

Sorry, I havent been much help - I have been trying to get some handle on what might be wrong, but nothing pops out.

Slightly away from your current problem (not stopping in the local method), you can specfy the "-keep" option to rmic, which will keep the automatically generated java files that are used to create the stubs. That should make the debugger a little happier.

About all I can suggest at the moment is that you keep moving your System.out.println() statements further back in your program until you do get some output. Then Look to see what is happening imediately afterwards to see if there is anything happening to explain why you are not getting output later.

Regards, Andrew
Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Hi

it's kind of strange now, all works perfectly like i said but still cannot debug...

It has to do with the remote stub, if i rmic -keep like you said it just jumos in this code and i still never reach my remote code in my case the lockmanager...

Please what can i do??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When running in remote mode i cannot debug or printout lines...