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

File mode specification error: (lsp-timed-out-error) #2

Closed
ram535 opened this issue Feb 20, 2018 · 5 comments
Closed

File mode specification error: (lsp-timed-out-error) #2

ram535 opened this issue Feb 20, 2018 · 5 comments

Comments

@ram535
Copy link

ram535 commented Feb 20, 2018

I had successfully configure cquery and a dart server with lsp-mode.
I am trying to configure lsp-javacomp but I have been not successful so far.

This is the error I receive when I open a java file after waiting around 6 seconds.

File mode specification error: (lsp-timed-out-error)

I installed the server with this commands:

M-x lsp-javacomp-install-server
M-x lsp-javacomp-update-server

This is part of my configuration:

     (use-package lsp-mode
       :config
       (require 'lsp-flycheck))

   (use-package lsp-javacomp
   :config
   (setq lsp-javacomp-server-install-dir "~/.emacs.d/javacomp/")
   (add-hook 'java-mode-hook #'lsp-javacomp-enable))

     (use-package company
       :diminish ""
       :bind (:map company-active-map
                   ("C-j" . company-select-next)
                   ("C-k" . company-select-previous))
       :custom
       (company-idle-delay 0.3)
       :config
       (push 'company-capf company-backends)
       (global-company-mode))

     (use-package company-lsp
       :config
       (setq company-lsp-enable-recompletion t)
       (setq company-lsp-async t)
       (setq company-lsp-enable-snippet t)
       (push 'company-lsp company-backends))

This is the layout of where I am testing this configuration:

.
├── javacomp.json
└── Test.java

javacomp.json

{
  "logPath": "/tmp/javacomp.log",
  "logLevel": "fine",
}

Test.java

public class Test {
   public static void main(String[] args) {
      System.out.println("Hello, java");
   }
}

@tigersoldier
Copy link
Owner

Can you paste the content of the *lsp-javacomp* buffer?

If the buffer doesn't exist, can you paste the content of the /tmp/javacomp.log file?

@ram535
Copy link
Author

ram535 commented Feb 20, 2018

lsp-javacomp stderr buffer

Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/SharedSecrets
	at org.javacomp.logging.JLogger.findCallerStackTraceElement(JLogger.java:158)
	at org.javacomp.logging.JLogger.log(JLogger.java:148)
	at org.javacomp.logging.JLogger.fine(JLogger.java:140)
	at org.javacomp.server.io.RequestReader.fillBuffer(RequestReader.java:144)
	at org.javacomp.server.io.RequestReader.readLine(RequestReader.java:66)
	at org.javacomp.server.RequestParser.parseHeader(RequestParser.java:58)
	at org.javacomp.server.RequestParser.parse(RequestParser.java:42)
	at org.javacomp.server.RequestDispatcher.dispatchRequest(RequestDispatcher.java:62)
	at org.javacomp.server.JavaComp.run(JavaComp.java:97)
	at org.javacomp.server.JavaComp.main(JavaComp.java:239)
Caused by: java.lang.ClassNotFoundException: sun.misc.SharedSecrets
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
	... 10 more

@tigersoldier
Copy link
Owner

Hmm, JavaComp doesn't work on Java 9. I filed a bug at tigersoldier/JavaComp#6. Will work on a fix and publish a release.

@tigersoldier
Copy link
Owner

tigersoldier commented Feb 20, 2018

JavaComp v1.1.1 is released with the fix. Please run M-x lsp-javacomp-update-server and restart Emacs or re-open all .java files.

BTW, you javacomp.json config is not necessary. logPath and logLevel are for debugging JavaComp only. Setting logPath to fine may crash Emacs due to too many content sent to the *lsp-javacomp* buffer.

@ram535
Copy link
Author

ram535 commented Feb 20, 2018

Yes, now it is working.
Thanks a lot.

@ram535 ram535 closed this as completed Feb 20, 2018
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