Netbeans: debugging Java Servlet on Tomcat opens two debug consoles? - java

I have been developing a Java Servlet app over several years. I have recently started to have slight problems debugging the app with Netbeans. When I click "Debug Project" under the Debug-menu in Netbeans 11.1, the following happens:
Tomcat is started and the app is deployed.
A debugger console is opened that says "User program running".
The app is recompiled.
There seems to be an attempt to somehow redeploy/debug(?) the app again: a second debugger console is opened but this one says "Connection refused".
Historically only steps 1-2 have occurred. I have no idea why recently also steps 3-4 have started to occur. E.g. the only changes I have done to the project pom-file is that some dependencies have been updated to a newer version. The only other major changes have been that the underlying Java SDK is now for version 12 and Netbeans has been updated from 8.2 to 11.1.
The end result is sort of half-ok: I am able to debug (set breakpoints, view variables etc.) the app. But one annoyance is that hot redeploying does not seem to work anymore. Previously changing and saving a Java code file caused that one file to be recompiled and the updated app to be redeployed automatically. This does not happen anymore if I modify and save Java code; I have to compile and redeploy manually. And of course also the fact that the whole project is recompiled at the beginning of each debug session slows things down. I assume these problems must be related to how the extra steps 3-4 have started to occur, but have no idea what could trigger those.
I wonder if anyone has any ideas what might cause this?

Related

Netbeans hangs out on loading modules

I use Netbeans 7.1 at work, with multiple Maven projects opened ad the same time, running those Java /J2EE projects on a Glassfish 2.0 Server.
Everytime I open Netbeans it hangs out when Loading Modules. To make it work I must delete the .netbeans folder.
Why is this happening? I've asked the technical support team but they have no idea.
I've also tryed most recent versions of Netbeans and the problem persist.
I've also noticed that, when it hangs out, occupies RAM memory over 400MB and then stops.
Thanks in advance.

Debugger not stopping at breakpoints: Websphere in Eclipse

I've recently had my app moved from Websphere Application Server 6.1 to WAS 7.5, due to end-of-life for 6.1. Consequently, I needed to update my debugging server. I found this to be an opportune time to move my application from an IBM RAD IDE to Eclipse (already had Indigo installed). Or so I thought.
Anyway, the powers that be, here, have recommended taking my debugger all the way to WAS 8.5, since I'm only using it to debug.
But the issue that I'm encountering is that I cannot get the debugger to stop on my breakpoints. I've got approx. 10 breakpoints in my opening page, all in JSP/Java code.
I'm running Java 1.6.0_32 and Java SE Runtime Environment build 1.6.0_32-b05. I really don't know how to check which JDK I've got loaded. I've seen recommendations to "go back" to JDK 1.5, but I can't be certain that's not what I'm running.
And to cover a few other bases, I have JUST started my system for the day, opened the IDE, started the server in debug (says "Debugging, Synchronized"), put focus on the opening page of the application and clicked "Debug on server". The front page opens without stopping at any of the breakpoints.
Does anyone have ideas or suggestions?
If you use eclipse's debugger and running the application outside eclipse environment , we have to configure it as remote java application.
Also check if the code deployed in server is in sync with the one present in workspace.
anything wrong of the ecplise's site.
Run->Skip all breakpoints
Well, I had recently faced this problem, where the code did not use to stop at breakpoints while I was in debugging mode and was sure that the particular piece of code is executing. In order to solve the problem, I did a clean-build-republish but it did not work, recreated the profile and readded the server with new profile, still did not work then finally re-installed RAD and web-sphere but It still did not work. Then I found the below article
https://www-304.ibm.com/support/docview.wss?uid=swg21240896
and realized it could be a problem due to some other OS process interfering with debug process/port so I performed a system restore. After restore when I deployed the application, debugger started working properly.
I'd like to say I found the answer to this, but I never did. I ended up dropping RAD and moving to debugging on Jetty. My local testing isn't EXACTLY as it would be on the test server, but it works. Not sure if this should be flagged as "answered" or not.
UPDATE: I have left this project but before I did, the entire development platform was moved to IDEA and debugging was no longer an issue. I don't know if I should find a way to mark this question as inactive or closed or whatever so that it's not just sitting out here getting views and responses when it's no longer an issue for me.

Processing IDE launch - None of the Processing 2.0 versions (beta versions & the stable versions) launch

I've been working on processing for prototyping for the past 3 months and I have used processing2.0b9, processing2.0b8, and processing1.5.1 on my Windows 7 PC. It was loading and working perfectly fine until 2 days ago. Suddenly, all the processing 2.0 versions don't load at all. The loading image having "Processing initiated by Ben Fry & Casey Reas" loads and then nothing happens. So, here are the things that I tried in the last 48 hours:
(a) Reinstalled the application - 6 times
(b) Reinstalled my Java JRE - 3 times
(c) Tried removing the preferences.txt file.
(d) Tried debugging through the command prompt.
(e) Tried running it in a different destination folder & drive.
Nothing works. Usually, my Windows Task Manager's processes tab shows a "javaw.exe" as soon as a Processing application runs. Now nothing shows up there as well. The weirdest part is that Processing 1.5.1 still opens & runs. My sketches are safe & so are my libraries. But they are rather dormant. The PDE files don't show the Processing icon that it once showed.
I've already lost 2 days in trying to load the IDE/App for Processing 2.0b8, processing2.0b9, & processing 2.0.1. Any help is appreciated.
PS>> Source suspicion: I once loaded the G4P's createGUI() in the draw() function just to experiment. And when I hit the run, it put out a fatal error because I stopped it abruptly through the task manager as the draw() function called the createGUI() function in an infinite loop. I suspect if that termination caused such a problem.
Update: The application seems to be running on the background because after tryring to run the application's IDE, (clicking processing.exe), and finding that the IDE isn't launching, when I tried moving the Processing folder, it says that a File is open in the Folder.
SOLVED: https://forum.processing.org/topic/processing-ide-launch-none-of-the-processing-2-0-versions-beta-versions-the-stable-versions
Sorry about sharing the link. But didn't want to repeat the response here. Looks like the Processing team is now looking into the issue themselves. (Casey Reas himself has replied about the issue in the thread.)
Thanks a lot for your replies.

Sudden Glassfish 2.1 failure

So, nothing has changed with my setup over the past week. I have recently upgraded to Lion, but I have run this application several times since I have done that.
Today, I click the "Run Main Project" arrow in NetBeans 6.8, and I get a dialog box I have never seen before...
I have absolutely no idea what to do. I can find no reference to this error in Google.
Steps I have taken:
Reviewed the logs (nothing unusual up to the point where NetBeans freaks out.
Reverted to a backup Netbeans installation (no change in behavior)
Attempted to change the username/login information to the administrative Glassfish panel (no change in behavior)
Removed the .netbeans directory from my home, and restored to a known good offsite backup.
I have absolutely no idea what "8228 8228 8228" means.
One thing important to note is that Glassfish is running and the creds that I have supplied to NetBeans do work. I can log into the running Glassfish admin panel with them.
Any suggestions at all?
Leaving this here for anyone who happens to run into the same problem.
I would wager that this affects all versions of NetBeans.
I am not entirely sure what caused the original issue, but it appears that NetBeans attempted to "auto-discover" a proxy that I had installed on my system. (GlimmerBlocker, for blocking ads, among other things)
When it did this, Glimmerblocker did not report its IP address correctly (or NetBeans interpreted it incorrectly), resulting in something that looked like:
127.0.0.1
127.0.0.1:8228
8228
8228
Well, needless to say, when the Java NumberFormatter got a hold of that, it didn't like it one bit.
Setting NetBeans to "No Proxy" in it's settings, and restoring from backup again (to undo all the troubleshooting damage I had done) took care of the problem.
Again, leaving this only in the hopes that it helps at least one other problem who may run into something similar.

Why does GWT sometimes successfully compile and other times just stall?

I am working on a demo for a client of what's possible with GWT-Ext for GWT. After browsing for the simplest way to get up and running, I decided on installing the Google Plugin for Eclipse and using the New Web Application Wizard.
First time around, I followed these steps for create the default application:
Selected File > New > Web Application Project from the Eclipse menu.
In the New Web Application Project wizard, entered a name for the project (ExtDemo) and a java package name, com.extdemo.
Unchecked the "Use Google App Engine" check box.
Clicked Finish.
Right clicked it in package explorer and selected Run As > Run Configurations
Put a check in the Automatically Select Unused Port checkbox.
Clicked Run to see the default GWT 1.7 application
This worked fine... it launched GWT's hosted browser and the app worked as supposed to.
(I then continued to import GWT-Ext and add all sorts of widgets building up a nice little demo app)
However at some point when relaunching the app in hosted mode, the hosted browser displays an empty iframe. I even reverted the code to a point where everything was working as supposed to and... same thing, an empty iframe with the surrounding static content.
Now what is really strange is when I go through the process of creating the default application again by following the steps above, the hosted browser launches with an empty iframe again.
However when I click on Compile/Browse, this sometimes allows the app to launch in Firefox.
Anyone have this happen to them?
I have seen some odd behaviors occasionally. Here are some basic suggestions (some are dumb and you might have tried them already):
Use a new workspace
I do not know if GWT plugin somehow caches stuff in the embedded Jetty. If you are re-creating the default app/project, try and use a different name for the project.
Try and re-use a fixed port so that there is no possibility of having multiple servers running.
Update: Found a new "classic" solution:
Delete the cache in IE and possibly Firefox too. Apparently the 'script' tag content tends to be cached by IE. If this works, we can all try tearing our hair out!
Found the updated answer at this link:
I have had the same problem in the past and found it is much more likely to happen if limited CPU is available. For example if my older laptop was running on battery and had stepped down the CPU speed to save power it frequently happened. When running on mains in max performance mode it only happened occasionally. Now I have a much newer and more powerful laptop and the problem has gone away.
Another cause I found was too many breakpoints set up in eclipse and removing breakpoints would often clear the problem.
I've had issues with the browser caching.
Try clearing your browser cache, refresh a few times after a failed load, etc.
You can also try using a different port so the URL is different.
It takes some time to download and run the GWT app, particularly if you are using extra libraries, so wait for a few seconds to see if the app finally loaded.
What makes the app loading to fail randomly is something I don't know yet, but I suspect, as stated by Daniel Vaughan, that is related with a lack of computer resources, CPU, memory, etc.

Categories