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 <[email protected]>
>>> 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.