I get the same error because the key :jetty-server = nil
so, (:jetty-server this) will return nil
what turns into (.stop nil)

note that if I print 'this' after assoc'ing :jetty-server in the start
lifecycle I see the jetty server associated with the key :jetty-server

for some reason I'm loosing the reference for the jetty server between
start and stop phases.

On Tue, Feb 10, 2015 at 10:35 AM, Chris Ford <christophertf...@gmail.com>
wrote:

> What happens if you try:
>
> (.stop (:jetty-server this))
>
> instead of:
>
> (.stop jetty-server)
>
> I'm not at a repl right now, but maybe your stop method is closing over
> the value of jetty-server that's passed in when the record was constructed?
>
> On 10 February 2015 at 22:58, Gilberto Garcia <giba....@gmail.com> wrote:
>
>> Here it goes https://gist.github.com/ggarciajr/e5f1c0f1072c63705ac4
>>
>> Note that the :jetty-server is nil and it should hold the jetty server so
>> it can be stopped in the stop phase.
>>
>> #toro_tokens_rest.components.ring.Ring{:port 3000, :database 
>> #toro_tokens_rest.components.database.Database{:path /tmp/dev-leveldb}, 
>> :jetty-server nil}
>>
>> So, I bet I'm doing something wrong.
>>
>>
>> On Tue, Feb 10, 2015 at 9:45 AM, Chris Ford <christophertf...@gmail.com>
>> wrote:
>>
>>> Perhaps it would help if you posted a gist of the stacktrace you
>>> encounter?
>>>
>>> On 10 February 2015 at 20:29, Gilberto Garcia <giba....@gmail.com>
>>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I'm new to clojure and I'm trying to create a simple rest api to create
>>>> and manages to token.
>>>> I'm trying to use Stuart's component library but I'm having problems
>>>> when trying to stop a component because one of the component's map
>>>> attribute is nil, so, when I try to stop the jetty server I get a NPE.
>>>>
>>>> I bet that I'm doing something wrong and I'm failing to find what is
>>>> wrong due to my lack of clojure knowledge/experience.
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Repo:
>>>> https://github.com/ggarciajr/toro-tokens-rest/tree/adding-functionality
>>>> Branch: adding-functionality
>>>>
>>>> Thanks in advance
>>>>
>>>> --
>>>> 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.
>>>>
>>>
>>>  --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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.

Reply via email to