Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Lamina breaks reloading in REPL #82

Closed
coltnz opened this issue Feb 4, 2014 · 9 comments
Closed

Lamina breaks reloading in REPL #82

coltnz opened this issue Feb 4, 2014 · 9 comments

Comments

@coltnz
Copy link

coltnz commented Feb 4, 2014

Don't quite see through the magic to know whats going on, but basically my app can't reload at the REPL because Alia can't reload because Lamina can't reload..

user=>  (require '[lamina.core] :reload)
nil
user=>  (require '[lamina.core] :reload-all)

CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)
user=> (pst)
CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3514)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:417)
    clojure.lang.Compiler.eval (Compiler.java:6647)
...
Caused by:
ClassCastException lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel
    lamina.trace.probe/probe-channel- (probe.clj:79)
    lamina.trace.probe/fn--21299 (probe.clj:126)
    lamina.trace.probe/probe-channel-generator/fn--21293 (probe.clj:113)
    lamina.executor.core/executor (core.clj:69)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3509)


@mpenet
Copy link
Contributor

mpenet commented Feb 4, 2014

That's unfortunate.
Let me know if that's a blocker for you, I'd consider moving the lamina based async function to a separate namespace (at least if you don't use it you wouldnt encounter this issue).

@ztellman the code in question is here https://github.com/mpenet/alia/blob/master/src/qbits/alia.clj#L253

@mpenet
Copy link
Contributor

mpenet commented Feb 5, 2014

@coltnz I looked into this, apparently it was caused by a typo and was fixed in #77 . I updated the dependency on alia, from my quick tests it seems to work now.

@mpenet
Copy link
Contributor

mpenet commented Feb 5, 2014

You can get the latest version with the update using cc.qbits/alia "2.0.0-beta7"

@coltnz
Copy link
Author

coltnz commented Feb 5, 2014

Yeah I thought that too but no...

➜  datastore-search git:(feature/alia-async) ✗ lein repl
Retrieving cc/qbits/alia/2.0.0-beta7/alia-2.0.0-beta7.pom from clojars
Retrieving cc/qbits/alia/2.0.0-beta7/alia-2.0.0-beta7.jar from clojars
.....
user=> (require '[qbits.alia :as alia] :reload)
nil
user=> (require '[qbits.alia :as alia] :reload-all)

CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)

@ztellman
Copy link
Owner

ztellman commented Feb 5, 2014

Sorry, coming to this late. Is there any AOT compilation going on?

@mpenet
Copy link
Contributor

mpenet commented Feb 6, 2014

Works for me.

; CIDER 0.5.0alpha (package: 20140114.202) (Clojure 1.5.1, nREPL 0.2.3)
user> (require '[qbits.alia :as alia] :reload)
nil
user> (require '[qbits.alia :as alia] :reload-all)
nil
user> 

As @ztellman said, maybe it's related to aot, or conflicting dependencies. try lein clean and also lein deps :tree looking for an older lamina version maybe.

@coltnz
Copy link
Author

coltnz commented Feb 11, 2014

Ok after a bunch of red herrings, I can confirm we did in fact have an AOT internal library and once AOT-ed problem went away. Seems to be potemkin and clojure AOT bugs related (this one? http://dev.clojure.org/jira/browse/CLJ-1330).

@ztellman
Copy link
Owner

Are you using the latest potemkin? There were some issues with
definterface+, and it's possible you're not using the version that fixes
it. Targeting the latest Lamina (0.5.2) will bring the latest Potemkin
along with it.

On Mon, Feb 10, 2014 at 5:17 PM, coltnz notifications@github.com wrote:

Ok after a bunch of red herrings, I can confirm we did in fact have an AOT
internal library and once AOT-ed problem went away. Seems to be potemkin
and clojure AOT bugs related (this one?
http://dev.clojure.org/jira/browse/CLJ-1330).

Reply to this email directly or view it on GitHubhttps://github.com//issues/82#issuecomment-34717503
.

@coltnz
Copy link
Author

coltnz commented Feb 11, 2014

Yep. Got my dependency list down to:

:dependencies [[org.clojure/clojure "1.6.0-alpha3"]
[com.smxemail/smx-netty-clout "1.0.10"]
[lamina "0.5.2"]])

Removed the AOT-ing of the main namespace in our SMX library and it's all good. So given that AOT and Clojure is busted, happy to close this ticket as resolved.

@coltnz coltnz closed this as completed Feb 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants