debugging mpi java - java

How does one debug mpijava code. Ideally, I would want to debug it on the same machine with eclipse with a master and a client running and attached to the same eclipse. Though these might be two processes but since eclipse can debug multiple running threads, may be that is possible ?

Run server with options:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y
Then run eclipse and connect to 8998 port. See How To Debug a Remote Java Application for details.

Related

Intellij IDEA getting remote logs while debugging

On my project I have several QA environments, and quite frequently need to debug it. I'm using 'Remote JVM Debug' and it works fine, but also I want to see logs. I already configured bash script to run tailf over SSH and write it to local file and in debug configuration define local file to see it in log tab of Debug view. But now I'm running these scripts manually and then running debug, and after dubug session I need to stop tailf and disconnect SSH. If I put this scripts to 'Before launch' section, it will wait until this scripts will be completed, and wont start debug itself. I know that I can define run this scripts in background, but I want them to disconnect and terminate when I'm stopping debugging. Is there some solution for this?

Remote debugging - Java

I am currently with a batch process that breaks into production, which is in a weblogic. This process can only be executed on a machine that is configured to run automatically.
My question is if a remote debugging can be done from my machine?
I really would not recommend remotely debugging a machine which is on production. However, if you must, you will need to do three things:
Startup the application with remote debugging turned ON on a port 80 or any other port of your choice by adding the following line to your java -jar command.
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=80
For example,
sudo java agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=80 -jar original-example-service-local.war
This port needs to be accessible from your machine, you will need to open this port from your security group in AWS or however you are managing this instance. This step is very important.
Add the configuration in your IDE to do remotely connect to the application. You can find many guides on this online.
For IntelliJ --> https://docs.alfresco.com/5.2/tasks/sdk-debug-intellij.html
For Eclipse --> https://docs.alfresco.com/5.2/tasks/sdk-debug-eclipse.html
Hope this helps.

Debug code on one machine, run JBoss on another

Is it possible to setup JBoss server on one machine (PC) and then connect to it from another machine (laptop) ? I want to be able to run/deploy my application on the server on the PC and through Intellij on the laptop debug my code using that JBoss instance on the PC. I'm running a domain version of JBoss. Right now I have both the server and client running on the same machine. I'm not sure how to get around doing it, thanks for any help.
Yes it is possible to remote debug your application.
If you look at the first lines in the startup script standalone.[sh|bat], you'll see that debug agent can be enabled with the --debug command switch.
Switching this debug option will enable the JPDA and will listen on port 8787 by default.
This can also be achieved using JAVA_OPTS (look at the end of standalone.conf[.bat])
Once you started WildFly, you'll need to add a remote debug configuration in IntelliJ using the IP and port of your server. Here is the official documentation.
For remote deployment, you should have a look at the jboss-cli.
In Eclipse you can connect as follows, I'm sure Intellij must have something similar as well:
Run-> Debug Configuration->Remote Java Application. Here you can define the Host and Port of the application server, irrespective of it's location, be it local or any remote location.

Debugging Apache Spark clustered application from Eclipse

I am trying to debug Spark application running on eclipse in clustered/distributed environment but not able to succeed.
Application is java based and I am running it through Eclipse. Configurations to spark for Master/worker is provided through Java only.
Though I can debug the code on driver side but as the code flow moves in Spark(i.e call to .map(..)), the debugger doesn't stop. Because that code is running in Workers JVM.
Is there anyway I can achieve this ?
I have tried giving following configurations in Tomcat through Eclipse :
-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=7761,suspend=n
and setting respective port in Debug->remote java application.
But after these settings I get the error: Failed to connect to remote VM. Connection Refused
If anybody has any solution to this, please help.
I was facing the same issue while configuring the spark debugging on remote master. But after that I've installed the spark on my Ubuntu machine then it worked fine. If you really want to debug, my suggestions are
1- configure spark on your testing machine then you can easily debug applications.
2- use IntelliJ IDEA, I've used it for for debugging if I've to use remote spark.
EDITED:
If you are going to use IntelliJ IDEA then you can easily configure remote debugging as explained here. Debugging Apache Spark Jobs

NativeProcess API Java Debugging?

What is your way to debug Java side when nativeProcess.standardInput.write method is invoked by Flex side? I know that it is possible but don't know how?
To be able to attach your Eclipse debugger to a running Java process you need to start that process with the following Java options…
-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n
Once you have done this and have restarted the server, you can use your Eclipse to attach to the running process. From Eclipse go to the Debug manager and create a new Remote Java Application configuration for the process you want to connect to. Set the port number to 8001, the same as that of the options. You will also need to enter the hostname for the machine running the Java process. That is pretty much it…

Categories

Resources