Confused about "Remote Debugging" Wildfly 20 from Eclipse 2020-06 - eclipse

I need to be able to "remotely debug" a Java/Jakarta EE servlet running under Wildfly 20 under Ubuntu 20 from Eclipse 2020-06 running on Windows 10 at a different IP.
My research has discovered what appears to be two different approaches: one is what I want and the other is a simpler "subset".
*** First the "simple" approach. This approach is supposed to let me debug from Eclipse an app that is already deployed and running on Wildfly. To do this I uncomment this line in standalone.conf:
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
Then I start Wildfly and ensure the app also starts.
In Eclipse I create in Debug Configuration a new Remote Java Application and ensure I use the same port 8787 as above. Then I just push "Debug".
I get this error:
Failed to connect to remote VM. Connection refused. Connection refused: connect
If I return to the Wildfly system and run the following I see that port 8787 is not being monitored so that sure looks like a problem:
ss -tp | grep 8787
(nothing is found)
*** The other approach appears to be what I want to do which is to have Eclipse deploy changed files to Wildfly and also allow me to debug remotely. That is how I worked with Eclipse Oxygen and Wildfly 10 when both were installed on the same Windows machine.
In this case I set up a new Remote Connection in Eclipse and then a new Server (and attach my Project to the Server) using that Connection. I then start the Server in Debug mode. In the Progress View I can see files being copied to a Path on the Wildfly server so that seems like progress but after 20 seconds I see the same error I got in the "simple" approach above.
Failed to connect to remote VM. Connection refused.
What's interesting is that if, in the Remote Systems View I open the Remote Connection I created, I am able to use the sftp item to see files on the remote Wildfly system. So it seems that I am able to connect to Wildfly.
I need help fixing both of these problems but especially the last one since I need to have Eclipse deploy changes to Wildfly as it did when Wildfly was local.
Thank you in advance.

Related

Netbeans GlassFish Server 6, deploy, Connection refused: connect, false error on Mac

After deploying my javaee application from the Apache Netbeans 12.4 console, I get the the below error on the output pane.
GlassFish Server 6, deploy, Connection refused: connect, false
This error shows even after the output "GlassFish server is running" was displayed earlier in the deployment messages.
I have checked the GlassFish folder in my mac and there are no error logs showing. Attempting to start GlassFish in debug mode gives the same issue.
Any advices on what could be the issue?
After some investigation, I figured that this issue was as a result of GlassFish not having administrative privileges to make changes to my filesystem.
All I needed to do was to start up GlassFish as an admin.
Usually, GlassFish is installed on the below path of your Mac.
/Users/YourUsername/GlassFish_Server
The below are the steps to achieve that.
Navigate to the bin folder of your GlassFish Server.
/Users/YourUsername/GlassFish_Server/bin
Run the asadmin command using the below command.
./asadmin
Then in the console that opens, type the below command.
start-domain
After a few seconds, the GlassFish server is now running. You can test this on your browser at the default admin port using localhost:4848 or http port of localhost:8080
To stop GlassFish, follow the same steps above, however execute the "stop-domain" command for step 3.
I hope it reduces some stress for someone.

jconsole cannot connect to local processes on my new Mac Air

I'm stumped. On my old Mac, Jconsole couldn't connect to local JVMs. I thought I had done something to mess up system configuration. Then I got a new Mac. The first thing I did was download a jdk, install it and check to see if jconsole could connect. It could.
Then I pulled over users and applications from my old mac using my Time Machine backup drive except my system files. Still worked.
But I found that odd things were happening with my development environment. In eclipse, I could start my Jboss server, but eclipse never recognised that the Jboss server had started. So, I could never add or delete war files to it through eclipse.
Also, the jboss instance could not connect to my localhost PostGres database even though the ds file clearly gave localhost as the host to connect to.
I fixed these problems by giving my new Mac the hostname the old Mac had had.
But now I am back to not being able to connect to my local JVMs through jconsole.
This affects not just jconsole, but jprof as well so I'd like to get it fixed.
jconsole can see the JVM processes. It just times out when I try to connect.
I also tried connecting to localhost: by writing a java class that slept for five minutes and running it with the following command line:
java -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false
but I cannot connect to localhost:9010 or :9010 either.
My guess would be this is some network configuration problem, but any help would be really really appreciated.
Thanks,
George
I had similar issues with timeouts. Looking at the packets being sent, it seems that jconsole was trying to connect via an external interface and being blocked by the firewall.
I added
JAVA_TOOL_OPTIONS=-Djava.rmi.server.hostname=localhost
to my environment to ensure all java processes used localhost instead of an external interface for RMI (which is what jconsole is using for connections)

WebLogic Server IS starting and functional in Eclipse Galileo yet I get several errors on startup

I'm able to start WebLogic Server 11gR1 PatchSet 2 on my local machine and my web application is accessible after starting up WLS, yet I'm getting errors in my Eclipse Galileo Error Log on startup. Here's the messages I'm getting in ascending order:
Started WebLogic Server Monitor [mydomain#localhost:7001, Version:10.3.3.0]
Unable to find tools.jar within Java VM associated with target WebLogic runtime; features dependent on tools.jar may not function
The server cannot be launched within timeout.
Server Oracle WebLogic Server 11gR1 PatchSet 2 at localhost was unable to start within 480 seconds. If the server requires more time, try increasing the timeout in the server editor.
I've increased the timeout setting to 480 seconds (8 minutes) and one would think that's sufficient enough time for the startup.
I am able to run my web application successfully and output is generated on the Console as well so the last three error messages in the bullets above aren't show stoppers.
Wondering if any of you have run across these errors and how you went about to resolve them.
Upgraded to latest version of Eclipse Java EE (Indigo SR2 for win32) and was able to launch it with no issues.

Tomcat port in use in NetBeans

I tried searching for this problem here and in other forums but could not resolve this issue.
I have downloaded NetBeansBeans 7.0 Java EE pack which also installs Tomcat 7 which it did.
I created sample web application and when trying to deploy I get an error:
Starting of Tomcat failed, the server port 8080 is already in use.
I tried changing the ports but no success. However, when i try to run same Tomcat from Command prompt using "startup.bat" command, it runs successfully.
Operating system is Vista. I tried checking for open ports using "netstat -a" but no open port for 8080. also tried to see if any "java.exe" process is running but it was not.
Thanks in advance for the help.
Sometimes Vista, especially after hibernation, doesn't free a previously used port. Have you tried restarting the pc?

Can't Remotely Debug Tomcat Running on CentOS Virtual Machine from Eclipse on Host Windows 7

Setup
VMWare Virtual Machine
CentOS 5.5 64-bit
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
Tomcat 6.0
Host Machine
Windows 7 64-bit
Oracle/Sun JDK 1.6 64-bit
Eclipse Helios for Java EE developers
Problem
My eclipse Remote Java Application has following connection properties:
Host: 192.168.94.133
Port: 8000
When I run the above configuration, I get:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
Nothing new comes out of tomcat's log.
But when I telnet from the windows box:
bash-3.2$ telnet 192.168.94.133 8000
Trying 192.168.94.133...
Connected to 192.168.94.133.
Escape character is '^]'.
Connection closed by foreign host.
Every time I try the above telnet, tomcat spits this out in the log:
Debugger failed to attach: timeout during handshake
Because of the telnet behavior, I think the issue is in Eclipse... I'd appreciate any help.
Thanks,
-Dave
You are probably trying to connect twice to port 8000 from Eclipse (without noticing).
Switch to the Debug Perspective explicitly ("Window - Open Perspective - Debug") and see if you are connected.
Settings required in Tomcat 1)Create setenv.sh file under */tomcat/bin/. The location will be same as the catalina.sh file
2)Place the below content inside it. export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
Now start the Tomcat server. Once it is started please proceed with the below steps.
Settings required in Eclipse
3)In Eclipse go to Windows-->Preference--> General-->Network Connection --> Active Provider should be Direct. After changing to direct restart the eclipse.
4)In eclipse right click on project and debug as ->debug configuration ->Remote java application ->Create new configuration. Fill the below fields Name: as your wish Project:Select the project which you need to debug. ConnectionType: Standard socket attach Host: Localhost Port: 8000(It should be same as mentioned in point 2) Then click debug.
The debug will start at port 8000. Now you can verify by keeping breakpoints.