shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

Could not reset project classpath NPE #675

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Fresh Eclipse (OS X Mavericks&Yosemite) install.
2. Install CCW from marketplace
3. Create new Clojure project in a brand new workspace
4. Error occurs

What is the expected output? What do you see instead?

This one is bizarre, but the error doesn't give enough info to figure out what 
is going on. 
Upon creating a project, all the files are made, but during configuration the 
error: Configuring leiningen classpath dependencies for project "asdf" has 
encountered a problem.

Could not reset project classpath
java.lang.NullPointerException

What version of the product are you using? On what operating system?

Luna 4.4.1, CCW 4.4.1.20140925-1820
Originally OS X Mavericks, upgraded to Yosemite and same issue happens.

Please provide any additional information below.

Original issue reported on code.google.com by kephal...@gmail.com on 28 Nov 2014 at 4:22

GoogleCodeExporter commented 9 years ago
I'll note that this also happens when trying: Leiningen -> Reset project 
configuration

Original comment by kephal...@gmail.com on 28 Nov 2014 at 4:28

GoogleCodeExporter commented 9 years ago
Can you upload your workspace .metadata/.log file ?

Original comment by laurent....@gmail.com on 28 Nov 2014 at 4:31

GoogleCodeExporter commented 9 years ago
Thank you for the quick response, Laurent!

In skimming the log I'm not sure which is the root problem, but paizo is my 
hostname.

Original comment by kephal...@gmail.com on 28 Nov 2014 at 4:43

Attachments:

GoogleCodeExporter commented 9 years ago
If possible, if the issue is reproducible, then maybe you can close your 
eclipse, then delete the .log file, start the eclipse again and do as little as 
possible to reproduce the issue. This way the log may be easier to check.

Also, have you found a work-around in the mean time ?

Anything special about your setup? http proxies, things like that?

Original comment by laurent....@gmail.com on 28 Nov 2014 at 4:51

GoogleCodeExporter commented 9 years ago
Yes, it is very reproducible. It happens every time now.

This log was made by first deleting the old one
Opening eclipse
Leiningen -> Reset project dependencies

It appears to be pretty much the same log.

No, I haven't found a workaround, which is driving me a little nuts. I'm 
checking out other IDEs so I don't lose the day of coding, but I'm very much a 
CCW user.

Nothing special about my configuration, and no proxies.

Original comment by kephal...@gmail.com on 28 Nov 2014 at 4:59

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, I have checked the .log, and there's this NullPointerException which is 
the root of the problem, and it's happening in a piece of code that is probably 
undertested, related to path exclusions in source folders.

Still trying to figure out what could cause that.

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:01

GoogleCodeExporter commented 9 years ago
Can you open your eclipse installation folder, then the plugins/ folder, then 
the ccw.core folder (will have a prefix with the version number), then find and 
replace:

- nature.clj in ccw/leiningen/
- jdt.clj in ccw/

with the attached two files of the same name. I have added additional printlns 
to get more info on what the culprit fns take as input.

Then if you can post a fresh .log again, that would be nice.

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:09

GoogleCodeExporter commented 9 years ago
the mentioned files in the above comment

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago
Upps, files are missing.

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:13

GoogleCodeExporter commented 9 years ago
they're in the following comment :-) so the one 2 comments above this one :-)

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:17

GoogleCodeExporter commented 9 years ago
I have some plans to someday have part of ccw that is delivered as a git repo, 
with an easy way to branch and create test setups for users ! In the mean time, 
sorry to have you do this file danse.

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:18

GoogleCodeExporter commented 9 years ago
nature.clj wasn't working, so i tried moving the println of path into the map 
call for source-entries, but it doesnt seem to be printing in this .log

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:21

Attachments:

GoogleCodeExporter commented 9 years ago
argh, maybe it is outputting it directly to your Eclipse stdout and it's not 
redirected to the .log file :-(

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:22

GoogleCodeExporter commented 9 years ago
Ok, running eclipse from terminal:

path: #<Folder F/dasf/src> , source-folders: (#<Folder F/dasf/src> #<Folder 
F/dasf/test> #<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> nil nil)

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:25

GoogleCodeExporter commented 9 years ago
It didn't look like it was making it to the source-entry println, so I added a 
(filter identity) to the threading and this comes out:

path: #<Folder F/dasf/src> , source-folders: (#<Folder F/dasf/src> #<Folder 
F/dasf/test> #<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> nil nil)
source-entry: {:path #<Folder F/dasf/src>, :exclusion-patterns (), 
:extra-attributes {optional true}}
path: #<Folder F/dasf/test> , source-folders: (#<Folder F/dasf/src> #<Folder 
F/dasf/test> #<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> nil nil)
source-entry: {:path #<Folder F/dasf/test>, :exclusion-patterns (), 
:extra-attributes {optional true}}
path: #<Folder F/dasf/dev-resources> , source-folders: (#<Folder F/dasf/src> 
#<Folder F/dasf/test> #<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> 
nil nil)
source-entry: {:path #<Folder F/dasf/dev-resources>, :exclusion-patterns (), 
:extra-attributes {optional true}}
path: #<Folder F/dasf/resources> , source-folders: (#<Folder F/dasf/src> 
#<Folder F/dasf/test> #<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> 
nil nil)
source-entry: {:path #<Folder F/dasf/resources>, :exclusion-patterns (), 
:extra-attributes {optional true}}
path: nil , source-folders: (#<Folder F/dasf/src> #<Folder F/dasf/test> 
#<Folder F/dasf/dev-resources> #<Folder F/dasf/resources> nil nil)

If that is of any use

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:32

GoogleCodeExporter commented 9 years ago
Ooo... when I do
source-folders   (filter identity (concat (lein-source-folders lein-proj)))

It works!

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:37

GoogleCodeExporter commented 9 years ago
hourray, you've fixed the bug ! :-)

Will integrate it into the master branch, thanks !

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:39

GoogleCodeExporter commented 9 years ago
Seems like there are 2 source folders initialized through the leiningen 
project.clj map, but that are not present in the project path, thus the 2 nils.

Original comment by laurent....@gmail.com on 28 Nov 2014 at 5:48

GoogleCodeExporter commented 9 years ago
which is odd because it is a brand new project, but I'm up and coding so I'm 
not complaining!

Huzzah! Thank you Laurent!

Original comment by kephal...@gmail.com on 28 Nov 2014 at 5:54

GoogleCodeExporter commented 9 years ago
can you just try to print the 2 folders that provoke the 2 nils?

it's just a matter of adding a println trace in the nature.clj file, in the 
lein-source-folders function, near line 75.

You add:
(println "lein-raw-source-folders:" (lein-raw-source-folders lein-proj))

and we'll get the list of filesystem paths returned by leiningen, and may 
understand where those 2 are coming from.

Maybe something in your ~/.lein/settings.clj or profile.clj

Original comment by laurent....@gmail.com on 28 Nov 2014 at 6:03

GoogleCodeExporter commented 9 years ago
Pardon the switch of project, but that shouldn't have an issue on the error (i 
double checked by removing the filter identity fix

lein-raw-source-folders: (/Users/kyle/Documents/brevisdemo_workspace/brevis/src 
/Users/kyle/Documents/brevisdemo_workspace/brevis/java 
/Users/kyle/Documents/brevisdemo_workspace/brevis/test 
/Users/kyle/Documents/brevisdemo_workspace/brevis/dev-resources 
/Users/kyle/Documents/brevisdemo_workspace/brevis/resources 
/Users/kyle/Documents/brevisdemo_workspace/brevis/target/native 
/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/tools.jar 
/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/lib/sa-jdi.jar)

I've checked and the last 2 jars do exist.

Original comment by kephal...@gmail.com on 28 Nov 2014 at 6:16

GoogleCodeExporter commented 9 years ago
Ahhhh ! There are 2 jars in the end, and they are not located inside the 
project's location, thus causing the error.

I don't really understand why they're here. They're not really source folder, 
are they?

This looks a little bit like some hack introduce to circumvent leiningen's 
strict rules of not having the ability to specify local jars.

What should we do? Drop those 2 jar entries as is done via the filter identity, 
or try to get them into the project's java build path?

I'm in favor of dropping them, but I prefer asking you anyway

Original comment by laurent....@gmail.com on 28 Nov 2014 at 6:32

GoogleCodeExporter commented 9 years ago
I think would agree with dropping them. It seems likely that lein-javadoc (v 
0.1.1) is putting them there (the other active plugins are midje and localrepo).

Original comment by kephal...@gmail.com on 28 Nov 2014 at 6:44

GoogleCodeExporter commented 9 years ago
Indeed. Consider the fix included with the next release.

I fixed it differently, though: I replaced map with keep in the definition of 
lein-source-folders - just to let you know.

Cheers

Original comment by laurent....@gmail.com on 28 Nov 2014 at 6:48

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 4 Dec 2014 at 12:06