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

Could not auto complete class from jar file #410

Closed
hiberabyss opened this issue Nov 6, 2018 · 31 comments
Closed

Could not auto complete class from jar file #410

hiberabyss opened this issue Nov 6, 2018 · 31 comments

Comments

@hiberabyss
Copy link
Contributor

Actual behavior (Required!)

Even with following setting:

let g:JavaComplete_LibsPath = expand('$HOME/.m2/repository/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar')

The following imports still could not be autocompleted, could this be supported?

import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.LongWritable;
@artur-shaik
Copy link
Owner

When you open java file, what is content of g:JavaComplete_LibsPath ?

@hiberabyss
Copy link
Contributor Author

Hi @artur-shaik , the content is same as what I set:

/Users/hbliu/.m2/repository/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar

@artur-shaik
Copy link
Owner

So, is it working after you compiled javavi by hand?

@hiberabyss
Copy link
Contributor Author

Hi @artur-shaik , still not work after compiling javavi.

@artur-shaik
Copy link
Owner

Is server up? Can you run command :JCserverShowPID, if server is running it will show you process id.

@hiberabyss
Copy link
Contributor Author

The server is up. Following is the output of command JCserverShowPID:

Javavi pid: 64020.

@artur-shaik
Copy link
Owner

Hm, what about vim side logs?

  • JCdebugEnableLogs;
  • call completion;
  • JCdebugGetLogContent.

@hiberabyss
Copy link
Contributor Author

hiberabyss commented Nov 15, 2018

Following is the JCdebugGetLogContent content:

@artur-shaik
Copy link
Owner

Lets now see with what arguments server starting up.

  • JCdebugEnableLogs
  • JCserverTerminate
  • JCserverStart
  • JCdebugGetLogContent

@hiberabyss
Copy link
Contributor Author

Following are the logs:

13.880388 [server] executing python file: /Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/autoload/javavibridge.py
13.885674 [server] server classpath: -cp /Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/libs/javavi/target/classes:/Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/libs/javapars    er-core-3.5.20.jar:/Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/libs/javavi_log4j-api.jar:/Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/libs/javavi_log4j-core.jar:/Users/hbl    iu/.m2/repository/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar:/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/lib
13.885697 [server] server arguments:-Dlog.directory=/Users/hbliu/.vimcache/java -Ddaemon.port=56260 -Dlog4j.configurationFile=/Users/hbliu/.dotfiles/data/vimdata/bundle/vim-javacomplete2/libs/javavi/targ    et/classes/log4j2.xml kg.ash.javavi.Javavi -sources  -base /Users/hbliu/.cache/javacomplete2/ -compiler javac

@artur-shaik
Copy link
Owner

Does this file hadoop-common-2.2.0.jar exists by this path?

Now we can try to look at server logs:

  • :JCcacheClear
  • :JCserverEnableTraceDebug
  • wait some time
  • :JCserverLog

@hiberabyss
Copy link
Contributor Author

@artur-shaik , the file hadoop-common-2.2.0.jar exists and I could open it in Vim. I executed the commands you provided, but there was nothing in the __JCServer_Log_Buffer__ buffer:

image

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 16, 2018 via email

@hiberabyss
Copy link
Contributor Author

@artur-shaik Tried several times, still got nothing.

@artur-shaik
Copy link
Owner

Hm, strange.
Try to set it before start in your vimrc:

let g:JavaComplete_JavaviLogLevel = 'trace'

@hiberabyss
Copy link
Contributor Author

The logs are stored in following file.
java.log

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 19, 2018 via email

@hiberabyss
Copy link
Contributor Author

The java package like java.util could be completed successfully.

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 19, 2018 via email

@hiberabyss
Copy link
Contributor Author

Do I need to set the log level to trace?

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 19, 2018 via email

@hiberabyss
Copy link
Contributor Author

Here is the logs after clear the cache directory.
java_new.log

@artur-shaik
Copy link
Owner

Hm, I don't see that data was going to be collected again. Did you open java file exactly after you removed ~/.cache/javacomplete2?

@hiberabyss
Copy link
Contributor Author

Yes, I open a java file after remove the cache directory.

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 20, 2018 via email

@hiberabyss
Copy link
Contributor Author

Still could not complete class from hadoop-common library.

@artur-shaik
Copy link
Owner

Sorry, I mean is anything in ~/.cache/javacomplete2 ?

@hiberabyss
Copy link
Contributor Author

@artur-shaik There is file in the cache directory.

image

@artur-shaik
Copy link
Owner

artur-shaik commented Nov 21, 2018 via email

@hiberabyss
Copy link
Contributor Author

Of course:

class_packages_default.tar.gz

@artur-shaik
Copy link
Owner

@hiberabyss thank you, for participation

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