[elephant-devel] Help with an error on app startup/initialization

Ian Eslick eslick at media.mit.edu
Thu Dec 11 21:19:10 UTC 2008


Which version of elephant are you using?
Which backend are you using?  If BDB, which version?

I presume *store-controller* open and reachable from the package you  
are in?

Looks like the elephant store isn't in the proper state (e.g. was  
closed and *store-controller* was not zeroed out).

On Dec 11, 2008, at 1:56 PM, Yarek Kowalik wrote:

> I've converted my weblocks app to use elephant.  One of the first  
> things I do is to initialize some variables.  One of the variables  
> is a "demo" item, that I use as a placeholder until the user choses  
> something more specific.  I'm having trouble initializing the  
> dummy.  Here is my code:
>
> (defun init-dummy-item ()
>   (let* ((ref-type 0)
>          (ref-id "dummy-item"))
>     (setf *dummy-item*
>           (unless-use (awhen (elephant:get-instances-by-value  
> 'product-item 'reference-id ref-id)
>                         (find-if (lambda (item)
>                                    (eql (product-item-reference-type  
> item) ref-type))
>                                  it))
>                       (make-instance
>                        'product-item
>                        :reference-type    ref-type
>                        :reference-id    ref-id
>                        :title        "No Item selected"
>                        :url        "/pub/static/dummy.html"
>                        :image-url    "/pub/images/dummy.png")))))
>
> (The UNLESS-USE macro simply does unless, and if results are nil  
> uses the second sexp.)
>
> The problem is that I get an error (see trace below) when calling  
> GET-INSTANCES-BY-VALUE.  What am I doing wrong?
>
> The nearest that I can gather is that GET-VALUE is called with the  
> secondd argument as  NIL, but it's supposed to be something  
> reasonable, i.e a controller-index-table held by the controler.  For  
> whatever raeson that's NIL.   What's the deal here?  Am I not alowed  
> to call the get-instances-by-* methods until I create at least one  
> item for each class I'm querying about?
>
> Yarek
>
> THE ERROR:
>
> There is no applicable method for the generic function
>   #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET-VALUE (3)>
> when called with arguments
>   ((FASHION-ORIGAMI::PRODUCT-ITEM
>     . FASHION-ORIGAMI::REFERENCE-ID)
>    NIL).
>    [Condition of type SIMPLE-ERROR]
>
> Restarts:
>  0: [TERMINATE-THREAD] Terminate this thread (#<THREAD "hunchentoot- 
> worker-4" RUNNING {10029A0321}>)
>
> Backtrace:
>   0: ((LAMBDA (SWANK-BACKEND::DEBUGGER-LOOP-FN)) #<FUNCTION (LAMBDA  
> #) {1003F6A4C9}>)
>   1: (SWANK::DEBUG-IN-EMACS #<SIMPLE-ERROR {1002E3A1A1}>)
>   2: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION  
> SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A9D9}>)
>   3: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION  
> {10037B86D1}> #<CLOSURE (LAMBDA #) {1002E3A9F9}>)
>   4: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {10037B86D1}>  
> #<CLOSURE (LAMBDA #) {1002E3A9D9}>)
>   5: (SWANK:INVOKE-SLIME-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)
>   6: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) #<FUNCTION  
> SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA #) {1002E3A999}>)
>   7: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)
>   8: (INVOKE-DEBUGGER #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>   9: ((SB-PCL::FAST-METHOD HUNCHENTOOT:MAYBE-INVOKE-DEBUGGER (T))  
> #<unavailable argument> #<unavailable argument> #<SIMPLE-ERROR  
> {1002E3A1A1}>)
>  10: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>  11: (ERROR #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>  12: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)
>  13: ((FLET #:LAMBDA43) #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>  14: (SIGNAL #<SIMPLE-ERROR {1002E3A1A1}>)[:EXTERNAL]
>  15: (ERROR "~@<There is no applicable method for the generic  
> function ~2I~_~S~\n          ~I~_when called with arguments  
> ~2I~_~S.~:>")[:EXTERNAL]
>       Locals:
>         SB-DEBUG::ARG-0 = 3
>         SB-DEBUG::ARG-1 = "~@<There is no applicable method for the  
> generic function ~2I~_~S~\n      ..
>  16: ((SB-PCL::FAST-METHOD NO-APPLICABLE-METHOD (T)) #<unavailable  
> argument> #<unavailable argument> #<STANDARD-GENERIC-FUNCTION  
> ELEPHANT:GET-VALUE (3)>)[:EXTERNAL]
>       Locals:
>         SB-DEBUG::ARG-0 = 5
>         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-3 = #<STANDARD-GENERIC-FUNCTION ELEPHANT:GET- 
> VALUE (3)>
>  17: (ELEPHANT::ENSURE-SLOT-DEF-INDEX #<unavailable argument>  
> #<unavailable argument>)
>       Locals:
>         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>  18: ((SB-PCL::FAST-METHOD ELEPHANT:FIND-INVERTED-INDEX  
> (ELEPHANT:PERSISTENT-METACLASS T)) #<unavailable argument>  
> #<unavailable argument> #<unavailable argument> #<unavailable  
> argument>)[:EXTERNAL]
>       Locals:
>         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-3 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-4 = :<NOT-AVAILABLE>
>  19: (ELEPHANT:MAP-INVERTED-INDEX #<unavailable argument>  
> #<unavailable argument> #<unavailable argument>)[:EXTERNAL]
>       Locals:
>         SB-DEBUG::ARG-0 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-2 = :<NOT-AVAILABLE>
>         SB-DEBUG::ARG-3 = :<NOT-AVAILABLE>
>  20: (FASHION-ORIGAMI::INIT-DUMMY-ITEM)
>       Locals:
>         #:G137 = :<NOT-AVAILABLE>
>         ANAPHORA:IT = :<NOT-AVAILABLE>
>
>
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel





More information about the elephant-devel mailing list