1

Intellij won't start jboss server in domain mode using debugger. I can start it was a normal process fine but not with debugger. I can start it in standalone mode with debugger. When I start in domain mode with intellij debugger I get the following error

[Host Controller] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) [Host Controller] ERROR: transport error 202: connect failed: Connection refused [Host Controller] ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) [Host Controller] JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]

I can start the jboss server on the command line and attach a remote debugger from intellij but I would rather do everything via intellij if possible. So I would rather deploy and debug from intellij

From looking at the error I think the problem is because in domain mode the host controller is started first but the debug string applies to the server instance which isn't started till later. Intellij then tries to attach the debugger but the server isn't running so it can't attach to anything then fails. Is there anyway around this?

user260495
  • 117
  • 2
  • 13

2 Answers2

0

EDIT after the comments.

If you need to start a tool before the deployment, you can do that in the Deployment Tab of your configuration.

Klick the + icon in the 'before launch' section:

enter image description here

Choose External Tool and add a new command with +

enter image description here

Define your programm start

enter image description here

You should see your external tool in your deployment tab und the command should be executed before start of the debug.

enter image description here

hce
  • 1,107
  • 9
  • 25
  • So to make sure I am understanding correctly when you say check debugging service in JBoss I have been adding the debug string to the server group jvm args in the host.xml i.e. ` ` .Given this the first method you have outlined doesn't work this is what I have been doing. The second method doesn't work as intellij listens on the port and when the jboss process tries to start it fails because the port is already in use. Thanks. – user260495 Feb 01 '19 at 11:01
  • @user2663635 Sorry it didnt help. Although it is a common problem, that either the appserver should start the debugging service or IntelliJ, but it crashes when both do it. You should also try this https://stackoverflow.com/questions/7487526/unable-to-debug-in-java-with-eclipse – hce Feb 01 '19 at 13:40
  • Thanks yeah see that one and tried it also - both local ip and localhost resolve fine. Have you successfully debugged domain mode jboss from intellij? Just wondering if it is possible – user260495 Feb 01 '19 at 14:03
  • domain mode? no. standalone: yes. – hce Feb 01 '19 at 15:31
  • Yeah it works fine for me in standalone mode also. Think it may not be possible in domain mode as the first process started by intellij is not the process getting debugged and therefore the debugging port is not ready when intellij tries to attach. If I could somehow tell intelij to wait before trying the port I think it would work but I don't knwo how to do that. Also I can remote debug from intellij to jboss started manually when in domain mode but would like to do everything from intellij if possible - starting to think it is not possible. Thanks for your help – user260495 Feb 01 '19 at 16:05
  • Hi @user2663635. Could you try the edited suggestions? – hce Feb 01 '19 at 16:25
  • Thanks. Remote debugging works fine in domain mode, there is no problem with that. What I would like to achieve is getting intellij starting and debugging the server. Rather than start the server by hand then attach debugger. Thanks for all your help – user260495 Feb 02 '19 at 09:33
  • I'll try that. What should I put in the debug as the command to run? Can I just leave that blank? – user260495 Feb 03 '19 at 19:15
  • @user2663635 You can leave it blank as the debugging service is startet by your appserver. So when you starting debug in IntelliJ, the appserver will be startet along with your code executed beforehand. – hce Feb 03 '19 at 19:21
  • Thanks for the suggestion. When I do this I see a little red x in the run/debug configuration. The configuration starts but no apps get deployed and nothing happens after server start up. – user260495 Feb 04 '19 at 09:05
0

I mannaged to use intellij wildfly/jboss debug in domain mode using the following intellij+wildfly/jboss setup.

On wildfly/jboss domain.xml, add <jvm> port with debug configuration on the selected server:

<server-group name="YOUR_SERVER_GROUP" profile="YOUR_PROFILE">
    <jvm name="Debug">
        <!-- Debug mode: -->
        <jvm-options>
            <option value="-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:8777,suspend=n,server=n"/>
        </jvm-options>
        <!-- ...your other options -->
    </jvm>
    <!-- ... your already existing configurations -->
</server-group>

On intellij run configuration, under Startup/Connection>Debug:

  • Add the same port as in wildfly/jboss

Debug port intellij wildfly/jboss domain mode

sergioFC
  • 5,926
  • 3
  • 40
  • 54