• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

debugging

 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just posted it in "applet" section but immediately thought it may not be an applet issue and may be just a general question (who knows). so I am posting it here ---

I have a web page with embedded applet. The applet calls some other action class code. I need to debug through that action java code. I set a break point in the action class and start my local application server in debug mode. Then I brought up my local host web page that contains the applet, clicked on the button that calls that action class. I saw the web page hung there forever and on eclipse's debug perspective the breakpoint is not showing anything...


Did I miss anything here ? I am not actuallt debugging any applet GUI so I thought I am doing correctly. Can anybody point out what's the problem ?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The applet runs on the client, not on the server side. You can start the server in debug mode, but that won't make the applet run in debug mode, because it doesn't run on the server. Does the applet call the server via some remote method call or by sending a request to the server when you click the button?

Can you explain in more detail what the applet does or is supposed to do when you click the button? Post some of the code if that's possible.
 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to debug code below --- Inside the "actionPerformed". I have a j2ee web application running on application server. It has a page that contains applet. The applet contains a GUI component like this button, there is an actioner listener associated with the button, and below is the actionPerformed code for that listener. I started the application server in debug mode and set breakpoint inside the method below but could not get it work. Anything wrong ?

public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Button1")) {
// some code here
// ....
}
}
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That actionPerformed method is part of the applet code, right?

The applet code runs on the client, not on the server. It doesn't run in the same JVM as the server code and in a real situation it doesn't even run on the same computer as the server code. So, setting a breakpoint in the applet code and then starting the server in debug mode is not going to make the debugger stop on the breakpoint.

It's like starting two separate programs A and B, put a breakpoint in A, but start program B in debug mode - the debugger won't stop because it's debugging program B, not program A.
reply
    Bookmark Topic Watch Topic
  • New Topic