Remote debugging from eclipse - java

I am trying to remote a debug an application which is deployed through Websphere. I have all the port configured correctly on server side and on eclipse side. I can use
telnet host port
to connect to remote host and port correctly. But When I try to connect through remote debug through eclipse, I run into the error
Failed to connect to remote VM
com.sun.jdi.connect.spi.ClosedConnectionException
What can be the possible causes for this? I have checked and searched Stackoverflow for this error already. I have tried the most things from answer on this question Eclipse Error: "Failed to connect to remote VM"

I changed the port and it worked. It was a networking issue with that port of 7777.

Related

How to debug remote JVM exposed by ngrok tunnel

I have a java process on one of my machines listening on port 4502. I have created a tunnel using ngrok so that I can access the application on my development machine. The issue I'm facing is attaching a debugger to the remote JVM.
Here is the debug java configuration I'm using:
-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n
Here is the ngrok configuration for the tunnel to the application:
ngrok http 4502
Here is the ngrok configuration for the tunnel to the JVM (I have also tried http protocol with no luck):
ngrok tcp 5005
ngrok outputs the following for the tcp tunnel:
Forwarding tcp://2.tcp.eu.ngrok.io:10928 -> 127.0.0.1:5005
Using IntelliJ, I configure the remote debugging like this:
Debugger mode: Attach to remote JVM
Host: tcp://2.tcp.eu.ngrok.io
Port: 10928
I get the following error when starting the debugger:
Error running 'Debug Author Desktop': Unable to open debugger port (tcp://2.tcp.eu.ngrok.io:10928): java.io.IOException "handshake failed - connection prematurally closed"
On the machine running the java process, I have made sure that the 5005 port is open before starting the process. On the machine using IntelliJ, I have made sure that the 10928 port is open. What must I do so that I can attach the debugger to the process running on my second machine? Any help would be appreciated.
I've found the solution. The issue was in the Remote Debugger configuration. When specifying the host, you must not include the protocol. Once I changed tcp://2.tcp.eu.ngrok.io to 2.tcp.eu.ngrok.io, it worked!

Debug Port in containerized WebLogic server

I have a containerized WebLogic server which is running on my docker host mapped with three port: 5556, 6001, 7001. I have deployed my java product and everything is successful. I have also assaign a debug port on 8453 based on this article on WebLogic:
https://docs.oracle.com/en/cloud/paas/java-cloud/jscug/enable-jvm-debug-port.html#GUID-C83E051D-3A28-4FE7-8333-20F40A06DAEA
In Intellij IDE, I configured my debug port on localhost port 8453 in ‘Edit Configuration…’ . here everything seems extremly OK and good. But as I am going to debug connection gets failed.
"unable to open debugger port (localhost:8453): java.net.connectException "Connection refused: connect"
I am a little bit naive in WebLogic server. It might be because somehow given port not mapped causes this error. Please help me if anybody there had such experience before.
The environmental variable JAVA_OPTIONS is typically being set on startWeblogic.sh. With using a dockerized weblogic, the same variable needs to be set with the debug options and the address.
For example, you can set the variable on your Dockerfile.
The following will set the debug port for the Weblogic applications to 4000 :
ENV JAVA_OPTIONS $JAVA_OPTIONS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n
Also this port needs to be exposed.
For example on docker-compose.yml:
ports:
- 4000:4000
On IntelliJ IDEA, the handshake is succesful without using IP Address of the container.

IntelliJ Community, remote debugging on server with user and password

I have a java maven application. I want to remote debug this application on server. Im using IntellJ Community. I tried to connect to localhost jar by -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 and all works great. But now I want to debug application which is on remote server (I login into this server by Microsoft Remote Server by passing ip, user and password.) I run jar on server with argument from code snippet, but in intellij I get an error ("Connection timed out"). Is it any possibility to connect with host by user and password (in intellij debug configuration I only can set host and port)?

How to bind DatagramSocket to particular port in Openshift

I am running siple java jar service on openshift which tried to connect with DatagramSocket and Getting this Exception:
java.net.BindException: Permission denied
at java.net.PlainDatagramSocketImpl.bind0(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:96)
at java.net.DatagramSocket.bind(DatagramSocket.java:397)
at java.net.DatagramSocket.<init>(DatagramSocket.java:251)
at java.net.DatagramSocket.<init>(DatagramSocket.java:304)
at java.net.DatagramSocket.<init>(DatagramSocket.java:276)
at com.gasmps.service.TerminationListener.run(EmailService.java:542)
at java.lang.Thread.run(Thread.java:745)
I know this is port permission problems but i tried with port like 8000,8443,15005,16005 but getting same how could i resolve this? How i can know all open port that can i use in my application.
Edit: My jboss server is already running in the same application and I don't want to create separate application for these jar service bcos I have to run this jar from my application from remote location.
Iv looked into this before after having the same issue and discovered the answer on stack-overflow before:
In Openshift, you may only bind to the port that the server allocates
for you. Typically that is the value of the environment variable
$OPENSHIFT_JBOSS_PORT (it varies between cartridges) and the value
differs between gears. Binding to any other port will be reported as
an SELinux policy violation and denied.
link
The port is usually 8080
you can bind your app to 8080 (not to 8000 or 8443), all traffic >received on 8000 and 8443 will be routed by the proxy to your app >listening on 8080.
This worked for me, but let me know how it goes and if it still doesn't work i'll try and help.

connecting to postgreSQL server failed

I am trying to install "Kwok information server" and I am new to postgreSQL. I just followed the installation guide of Kwok information server.
when I am trying to install kwok-schema-setup.jar file using java through postgreSQL server in Command Prompt, I am getting the following error..."Connecting to PostgreSQL Server ...failed. Connection refused. Check that the ho
stname and port are correct and that the postmaster is accepting TCP/IP connecti
ons. Cause: java.net.ConnectException: Connection refused: connect
Schema setup encountered errors" .
And when I am trying to connect to the server using pgAdmin III, I am getting the following error "Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? ".
Please anyone help me regarding, Thanks in advance!!
Looks like your Postgresql daemon is not running. Check if the server has started and is running. I dont know which OS you are using but try ps -ax on linux/mac or the task manager in windows.
Maybe a firewall that is blocking the connection, you have to provide more information about your environment to be sure.

Categories