appengine-clj
appengine-clj copied to clipboard
UserService and interactive development
I need to use the UserService support from GAE, and I can do it with appengine-clj just fine if I use the dev_appserver.sh. However, if I want to use Jetty (so that I may use SLIME) I get always stuck at this stacktrace:
2010-05-29 12:58:35.936::WARN: EXCEPTION java.lang.NullPointerException at com.google.appengine.api.users.UserServiceImpl.getCurrentUser(UserServiceImpl.java:102) at appengine.users$user_info.invoke(users.clj:12) at appengine.users$wrap_with_user_info$fn__1605.invoke(users.clj:22) at ring.adapter.jetty$proxy_handler$fn__1585.invoke(jetty.clj:17) at ring.adapter.jetty.proxy$org.mortbay.jetty.handler.AbstractHandler0 €handle(Unknown Source) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
I thought I required a wrapper much like your with-local-datastore, so I built one to load the LocalUserServiceTestConfig (all the required imports were added to the ns form)
(defmacro with-local-user [& body] `(try (.setUp (test/local-service-test-helper (LocalUserServiceTestConfig.))) ~@body (finally (test/tear-down))))
And I'm firing up the server using this (test and users namespaces are from appengine-clj): (defonce server (with-local-user (test/with-local-datastore (run-jetty (users/wrap-with-user-info #'my-app) {:port 8080 :join? false}))))
I'm using clojure 1.2, compojure 1.4 + ring, and fukamachi's branch of you appengine-clj, but it doesn't change anything on the testing macros. Again, the application works great under the dev server and after being uploaded to google's servers too.
Could you point me towards my problem cause(s)?