File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Code works in debug but does not work in regular run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Code works in debug but does not work in regular run" Watch "Code works in debug but does not work in regular run" New topic
Author

Code works in debug but does not work in regular run

Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Hi,
I renamed one of the local classes (Formatter.java to MyAppFormatter.java) in old perfectly working jar. I also renamed manually all refrences to this class in other classes. After compile, code works in debug and does not work in regular run. The developement was done in RAD 7.0. It runs on WedShere 5.1 server. Any suggestion?


Irene Loos
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

My first guess would be a classpath or deployment issue.
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
Thank you for your reply. I verified classpath the first thing - it is correct. In regards of deployment - it works in debug mode, but when restart server in 'Run" does not work. The only change - class was renamed and all references to it chnaged.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 507
Hi,
I am not sure what you mean by "Code Works" and "Code does not work"??
If you are talking about a specific functionality in your application then you might need to check the call to that method.
Sometime we tend to write something like this..


Now this will affect your program when you switch off the debugging and also comment out the SOP or debugging statement, as your callthismethod() will not be invoked as debug being false and your method call came in the conditional if statement.

You can check the specific code for thing like this..this may help.

Regards,
Amit
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
It works when you start the server in "debug mode" (RAD or WSAD) and same version of the code does not work without any recompile when I start the server in "run mode". It gives "null". The servlet does not even go there. During the debug mode I do not stop in any methods. The difference is only in the way how the server started. I cannot debug it, because it works in debug, so going thru debugger does not help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code works in debug but does not work in regular run
 
Similar Threads
JSP Debug Problem in WSAD 4.0.3
Problems creating a jar
rename file
Using Web Start
JerseyClient and HttpClient - connecting to SSL secured web service