IntelliJ Community, remote debugging on server with user and password - java

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)?

Related

Hawtio throws "Cannot connect to Jolokia to access this Java process" exception

Hawtio throws "Cannot connect to Jolokia to access this Java process" exception for user , while trying to access container perspective from the Hawtio UI
This is what I have done so far
on hawtio server
Have a tomcat server running
Install hawtio.war file
Modify the hawtio/WEB-INF/web.xml and add my remote server IP to the param-name>proxyWhitelist
Access http://IP:3100/hawtio/login from browser and is able to see the authentication screen
authenticate successfully
Get the error when trying to connect to the remote tomcat machine
Remote server tomcat server
Install jolokia war
Modify jolokia-access.xml file -- add the HAWTIO server
curl http://localhost:3100/jolokia -- This return the Jolokia version
Can you please let me know how what else I need to change
Thanks
--

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!

Spring boot, remote host

I want to check my rest api service remotely, for this purpose i add the following lines to application.properties
server.port = 8080
server.address = 37.221.202.142
This ip address i got from this site https://2ip.ru/
But when i run my app i have the error like port is already in use. I switched a lot of ports( 8081,8082,8083 etc) but every time i got this error. When i removed this line from application.properties server.address = 37.221.202.142 Application is deployed fine but i can't connect to server using this url http://37.221.202.142:8080/managers, but this work fine http://localhost:8080/managers
What am i doing wrong?
Open command prompt and type ipconfig(if you are a windows user) or ifconfig(if your linux user).
Get the ip address of your machine. I assume you are not deploying the application in public server(azure or aws).
If your using Tomcat or Pivotal Server for deploying the war file. Double click on the sever to get the Overview of the server details and just type your IP address.
Now, restart the server and hit the IP address YOURIPADDRESS:8080 port in the browser and it should work.

Remote debugging from eclipse

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.

Timeout while deploying Java Application to remote glassfish server from Netbeans

while deploying to a remote Glassfish 4.1 Server from Netbeans 8.0.1, i get a Timeout.
I configured the Glassfish Server by adding a new Server Instance and that seemed to work. I can see the applications running on the server and i am able to undeploy a application (directly from netbeans).
But when i try to deploy my application to the remote Server, i get a timeout Exception.
(i used enable-secure-admin to gain remote access from netbeans to the server)
What confuses me is, that when i enabled secure admin, i expected to see a https:// url in netbeans. But this url starts with http:// and i cant find an option to change this.
Server Attributes:
Host: [remote-ip]
DAS Port: 4848
Domain: domain1 (same as on the remote server)
Target: empty
Username PW : as set on the remote server
"Enable JDBC Driver Deployment" and "Preserve Sessions Across Redeployment" are checked
Could you please attach the logs.
most probably its issue with the grizzly jar.
Please try the patched grizzly jar and see if it works for you.
Checkout : https://java.net/jira/browse/GRIZZLY-1713 for the same

Categories