Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Valid from Datafari X.X

The way you will debug Datafari depends on the component you want to debug ! According to the module you want to debug, you will need to open a debug port on the right component JVM.

...

Here is the location of the file to modify in order to add the remote debug java option for each component of Datafari:

Component

Location of the file to modify

Where to set the java option

Tomcat (Datafari main webapp)

[DATAFARI_HOME]/tomcat/bin/setenv.sh

The file already contains a commented line that you just need to uncomment (and adjust the address parameter if needed) to enable the remote debug:

Code Block
languagebash
#CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=8696,suspend=n"

Tomcat MCF

[DATAFARI_HOME]/tomcat-mcf/bin/setenv.sh

The file already contains a commented line that you just need to uncomment (and adjust the address parameter if needed) to enable the remote debug:

Code Block
languagebash
#CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=8697,suspend=n"

ManifoldCF agent

[DATAFARI_HOME]/mcf/mcf_home/options.env.unix

As we cannot add comments to this file, unlike the other components, there is no prepared line. You will need to add the following line (and adjust the address parameter if needed) to any place in the file:

Code Block
-agentlib:jdwp=transport=dt_socket,server=y,address=8999,suspend=n

Solr

[DATAFARI_HOME]/solr/bin/solr.in.sh

The file already contains a commented line that you just need to uncomment (and adjust the address parameter if needed) to enable the remote debug:

Code Block
languagebash
#SOLR_OPTS="$SOLR_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=8984,suspend=n"

Once the java option correctly set, you will need to restart the concerned component: /wiki/spaces/DATAFARI/pages/2852716547

After that you will be able to perform remote debug debugging with your favorite IDE. For instance, using Eclipse as an IDE, if we want to debug a servlet in the Datafari webapp, after having modified the setenv.sh file to enable remote debug on port 8696, we simply need to configure a debug configuration on the datafari-webapp module as follow:

...

Then in the Debug configuration window, we need to double click on the “Remote Java Application” option to create a new remote debug conf of a JVM associated to the selected module:

...

The host depends on the location of the JVM you want to debug. If it is on the same machine where you are running your IDE then it is ‘localhost’localhost', otherwise it is the hostname of the machine holding the JVM you want to debug (in that case you will need to be sure that a connection on the specified port is allowed between the machine running the IDE and the machine running the JVM to debug).

...

Note

You must be connected to the customer’s VPN network.

If you can’t launch debugging, check the connection to the server port: nc -zvw3 datafari_server_IP port, for example nc -zvw3 10.42.9.7 8696. If the connection fails, ask for the port to be opened for external use.

...

  • in the java option of the JVM, add “*:" to the addres parameter: address=*:8696

  • in your IDEAIDE, specify the IP address where the component affected is located for the Host parameter of the Remote Debug script.

For example, if we consider debugging the datafari-webapp module of a Datafari installed on a server whose IP address is 10.42.9.7 on a VPN network:

The command line for the “[DATAFARI_HOME]/tomcat/bin/setenv.sh” sh" file:

Code Block
CATALINA_OPTS="$CATALINA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=*:8696,suspend=n"

...

For example, on a client server, all the elements described above remain valid, except for this difference: it is necessary to redirect the server desired port to the localhost:desired_port, for example to debug the webapp (Tomcat on port 8696 as described above):

...