{"record":{"id":"f1e1a9d680ce9f3c","repo":"JetBrains/intellij-community","slug":"error-text-invalid-port","errorCode":"error.text.invalid.port","errorMessage":"Port is not specified","messagePattern":"Port is not specified","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"warning","filePath":"java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java","lineNumber":301,"sourceCode":"      return DebuggerSettings.getInstance().getTransport();\n    }\n    else {\n      return mySocketTransport.isSelected() ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT;\n    }\n  }\n\n  private String getPort() {\n    if (isSocket()) {\n      return String.valueOf(myPortField.getText());\n    }\n    else {\n      return myAddressField.getText();\n    }\n  }\n\n  private void checkPort() throws ConfigurationException {\n    if (isSocket() && parsePort() == 0) {\n      throw new ConfigurationException(JavaDebuggerBundle.message(\"error.text.invalid.port\"));\n    }\n  }\n\n  private int parsePort() {\n    return Math.max(0, StringUtil.parseInt(myPortField.getText(), 0));\n  }\n\n  private void setTransport(int transport) {\n    mySocketTransport.setSelected(transport == DebuggerSettings.SOCKET_TRANSPORT);\n    myShmemTransport.setSelected(transport != DebuggerSettings.SOCKET_TRANSPORT);\n  }\n\n  private void setIsLocal(boolean b) {\n    myTransportPanel.setVisible(true);\n    myDebuggerSettings.setVisible(b);\n    myIsLocal = b;\n  }\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java#L283-L319","documentation":"Thrown by GenericDebuggerParametersRunnerConfigurable.checkPort during validation of the remote debug run configuration UI: when the Socket transport is selected, the port field must parse to a positive number; parsePort clamps invalid/empty input to 0 and checkPort raises a ConfigurationException with error.text.invalid.port ('Port is not specified').","triggerScenarios":"Applying a remote debug configuration where isSocket() is true and StringUtil.parseInt(myPortField.getText(), 0) yields 0 — empty port field, non-numeric text, negative numbers, or a value that parses to 0; checkPort() throws before the configuration is saved/started.","commonSituations":"User creates a 'Remote JVM Debug' configuration and leaves the port empty; pastes an address into the wrong field while Shmem vs Socket transport toggle is set to Socket; port field contains whitespace or formatting from copy-paste.","solutions":["Enter a valid TCP port (1-65535) in the Port field of the remote configuration","If attaching over shared memory on Windows, switch transport to Shmem and fill the address field instead","Verify the debuggee's -agentlib:jdwp ...,server=y address=PORT matches the configured port"],"exampleFix":"# before: debuggee\njava -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 App\n# IDE remote config port field empty -> error\n\n# after: IDE remote config port = 5005","handlingStrategy":"validation","validationCode":"int port = StringUtil.parseInt(portField.getText(), 0);\nif (isSocket() && (port <= 0 || port > 65535)) {\n  // block apply and highlight the port field\n}","typeGuard":null,"tryCatchPattern":"try {\n  checkPort();\n} catch (ConfigurationException e) {\n  // focus the port field, show 'Port is not specified'\n}","preventionTips":["Always fill the port field for socket transport remote configurations","Copy the port straight from the debuggee's -agentlib:jdwp address=PORT","Validate before apply so the error surfaces in the dialog, not at launch"],"tags":["debugger","remote-debug","configuration","port"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}