Code Monkey home page Code Monkey logo

Comments (10)

sid-code avatar sid-code commented on May 28, 2024

Stack trace from java-mode's run-mode-hooks

Debugger entered--Lisp error: (wrong-type-argument lsp--workspace nil)
  signal(wrong-type-argument (lsp--workspace nil))
  lsp--set-configuration(((java (jdt (ls (vmargs . "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication"))) (errors (incompleteClasspath (severity . warning))) (configuration (updateBuildConfiguration . automatic) (maven)) (trace (server . off)) (import (gradle (enabled . t)) (maven (enabled . t)) (exclusions "**/node_modules/**" "**/.metadata/**" "**/archetype-resources/**" "**/META-INF/maven/**")) (referencesCodeLens (enabled . t)) (progressReports (enabled . t)) (signatureHelp (enabled . t)) (implementationsCodeLens (enabled . t)) (format (enabled . t) (settings (profile) (url)) (comments (enabled . :json-false))) (saveActions (organizeImports . t)) (contentProvider) (autobuild (enabled . t)) (completion (favoriteStaticMembers "org.junit.Assert.*" "org.junit.Assume.*" "org.junit.jupiter.api.Assertions.*" "org.junit.jupiter.api.Assumptions.*" "org.junit.jupiter.api.DynamicContainer.*" "org.junit.jupiter.api.DynamicTest.*") (importOrder "java" "javax" "com" "org")))))
  lsp-java-update-user-settings()
  lsp-java--after-start()
  apply(lsp-java--after-start nil)
  #f(advice-wrapper :after #f(compiled-function () (interactive nil) #<bytecode 0xdf16e9>) lsp-java--after-start)()
  apply(#f(advice-wrapper :after #f(compiled-function () (interactive nil) #<bytecode 0xdf16e9>) lsp-java--after-start) nil)
  lsp-java-enable()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook))
  run-mode-hooks(java-mode-hook)

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

This error is usually caused by a failure in JDT process. There are several bugs on lsp-mode side for better handling of process crash. Can you do the following:

  1. Check the content of *lsp-java stderr*
  2. Make sure the jdt process is running
  3. To further diagnose the issue you could do M-x-eval-expression and then type (lsp-java--ls-command) which will generate the parameters that are used for starting LSP server.

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

Can you also remove : (add-hook 'prog-mode-hook 'lsp-mode) from the following snippet too:

(use-package lsp-mode
  :ensure t
  :defer t
  :init
  (add-hook 'prog-mode-hook 'lsp-mode))```

from lsp-java.

sid-code avatar sid-code commented on May 28, 2024

I removed all hooks, restarted emacs, and tried to open a java file, did M-x lsp-mode and M-x lsp-java-enable, which resulted in the same error.

*lsp-java stderr*:

Process lsp-java stderr finished

As far as I can tell, the jdt process is not running.

from lsp-java.

sid-code avatar sid-code commented on May 28, 2024

I ran the command given by (lsp-java--ls-command) and it exits with error code 13. Deleting my workspace folder fixed this, but the error I opened this issue with still persists regardless of whether I have the jdt server running in a terminal or not.

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

Is the JDT server process running in process explorer?

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

The run in the terminal was just to diagnose the JDT issue. Can you kill the JDT that is running in the terminal, delete the workspace folder (just to make sure it is ok) and then restart emacs. Then after opening *.java you should check whether the JDT instance started by LSP java is up and running.

from lsp-java.

sid-code avatar sid-code commented on May 28, 2024

It does not run.

After doing this a couple of times, I've realized that this error shows up even before I run lsp-java-enable:

From *Messages*:

Lsp mode enabled in current buffer
Error during redisplay: (eval (lsp-mode-line)) signaled (wrong-type-argument lsp--workspace nil) [2 times]

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

Can you make sure you are not enabling lsp-mode before lsp-enable-java call?

from lsp-java.

sid-code avatar sid-code commented on May 28, 2024

Ha, it seems like that was it. I was under the impression that lsp-mode needs to be on before lsp-java-enable can be called, guess that was completely wrong.

from lsp-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.