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

@hiberabyss hiberabyss commented Nov 6, 2018

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

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 6, 2018

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

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 6, 2018

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

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 12, 2018

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

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 14, 2018

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

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 14, 2018

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

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 14, 2018

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

Javavi pid: 64020.

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 14, 2018

Hm, what about vim side logs?

  • JCdebugEnableLogs;
  • call completion;
  • JCdebugGetLogContent.
@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 15, 2018

Following is the JCdebugGetLogContent content:

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 15, 2018

Lets now see with what arguments server starting up.

  • JCdebugEnableLogs
  • JCserverTerminate
  • JCserverStart
  • JCdebugGetLogContent
@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 15, 2018

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

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 16, 2018

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

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 16, 2018

@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

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 16, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 19, 2018

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

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 19, 2018

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

let g:JavaComplete_JavaviLogLevel = 'trace'
@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 19, 2018

The logs are stored in following file.
java.log

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 19, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 19, 2018

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

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 19, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 19, 2018

Do I need to set the log level to trace?

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 19, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 19, 2018

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

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 19, 2018

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

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 20, 2018

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

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 20, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 20, 2018

Still could not complete class from hadoop-common library.

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 20, 2018

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

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 21, 2018

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

image

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Nov 21, 2018

@hiberabyss

This comment has been minimized.

Copy link
Contributor Author

@hiberabyss hiberabyss commented Nov 21, 2018

@artur-shaik

This comment has been minimized.

Copy link
Owner

@artur-shaik artur-shaik commented Dec 14, 2018

@hiberabyss thank you, for participation

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.