Re: noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
Ok, I had a call to (session/get :key) during initialization of my application in a def statenemt. Thats what caused the call to before session dynamic variable is initialized. Thanks, Sven Am Montag, 24. März 2014 12:01:38 UTC+1 schrieb Sven Richter: > > Hm, > > Searching some more I found this blog post: > http://yogthos.net/blog/46-what's+new+in+lib-noir which shows the exact > same problem I guess I have. > However, using luminus I dont have much options and everything should be > setup correct already. > This is how my handler looks like: > > (def secured-routes > [(friend/authenticate user-routes user/friend-settings) >(friend/authenticate epics-routes user/friend-settings) >(friend/authenticate jira-routes user/friend-settings) >home-routes app-routes]) > > (def app > (app-handler >;; add your application routes here >secured-routes >;; add custom middleware here >:middleware [middleware/template-error-page > ;middleware/log-request > ] >;; add access rules here >:access-rules [] >;; serialize/deserialize the following data formats >;; available formats: >;; :json :json-kw :yaml :yaml-kw :edn :yaml-in-html >:formats [:json-kw :edn])) > > > I also tried this suggestion: > https://groups.google.com/forum/#!topic/enlive-clj/0WOG2CDqUDY > But it did not help neither -.- > > Any Ideas? > > Am Montag, 24. März 2014 08:11:56 UTC+1 schrieb Sven Richter: >> >> I think I tracked the problem down. In my handler I define my routes, >> which calls enlive/deftemplate, which is a macro. >> Now, if I understand this right, the macro will be called at compile >> time, when noir.session is not available yet. Is that right? >> >> How can I get around this? >> >> >> >> Am Sonntag, 23. März 2014 23:23:39 UTC+1 schrieb Sven Richter: >>> >>> Hi Sean, >>> >>> I am using a luminusweb project. So yes, noir.session gets initialized >>> and is working. I was testing that before to get a feeling for noir.session >>> at all. >>> So could this be a timing issue? Trying to access the session before it >>> is initialized? >>> >>> Thanks, >>> Sven >>> >>> Am Sonntag, 23. März 2014 23:14:33 UTC+1 schrieb Sean Corfield: Looks like the Noir session isn't initialized. Have you added the wrap-noir-session middleware? Sean On Mar 23, 2014, at 2:54 PM, Sven Richter wrote: > I have an error message that I just dont understand. This is what I am trying to do: > > (ns service) > (defn get-id [] (session/get :id)) > > (ns http) > (defn get-it [] (parse-string (:body (client/get > (str > base-url > "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" > (service/get-id)) ;this is there the error occurs >:accept :json} > > Now, when I startup ring I get the following error: > > Exception in thread "main" java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future > at clojure.core$deref_future.invoke(core.clj:2108) > at clojure.core$deref.invoke(core.clj:2129) > at noir.session$get.invoke(session.clj:24) > at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) > at lweb.services.epic$get_epics.invoke(epic.clj:19) > at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) > at lweb.services.epic$eval10850.invoke(epic.clj:43) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
Hm, Searching some more I found this blog post: http://yogthos.net/blog/46-what's+new+in+lib-noir which shows the exact same problem I guess I have. However, using luminus I dont have much options and everything should be setup correct already. This is how my handler looks like: (def secured-routes [(friend/authenticate user-routes user/friend-settings) (friend/authenticate epics-routes user/friend-settings) (friend/authenticate jira-routes user/friend-settings) home-routes app-routes]) (def app (app-handler ;; add your application routes here secured-routes ;; add custom middleware here :middleware [middleware/template-error-page ;middleware/log-request ] ;; add access rules here :access-rules [] ;; serialize/deserialize the following data formats ;; available formats: ;; :json :json-kw :yaml :yaml-kw :edn :yaml-in-html :formats [:json-kw :edn])) I also tried this suggestion: https://groups.google.com/forum/#!topic/enlive-clj/0WOG2CDqUDY But it did not help neither -.- Any Ideas? Am Montag, 24. März 2014 08:11:56 UTC+1 schrieb Sven Richter: > > I think I tracked the problem down. In my handler I define my routes, > which calls enlive/deftemplate, which is a macro. > Now, if I understand this right, the macro will be called at compile time, > when noir.session is not available yet. Is that right? > > How can I get around this? > > > > Am Sonntag, 23. März 2014 23:23:39 UTC+1 schrieb Sven Richter: >> >> Hi Sean, >> >> I am using a luminusweb project. So yes, noir.session gets initialized >> and is working. I was testing that before to get a feeling for noir.session >> at all. >> So could this be a timing issue? Trying to access the session before it >> is initialized? >> >> Thanks, >> Sven >> >> Am Sonntag, 23. März 2014 23:14:33 UTC+1 schrieb Sean Corfield: >>> >>> Looks like the Noir session isn't initialized. Have you added the >>> wrap-noir-session middleware? >>> >>> Sean >>> >>> On Mar 23, 2014, at 2:54 PM, Sven Richter >>> wrote: >>> > I have an error message that I just dont understand. This is what I am >>> trying to do: >>> > >>> > (ns service) >>> > (defn get-id [] (session/get :id)) >>> > >>> > (ns http) >>> > (defn get-it [] (parse-string (:body (client/get >>> > (str >>> > base-url >>> > >>> "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" >>> >>> >>> > (service/get-id)) >>> ;this is there the error occurs >>> >:accept :json} >>> > >>> > Now, when I startup ring I get the following error: >>> > >>> > Exception in thread "main" java.lang.ClassCastException: >>> clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future >>> > at clojure.core$deref_future.invoke(core.clj:2108) >>> > at clojure.core$deref.invoke(core.clj:2129) >>> > at noir.session$get.invoke(session.clj:24) >>> > at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) >>> > at lweb.services.epic$get_epics.invoke(epic.clj:19) >>> > at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) >>> > at lweb.services.epic$eval10850.invoke(epic.clj:43) >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
I think I tracked the problem down. In my handler I define my routes, which calls enlive/deftemplate, which is a macro. Now, if I understand this right, the macro will be called at compile time, when noir.session is not available yet. Is that right? How can I get around this? Am Sonntag, 23. März 2014 23:23:39 UTC+1 schrieb Sven Richter: > > Hi Sean, > > I am using a luminusweb project. So yes, noir.session gets initialized and > is working. I was testing that before to get a feeling for noir.session at > all. > So could this be a timing issue? Trying to access the session before it is > initialized? > > Thanks, > Sven > > Am Sonntag, 23. März 2014 23:14:33 UTC+1 schrieb Sean Corfield: >> >> Looks like the Noir session isn't initialized. Have you added the >> wrap-noir-session middleware? >> >> Sean >> >> On Mar 23, 2014, at 2:54 PM, Sven Richter wrote: >> > I have an error message that I just dont understand. This is what I am >> trying to do: >> > >> > (ns service) >> > (defn get-id [] (session/get :id)) >> > >> > (ns http) >> > (defn get-it [] (parse-string (:body (client/get >> > (str >> > base-url >> > >> "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" >> >> >> > (service/get-id)) >> ;this is there the error occurs >> >:accept :json} >> > >> > Now, when I startup ring I get the following error: >> > >> > Exception in thread "main" java.lang.ClassCastException: >> clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future >> > at clojure.core$deref_future.invoke(core.clj:2108) >> > at clojure.core$deref.invoke(core.clj:2129) >> > at noir.session$get.invoke(session.clj:24) >> > at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) >> > at lweb.services.epic$get_epics.invoke(epic.clj:19) >> > at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) >> > at lweb.services.epic$eval10850.invoke(epic.clj:43) >> >> >> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
Hi Sean, I am using a luminusweb project. So yes, noir.session gets initialized and is working. I was testing that before to get a feeling for noir.session at all. So could this be a timing issue? Trying to access the session before it is initialized? Thanks, Sven Am Sonntag, 23. März 2014 23:14:33 UTC+1 schrieb Sean Corfield: > > Looks like the Noir session isn't initialized. Have you added the > wrap-noir-session middleware? > > Sean > > On Mar 23, 2014, at 2:54 PM, Sven Richter > > > wrote: > > I have an error message that I just dont understand. This is what I am > trying to do: > > > > (ns service) > > (defn get-id [] (session/get :id)) > > > > (ns http) > > (defn get-it [] (parse-string (:body (client/get > > (str > > base-url > > > "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" > > > > (service/get-id)) ;this > is there the error occurs > >:accept :json} > > > > Now, when I startup ring I get the following error: > > > > Exception in thread "main" java.lang.ClassCastException: > clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future > > at clojure.core$deref_future.invoke(core.clj:2108) > > at clojure.core$deref.invoke(core.clj:2129) > > at noir.session$get.invoke(session.clj:24) > > at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) > > at lweb.services.epic$get_epics.invoke(epic.clj:19) > > at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) > > at lweb.services.epic$eval10850.invoke(epic.clj:43) > > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
Looks like the Noir session isn't initialized. Have you added the wrap-noir-session middleware? Sean On Mar 23, 2014, at 2:54 PM, Sven Richter wrote: > I have an error message that I just dont understand. This is what I am trying > to do: > > (ns service) > (defn get-id [] (session/get :id)) > > (ns http) > (defn get-it [] (parse-string (:body (client/get > (str > base-url > > "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" > (service/get-id)) ;this is > there the error occurs >:accept :json} > > Now, when I startup ring I get the following error: > > Exception in thread "main" java.lang.ClassCastException: > clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future > at clojure.core$deref_future.invoke(core.clj:2108) > at clojure.core$deref.invoke(core.clj:2129) > at noir.session$get.invoke(session.clj:24) > at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) > at lweb.services.epic$get_epics.invoke(epic.clj:19) > at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) > at lweb.services.epic$eval10850.invoke(epic.clj:43) signature.asc Description: Message signed with OpenPGP using GPGMail
noir.session clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
Hi, I have an error message that I just dont understand. This is what I am trying to do: (ns service) (defn get-id [] (session/get :id)) (ns http) (defn get-it [] (parse-string (:body (client/get (str base-url "rest/api/2/search?jql=issuetype=Epos&status!=closed&maxResults=1000&JSESSIONID=" (service/get-id)) ;this is there the error occurs :accept :json} Now, when I startup ring I get the following error: Exception in thread "main" java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future at clojure.core$deref_future.invoke(core.clj:2108) at clojure.core$deref.invoke(core.clj:2129) at noir.session$get.invoke(session.clj:24) at lweb.services.jira$get_jira_session_id.invoke(jira.clj:17) at lweb.services.epic$get_epics.invoke(epic.clj:19) at lweb.services.epic$get_epic_sp_map.invoke(epic.clj:40) at lweb.services.epic$eval10850.invoke(epic.clj:43) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5018.invoke(core.clj:5530) at clojure.core$load.doInvoke(core.clj:5529) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5336) at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) at clojure.core$load_lib.doInvoke(core.clj:5374) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:619) at clojure.core$load_libs.doInvoke(core.clj:5413) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:619) at clojure.core$require.doInvoke(core.clj:5496) at clojure.lang.RestFn.invoke(RestFn.java:703) at lweb.routes.epics$eval8170$loading__4910__auto8171.invoke(epics.clj:1) at lweb.routes.epics$eval8170.invoke(epics.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6608) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5018.invoke(core.clj:5530) at clojure.core$load.doInvoke(core.clj:5529) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5336) at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) at clojure.core$load_lib.doInvoke(core.clj:5374) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:619) at clojure.core$load_libs.doInvoke(core.clj:5413) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:619) at clojure.core$require.doInvoke(core.clj:5496) at clojure.lang.RestFn.invoke(RestFn.java:1523) at lweb.handler$eval4449$loading__4910__auto4450.invoke(handler.clj:1) at lweb.handler$eval4449.invoke(handler.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6619) at clojure.lang.Compiler.eval(Compiler.java:6608) at clojure.lang.Compiler.load(Compiler.java:7064) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5018.invoke(core.clj:5530) at clojure.core$load.doInvoke(core.clj:5529) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5336) at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) at clojure.core$load_lib.doInvoke(core.clj:5374) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:619) at clojure.core$load_libs.doInvoke(core.clj:5413) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:619) at clojure.core$require.doInvoke(core.clj:5496) at clojure.lang.RestFn.invoke(RestFn.java:457) at lweb.core$eval4443$loading__4910__auto.invoke(core.clj:1) at lweb.core$eval4443.invoke(core.clj:1) ... Can someone explain please what is happening here and how to do it right? Thanks, Sven -- You received this message because you are subscribed