0

The web application i am working on is very large and modularized, currently the ear is present as it is and not in exploded form on remote machine while the cod being debugged is on a different remote machine and i am unable to do a hot code replace as the architecture is complex and cannot be installed on the same machine. Any suggestions to enable this would be really helpful... we are using Jboss 7.x and java 1.8 and eclipse.

  • Hot code swap is done by the debug client, Eclipse in your case. So hot swap will work simple by connecting to the debugging port as long as `Project -> Build Automatically` is enabled. – LMC Mar 21 '19 at 14:08
  • @LuisMuñoz, thanks for your response on this. Actually both code and the application deployed are on different remote machines, so it is not working as of now. could you please suggest some more details on that... – pankaj sadhwani Mar 23 '19 at 06:56
  • Could be a [compatibility issue between eclipse jvm and remote debug jvm](https://wiki.eclipse.org/FAQ_What_is_hot_code_replace%3F). – LMC Mar 23 '19 at 14:15

1 Answers1

0

I do this type of debugging regularly in Wildfly/Jboss by setting the following in domain.xml

 <server-groups>

        <server-group name="s1" profile="s1">

            <jvm name="default">

                <heap size="3g" max-size="3g"/>

                <jvm-options>

                        <option value="-agentlib:jdwp=transport=dt_socket,address=remote_server_name_or_ip:8000,server=y,suspend=n"/>

...

The key here is remote_server_name_or_ip:8000

Note how you need to specify the remote_server_name_or_ip before the port number.

Without this Wildfly/Jboss will listen on localhost only. You can also specify 0.0.0.0 so that the debugging process listens on all available IP addresses.

In Eclipse you simply need to specify the remote server IP address and port.

Hot swapping is automatic as long as you don't change method signatures, etc.

This logic is not limited to JBoss or Wildfly. You can use this approach to connect to any Java code running on another machine.

For example, please see my answer which explains how to allow remote debugging with Tomcat:

Remote debugging Tomcat with Eclipse

DAB
  • 1,631
  • 19
  • 25