JavaDocSearch

11 views
Skip to first unread message

aaron

unread,
Sep 7, 2009, 10:58:42 PM9/7/09
to eclim-user
I'm using eclim for an Android project and very impressed with it.
The only thing I don't have working is the JavaDocSearch. I get an
error like:

:JavaDocSearch String

java.lang.NullPointerException
while executing command: -command java_docsearch -n "TestApp" -f "src/
com/aaronbrice/testapp/TestApp.java" -p "String"

and on the eclimd output:

NGSession 1: 127.0.0.1: org.eclim.command.Main exited with status 1

When I try from eclim command line, I get:

java.lang.NullPointerException
at
org.eclim.plugin.jdt.command.doc.DocSearchCommand.createDocSearchResult
(DocSearchCommand.java:130)
at org.eclim.plugin.jdt.command.doc.DocSearchCommand.execute
(DocSearchCommand.java:98)
at org.eclim.command.Main.main(Main.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:332)

I'm running Ubuntu 9.04 and eclim 1.5.1.

Is there some setup I need to get this working?

Thanks,
Aaron

Eric Van Dewoestine

unread,
Sep 7, 2009, 11:34:51 PM9/7/09
to eclim...@googlegroups.com
On Mon, Sep 7, 2009 at 7:58 PM, aaron <aaron...@gmail.com> wrote:
>
> I'm using eclim for an Android project and very impressed with it.
> The only thing I don't have working is the JavaDocSearch.  I get an
> error like:
>
> :JavaDocSearch String
>
> java.lang.NullPointerException
> while executing command: -command java_docsearch -n "TestApp" -f "src/
> com/aaronbrice/testapp/TestApp.java" -p "String"

I see where the error is occurring in the code and I can add a simple
check, but I want to make sure I'm not just masking an issue that
should be handled another way. Can you send me your .classpath file
and the contents of your TestApp.java file (perhaps stripped down to
the bare minimum where the issue is still reproducible)? Or if you
can provide a full sample project for which this issue is
reproducible, that would be event better.

--
eric

Aaron Brice

unread,
Sep 7, 2009, 11:54:41 PM9/7/09
to eclim...@googlegroups.com

My classpath looks like:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

And it happens with an empty .java file.

My project is an existing project that I started developing using just
vim and then imported as an eclipse android project when someone told
me about eclim. It's not in my workspace directory. Automatic import
functions work..

Thanks,
Aaron

Eric Van Dewoestine

unread,
Sep 8, 2009, 12:32:07 AM9/8/09
to eclim...@googlegroups.com

I couldn't reproduce the issue, but I went ahead and added the null
check anyways. If you build eclim from the latest git master you
shouldn't receive that error anymore. However, I have a feeling that
the root cause of the issue is that your .classpath file is missing
the JRE_CONTAINER entry:

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

If you add that your .classpath that may solve the issue without the
need for my code fix.

--
eric

Sean king

unread,
Oct 18, 2009, 6:20:50 AM10/18/09
to eclim-user
Hi,

I met the same problem also.
It might be an Android Project related issue.
I checked the .classpath, I found that the entry you stated was not
there.
Instead, there is an andorid entry.
<classpathentry kind="con"
path="com.android.ide.eclipse.adt.ANDROID_FRMEWORK"/>

I tried replaced the above one with yours. Yes, the error message
disappeared.But no
result was found.

Do you have any ideas about this?

My platforms:
Windows Vista,
Vim7.2
Eclipse 3.5.1
Eclim 1.5.2

On Sep 8, 6:32 am, Eric Van Dewoestine <ervan...@gmail.com> wrote:
> On Mon, Sep 7, 2009 at 8:54 PM, Aaron Brice <aaron.br...@gmail.com> wrote:
>
> > On Mon, Sep 7, 2009 at 8:34 PM, Eric Van Dewoestine<ervan...@gmail.com> wrote:

Eric Van Dewoestine

unread,
Oct 18, 2009, 10:37:57 AM10/18/09
to eclim...@googlegroups.com
On Sun, Oct 18, 2009 at 3:20 AM, Sean king <seaye...@gmail.com> wrote:
>
> Hi,
>
> I met the same problem also.
> It might be an Android Project related issue.
> I checked the .classpath, I found that the entry you stated was not
> there.
> Instead, there is an andorid entry.
>    <classpathentry kind="con"
> path="com.android.ide.eclipse.adt.ANDROID_FRMEWORK"/>
>
> I tried replaced the above one with yours. Yes, the error message
> disappeared.But no
> result was found.
>
> Do you have any ideas about this?
>
> My platforms:
> Windows Vista,
> Vim7.2
> Eclipse 3.5.1
> Eclim 1.5.2

Thank you for reporting this. I'll take a closer look when I get a
chance.

--
eric

Eric Van Dewoestine

unread,
Oct 30, 2009, 2:58:51 PM10/30/09
to eclim...@googlegroups.com
On Sun, Oct 18, 2009 at 03:20:50AM -0700, Sean king wrote:
>
> Hi,
>
> I met the same problem also.
> It might be an Android Project related issue.
> I checked the .classpath, I found that the entry you stated was not
> there.
> Instead, there is an andorid entry.
> <classpathentry kind="con"
> path="com.android.ide.eclipse.adt.ANDROID_FRMEWORK"/>
>
> I tried replaced the above one with yours. Yes, the error message
> disappeared.But no
> result was found.
>
> Do you have any ideas about this?
>
> My platforms:
> Windows Vista,
> Vim7.2
> Eclipse 3.5.1
> Eclim 1.5.2

I finally got a chance to test this out and I was able to reproduce
the issue with a newly created android project. However, I was able
to resolve the issue by simply adding the missing JRE_CONTAINER entry
to my project's .classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>


<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

After saving the .classpath in vim (forcing eclim to reload it inside
of eclipse), I was able to search for jdk classes. Note, I did get an
error marker on the android con entry when saving the .classpath file,
but the changes were still applied.

Before:
$ eclim -command java_docsearch -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
<no results>

$ eclim -command java_search -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
jar:file:///usr/local/java/android-sdk-linux/platforms/android-2.0/android.jar!java/lang/String.class|1 col 1|java.lang.String

After adding the missing entry:
$ eclim -command java_docsearch -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
http://java.sun.com/javase/6/docs/api/com/sun/org/apache/xpath/internal/operations/String.html
http://java.sun.com/javase/6/docs/api/java/lang/String.html

$ eclim -command java_search -n "test_android" -f "src/org/test/android/TestAndroid.java" -p "String"
zip:///opt/java/src.zip!/com/sun/org/apache/xpath/internal/operations/String.java|27 col 14|com.sun.org.apache.xpath.internal.operations.String
zip:///opt/java/src.zip!/java/lang/String.java|92 col 20|java.lang.String
jar:file:///usr/local/java/android-sdk-linux/platforms/android-2.0/android.jar!java/lang/String.class|1 col 1|java.lang.String

--
eric

Reply all
Reply to author
Forward
0 new messages