shdqcdsn / counterclockwise

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

Error trying to edit a Clojure source file, after upgrading to v0.31.0 #678

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

After upgrading to CCW plugin for Eclipse v0.31.0 I'm not able to open Clojure 
source files. It worked after the upgrade and first restart. I closed Eclipse, 
and I'm not longer able to open Clojure source code.

What is the expected output? What do you see instead?
* I'm expecting to open/edit Clojure source code, instead I'm getting the 
following message:

Plug-in "ccw.core" was unable to instantiate class 
"ccw.editors.clojure.ClojureEditor".

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

* Eclipse Java EE IDE for Web Developers - Version: Luna Service Release 1 
(4.4.1) - Build id: 20140925-1800

* CCW plugin v0.31.0.STABLE001

* OS: Arch Linux - 3.17.4-1-ARCH #1 SMP PREEMPT Fri Nov 21 21:14:42 CET 2014 
x86_64 GNU/Linux

* Java: java version "1.7.0_71" - OpenJDK Runtime Environment (IcedTea 2.5.3) 
(Arch Linux build 7.u71_2.5.3-1-x86_64)

Please provide any additional information below.

* The events namespace exists under the ccw plugin folder:

$ find plugins/ccw.core_0.31.0.STABLE001/ -name 'events.clj'
plugins/ccw.core_0.31.0.STABLE001/ccw/events.clj

* The previous version of the plugin is still there, not sure if this is the 
cause of the problem.
$ ls plugins/ccw.core_0.30.0.STABLE001/
build.properties  ccw  epl-v10.html  icons  lein  leiningen16x16.png  
leiningen32x32.png  leiningen-new-project.png  leiningen-standalone.jar  lib  
META-INF  plugin.properties  plugin.xml

* Attached the .log file (dot-log.txt)

Original issue reported on code.google.com by i...@akvo.org on 4 Dec 2014 at 5:51

Attachments:

GoogleCodeExporter commented 9 years ago
I deleted manually all the references to the previous version 0.30.0 and 
restarted Eclipse. I managed to open a .clj file. But after restarting I got 
the same error.

Original comment by i...@akvo.org on 4 Dec 2014 at 5:55

GoogleCodeExporter commented 9 years ago
May the problem be related to the fact that editors are automatically reopened 
when eclipse restarts ? Do things improve if you close all editors before 
restarting eclipse (and then opening an editor after eclipse has had the time 
to finish bootstrapping)? Or does it seem not to be correlated?

Still trying to figure out why the error pops up frequently but not everytime...

Original comment by laurent....@gmail.com on 4 Dec 2014 at 6:04

GoogleCodeExporter commented 9 years ago
Hi,

Well, if I close all editors and restart Eclipse, I'm able to open the Clojure 
editor. So it might be related.

Steps:

* Close all editors
* Restart Eclipse
* Open a .clj file via "Open Resource" - OK

* Leave that editor open
* Restart Eclipse
* The error -> Plug-in "ccw.core" was unable to instantiate class 
"ccw.editors.clojure.ClojureEditor". - KO

Original comment by i...@akvo.org on 4 Dec 2014 at 6:11

GoogleCodeExporter commented 9 years ago
Ok, here's the idea: ccw.events does a call to require lazily a namespace, 
inside a delay in line 12.

My guess is that this is sometimes triggered when the namespace is reachable 
via the classloaders, and sometimes not, depending on how it is triggered.

I've changed ccw.events so that the namespace loading is not deferred. Can your 
replace your version of events.clj with the attached file to see if this fixes 
the problem? (you'll need to restart eclipse).

Original comment by laurent....@gmail.com on 4 Dec 2014 at 6:13

Attachments:

GoogleCodeExporter commented 9 years ago
I'm protecting the call to (require '[ccw.core.e4.model]) since it will only be 
available for eclipse 4.x (dropping support of eclipse 3.x would remove the 
need to do these kinds of tweaks).

Original comment by laurent....@gmail.com on 4 Dec 2014 at 6:15

GoogleCodeExporter commented 9 years ago
The change in events.clj seems to solve the issue. I left a couple of Clojure 
editor tabs opened and I'm able to restart without getting the exception.

Many thanks for the support.

Original comment by i...@akvo.org on 4 Dec 2014 at 6:19

GoogleCodeExporter commented 9 years ago
Yes, the guess was spot on. Good news, I also was able to reproduce the issue 
locally, and then the fix, and finely understand the issue. It so happens that 
it is somewhat illegal to do what I did, e.g. use (require) beyond compile time 
(it was wrapped in a delay). That's why the namespace ccw.events not being 
found, the compiler tried to find a ccw.events class, unsuccessfully of course.

Many thanks for the accurate precision you gave, your patience and dedicated 
time!

Original comment by laurent....@gmail.com on 4 Dec 2014 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 4 Dec 2014 at 10:36