Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-compiler seems to ignore "java-sources" #68

Open
tolitius opened this issue Jan 15, 2015 · 7 comments
Open

run-compiler seems to ignore "java-sources" #68

tolitius opened this issue Jan 15, 2015 · 7 comments

Comments

@tolitius
Copy link

There is a single Java file used (it has observable state and transient things that are not easily translated to Clojure), that lives under src/java.

The normal flow: lein, compile, repl, cljsbuild, uberjar, ring server, etc.. works fine. But figwheel does not seem to find it (even if the namespace that uses it is AOTed).

Here is an example:

checking out

$ g clone https://github.com/tolitius/hface
$ cd hface
$ g co figwheel-issue      # checkout to a figwheel-issue branch                                                                                                   

normal things work (including repl, uberjar and friends)

$ lein do compile, cljsbuild once                                                                                           
Compiling ClojureScript.
Compiling "resources/public/js/app.js" from ("src/cljs" "env/dev/cljs")...
Successfully compiled "resources/public/js/app.js" in 13.565 seconds.

figwheel does not seem to be able to compile sources

$ lein figwheel
Figwheel: focusing on build-ids (app)
Compiling ClojureScript.
java.lang.ClassNotFoundException: org.hface.InstanceStatsTask, compiling:(hface/stats.clj:1:1)
    ...
    at figwheel_sidecar.core$resolve_ring_handler.invoke(core.clj:368)
    at figwheel_sidecar.core$start_server.invoke(core.clj:376)
    at user$eval12493.invoke(form-init2945378863219041657.clj:1)
    ...
    at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: org.hface.InstanceStatsTask
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    ...
    at hface.stats$eval12506$loading__4958__auto____12507.invoke(stats.clj:1)
    at hface.stats$eval12506.invoke(stats.clj:1)
    ... 56 more

hface.stats is the namespace that uses that Java class (InstanceStatsTask)


The Java file is in target/classes, all the standard pathing, nothing fancy. Almost feels like figwheel just needs to care for :java-source-paths ["src/java"]

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

This is strange, I will take a look at it. Thanks for letting me know.

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

So its having a problem resolving the ring handler hface.ui.routes/app.

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

Nevermind that last comment :)

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

Well, I have spent a bunch of time on this. And I am going to need someone who understands leiningen and the classpath better. It seems cljsbuild creates a subproject with a different environment. When I add the project :compile-path back into this subproject it finds your compiled java class but then fails for some other reason. It seems like there is a conflict in the dep trees of the environments. We have an environment setup for building cljs and we are trying to inject a route handler into that relies on the full project Java env.

The simplest solution for now is to use your own server for development.

https://github.com/bhauman/lein-figwheel#using-your-own-server

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

Also thanks for brining this to my attention. It gave me an excuse to put more time into understanding these things.

@tolitius
Copy link
Author

sure, thanks for looking into it!

"Note that you will still need to run the figwheel server in addition to your development app server if you wish to continue utilizing figwheel"

does that mean if I don't run lein figwheel, it will still work (e.g. reload and push changes to the browser)? just trying to understand the "continue utilizing figwheel" part.

@bhauman
Copy link
Owner

bhauman commented Jan 15, 2015

you will need to run lien figwheel as well :)

On Thu, Jan 15, 2015 at 4:31 PM, Anatoly notifications@github.com wrote:

sure, thanks for looking into it!

"Note that you will still need to run the figwheel server in addition to
your development app server if you wish to continue utilizing figwheel"

does that mean if I don't run lein figwheel, it will still work (e.g.
reload and push changes to the browser)? just trying to understand the "continue
utilizing figwheel
" part.


Reply to this email directly or view it on GitHub
#68 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants