Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-network-stream: Wrong type argument: stringp, nil #7

Closed
skybert opened this issue Sep 11, 2018 · 6 comments
Closed

open-network-stream: Wrong type argument: stringp, nil #7

skybert opened this issue Sep 11, 2018 · 6 comments

Comments

@skybert
Copy link

skybert commented Sep 11, 2018

This looks like a cool extension for Emacs, but I cannot get it to work with remote debugging.

I've added this to my .emacs:

(use-package dap-java
  :config
  (dap-register-debug-provider
   "java"
   (lambda (conf)
     (plist-put conf :debugPort 5005)
     (plist-put conf :host "localhost")
     conf))
  (dap-register-debug-template "Example Configuration"
                             (list :type "java"
                                   :request "launch"
                                   :args ""
                                   :name "Run Configuration"))
  )

But upon running dap-debug, selecting this or any other debug template, I get:

open-network-stream: Wrong type argument: stringp, nil

Do you have any idea why?

My versions are:

dap-mode-20180909.1854
lsp-java-20180906.637
GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-04-25

Cheers!

@yyoncho
Copy link
Member

yyoncho commented Sep 11, 2018

Can you do:

(toggle-debug-on-error)
(setq lsp-print-io t)
(setq dap-print-io t)

and then after retrying paste the content of *messages* buffer and the error callstack?

@skybert
Copy link
Author

skybert commented Sep 11, 2018

Sure:

lsp--stdio-wait: Content-Length: 139

{
  "jsonrpc": "2.0",
  "method": "workspace/executeCommand",
  "params": {
    "command": "vscode.java.resolveMainClass"
  },
  "id": 23
}
Output from language server: {
  "jsonrpc": "2.0",
  "method": "window/logMessage",
  "params": {
    "type": 3,
    "message": "11 Sep 2018, 16:08:46 >> workspace/executeCommand vscode.java.resolveMainClass"
  }
}
11 Sep 2018, 16:08:46 >> workspace/executeCommand vscode.java.resolveMainClass
Output from language server: {
  "jsonrpc": "2.0",
  "id": 23,
  "error": {
    "code": -32601,
    "message": "No delegateCommandHandler for vscode.java.resolveMainClass"
  }
}
Error from the Language Server: No delegateCommandHandler for vscode.java.resolveMainClass (Method not Found)
Entering debugger...
Debugger entered--Lisp error: (error "Unable to find main class.
Please check whether the server is configured propertly")
  signal(error ("Unable to find main class.\nPlease check whether the server is configured propertly"))
  error("Unable to find main class.\nPlease check whether the server is configured propertly")
  dap-java--select-main-class()
  dap-java--populate-launch-args((:type "java" :request "launch" :args "" :name "Run Configuration"))
  dap-java--populate-default-args((:type "java" :request "launch" :args "" :name "Run Configuration"))
  dap-debug((:type "java" :request "launch" :args "" :name "Run Configuration"))
  funcall-interactively(dap-debug (:type "java" :request "launch" :args "" :name "Run Configuration"))
  #<subr call-interactively>(dap-debug record nil)
  apply(#<subr call-interactively> dap-debug (record nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> dap-debug record nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (dap-debug record nil))
  call-interactively(dap-debug record nil)
  command-execute(dap-debug record)
  #[257 "\306�!\262�\307\300!\203�

@yyoncho
Copy link
Member

yyoncho commented Sep 11, 2018

Can you paste the content of the messages buffer as well?

I believe that the jdt server is not configured with the debug extension, I suspect that you are probably using stock jdt instead of jdt eclipse che one you can fix that by making sure that you are using latest LSP Java and calling lsp-java-update-server

Also, please delete the part in the config section, it is overriding the default java function with the demo one. I will update the readme to make that clear.

(use-package dap-java)

@skybert
Copy link
Author

skybert commented Sep 11, 2018

Ok, that got me a bit further: M-x lsp-java-update-server. It indeed solves the error described in my original issue description.

I will continue tomorrow, would be awesome to get a good Java debugger in Emacs again (haven't had that since jdibug and dap-java looks even better than jdibug was.

@skybert skybert closed this as completed Sep 11, 2018
@yyoncho
Copy link
Member

yyoncho commented Sep 11, 2018

I will update the readme and I will change the code to raise an error if the server is not configured correctly, since lsp-mode is not doing that. Meanwhile update the dap-mode with today's version because l have reverted wrongly submitted cl. If you hit any issue feel free to ping me.

@skybert
Copy link
Author

skybert commented Sep 12, 2018

Thanks @yyoncho!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants