artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Could not auto complete class from jar file #410

Closed hiberabyss closed 5 years ago

hiberabyss commented 6 years ago

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 commented 6 years ago

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

hiberabyss commented 6 years ago

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 commented 5 years ago

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

hiberabyss commented 5 years ago

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

artur-shaik commented 5 years ago

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

hiberabyss commented 5 years ago

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

Javavi pid: 64020.

artur-shaik commented 5 years ago

Hm, what about vim side logs?

hiberabyss commented 5 years ago

Following is the JCdebugGetLogContent content:

artur-shaik commented 5 years ago

Lets now see with what arguments server starting up.

hiberabyss commented 5 years ago

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 commented 5 years ago

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

Now we can try to look at server logs:

hiberabyss commented 5 years ago

@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 commented 5 years ago

Can you try to do it several times. Sometimes it shows empty buffer.

16 ноября 2018 г. 14:57:56 GMT+06:00, Hongbo Liu notifications@github.com пишет:

@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

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-439325792

hiberabyss commented 5 years ago

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

artur-shaik commented 5 years ago

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

let g:JavaComplete_JavaviLogLevel = 'trace'
hiberabyss commented 5 years ago

The logs are stored in following file. java.log

artur-shaik commented 5 years ago

Looks ok. What about java's packages? Does it complete java.util.?

On 11-18 (22:36), Hongbo Liu wrote:

The logs are stored in following file. [1]java.log

— You are receiving this because you were mentioned. Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.

References

Visible links

  1. https://github.com/artur-shaik/vim-javacomplete2/files/2594044/java.log
  2. https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-439786329
  3. https://github.com/notifications/unsubscribe-auth/AEozu8SQxi5TmsB3Tr935M6_MWhRVCjRks5uwlF2gaJpZM4YQHtC

-- Best regards, Artur Shaikhullin

hiberabyss commented 5 years ago

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

artur-shaik commented 5 years ago

One more thing. Can you clean ~/.cache/javacomplete2 directory, then run vim, and show server logs.

On 11-19 (01:28), Hongbo Liu wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

Visible links

  1. https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-439826663
  2. https://github.com/notifications/unsubscribe-auth/AEozu9djufgVabRJ3o2OrytXUu4bwNf6ks5uwnnQgaJpZM4YQHtC

-- Best regards, Artur Shaikhullin

hiberabyss commented 5 years ago

Do I need to set the log level to trace?

artur-shaik commented 5 years ago

Yes.

On 11-19 (01:40), Hongbo Liu wrote:

Do I need to set the log level to trace?

— You are receiving this because you were mentioned. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

Visible links

  1. https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-439830501
  2. https://github.com/notifications/unsubscribe-auth/AEozu7UdKIT6kBCdlRYPE8b-I30g3Bu9ks5uwnyagaJpZM4YQHtC

-- Best regards, Artur Shaikhullin

hiberabyss commented 5 years ago

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

artur-shaik commented 5 years ago

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 commented 5 years ago

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

artur-shaik commented 5 years ago

Is there anything now?

20 ноября 2018 г. 9:01:37 GMT+06:00, Hongbo Liu notifications@github.com пишет:

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

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-440120349

hiberabyss commented 5 years ago

Still could not complete class from hadoop-common library.

artur-shaik commented 5 years ago

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

hiberabyss commented 5 years ago

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

image

artur-shaik commented 5 years ago

Can you attach this file?

On 11-20 (18:40), Hongbo Liu wrote:

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

[2]image

— You are receiving this because you were mentioned. Reply to this email directly, [3]view it on GitHub, or [4]mute the thread.

References

Visible links

  1. https://github.com/artur-shaik
  2. https://user-images.githubusercontent.com/2898670/48815569-daa6f280-ed79-11e8-8a26-ab8d0a66784a.png
  3. https://github.com/artur-shaik/vim-javacomplete2/issues/410#issuecomment-440507803
  4. https://github.com/notifications/unsubscribe-auth/AEozu9gRiPT60kqUhY4bdSf7yQIRtu5_ks5uxL0hgaJpZM4YQHtC

-- Best regards, Artur Shaikhullin

hiberabyss commented 5 years ago

Of course:

class_packages_default.tar.gz

artur-shaik commented 5 years ago

@hiberabyss thank you, for participation