Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when starting Lein server at localhost #21

Closed
lewismc opened this issue Apr 13, 2015 · 4 comments
Closed

NPE when starting Lein server at localhost #21

lewismc opened this issue Apr 13, 2015 · 4 comments

Comments

@lewismc
Copy link
Owner

lewismc commented Apr 13, 2015

When I run lein ring server from within the app directory I get the following NPE

Retrieving ring/ring-servlet/1.2.1/ring-servlet-1.2.1.jar from clojars
Retrieving ring-refresh/ring-refresh/0.1.2/ring-refresh-0.1.2.jar from clojars
Retrieving watchtower/watchtower/0.1.1/watchtower-0.1.1.jar from clojars
2015-04-12 19:01:00.008:INFO:oejs.Server:jetty-7.6.8.v20121106
2015-04-12 19:01:00.049:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
Started server on port 3000
java.lang.NullPointerException: null
                                 core.clj:113 compojure.core/routing[fn]
                                core.clj:2515 clojure.core/some
                                 core.clj:113 compojure.core/routing
                              RestFn.java:423 clojure.lang.RestFn.invoke
                              handler.clj:166 app.handler/fn
                                 core.clj:177 compojure.core/wrap-context[fn]
                                  core.clj:46 compojure.core/if-route[fn]
                                 core.clj:113 compojure.core/routing[fn]
                                core.clj:2515 clojure.core/some
                                 core.clj:113 compojure.core/routing
                              RestFn.java:139 clojure.lang.RestFn.applyTo
                                 core.clj:626 clojure.core/apply
                                 core.clj:118 compojure.core/routes[fn]
                        keyword_params.clj:35 ring.middleware.keyword-params/wrap-keyword-params[fn]
                         nested_params.clj:84 ring.middleware.nested-params/wrap-nested-params[fn]
                                params.clj:64 ring.middleware.params/wrap-params[fn]
                                  json.clj:65 ring.middleware.json/wrap-json-response[fn]
                                 Var.java:379 clojure.lang.Var.invoke
                                reload.clj:18 ring.middleware.reload/wrap-reload[fn]
                            stacktrace.clj:17 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
                            stacktrace.clj:80 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                                 jetty.clj:18 ring.adapter.jetty/proxy-handler[fn]
                             (Unknown Source) ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
                      HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
                              Server.java:363 org.eclipse.jetty.server.Server.handle
              AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
              AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
              AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
                          HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
                          HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
                  AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
               SelectChannelEndPoint.java:628 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
                SelectChannelEndPoint.java:52 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
                    QueuedThreadPool.java:608 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
                    QueuedThreadPool.java:543 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
                              Thread.java:745 java.lang.Thread.run
java.lang.NullPointerException: null
                                 core.clj:113 compojure.core/routing[fn]
                                core.clj:2515 clojure.core/some
                                 core.clj:113 compojure.core/routing
                              RestFn.java:423 clojure.lang.RestFn.invoke
                              handler.clj:166 app.handler/fn
                                 core.clj:177 compojure.core/wrap-context[fn]
                                  core.clj:46 compojure.core/if-route[fn]
                                 core.clj:113 compojure.core/routing[fn]
                                core.clj:2515 clojure.core/some
                                 core.clj:113 compojure.core/routing
                              RestFn.java:139 clojure.lang.RestFn.applyTo
                                 core.clj:626 clojure.core/apply
                                 core.clj:118 compojure.core/routes[fn]
                        keyword_params.clj:35 ring.middleware.keyword-params/wrap-keyword-params[fn]
                         nested_params.clj:84 ring.middleware.nested-params/wrap-nested-params[fn]
                                params.clj:64 ring.middleware.params/wrap-params[fn]
                                  json.clj:65 ring.middleware.json/wrap-json-response[fn]
                                 Var.java:379 clojure.lang.Var.invoke
                                reload.clj:18 ring.middleware.reload/wrap-reload[fn]
                            stacktrace.clj:17 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
                            stacktrace.clj:80 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                                 jetty.clj:18 ring.adapter.jetty/proxy-handler[fn]
                             (Unknown Source) ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
                      HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
                              Server.java:363 org.eclipse.jetty.server.Server.handle
              AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
              AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
              AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
                          HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
                          HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
                  AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
               SelectChannelEndPoint.java:628 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
                SelectChannelEndPoint.java:52 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
                    QueuedThreadPool.java:608 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
                    QueuedThreadPool.java:543 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
                              Thread.java:745 java.lang.Thread.run
@lewismc
Copy link
Owner Author

lewismc commented Apr 13, 2015

I think this was because I had another process running on 3000. Once I killed it I get

lmcgibbn@LMC-032857 /usr/local/iPReS/app(master) $ lein ring server
2015-04-12 19:05:19.996:INFO:oejs.Server:jetty-7.6.8.v20121106
2015-04-12 19:05:20.034:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
Started server on port 3000

@lewismc lewismc closed this as completed Apr 13, 2015
@lewismc lewismc reopened this Apr 13, 2015
@lewismc
Copy link
Owner Author

lewismc commented Apr 13, 2015

Shut down my server and attempted to restart with the hope that nothing would be running on 3000 with the following results

lmcgibbn@LMC-032857 /usr/local/iPReS/app(master) $ lein ring server
2015-04-12 19:40:26.724:INFO:oejs.Server:jetty-7.6.8.v20121106
2015-04-12 19:40:26.776:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
Started server on port 3000
java.lang.NullPointerException: null
                                 core.clj:113 compojure.core/routing[fn]
                                core.clj:2515 clojure.core/some
                                 core.clj:113 compojure.core/routing
java.lang.NullPointerException: null
                              RestFn.java:423 clojure.lang.RestFn.invoke
                                 core.clj:113 compojure.core/routing[fn]
                              handler.clj:166 app.handler/fn
                                core.clj:2515 clojure.core/some
                                 core.clj:177 compojure.core/wrap-context[fn]
                                 core.clj:113 compojure.core/routing
                                  core.clj:46 compojure.core/if-route[fn]
                              RestFn.java:423 clojure.lang.RestFn.invoke
                                 core.clj:113 compojure.core/routing[fn]
                              handler.clj:166 app.handler/fn
                                core.clj:2515 clojure.core/some
                                 core.clj:177 compojure.core/wrap-context[fn]
                                 core.clj:113 compojure.core/routing
                                  core.clj:46 compojure.core/if-route[fn]
                              RestFn.java:139 clojure.lang.RestFn.applyTo
                                 core.clj:113 compojure.core/routing[fn]
                                 core.clj:626 clojure.core/apply
                                core.clj:2515 clojure.core/some
                                 core.clj:118 compojure.core/routes[fn]
                                 core.clj:113 compojure.core/routing
                        keyword_params.clj:35 ring.middleware.keyword-params/wrap-keyword-params[fn]
                              RestFn.java:139 clojure.lang.RestFn.applyTo
                         nested_params.clj:84 ring.middleware.nested-params/wrap-nested-params[fn]
                                 core.clj:626 clojure.core/apply
                                params.clj:64 ring.middleware.params/wrap-params[fn]
                                 core.clj:118 compojure.core/routes[fn]
                                  json.clj:65 ring.middleware.json/wrap-json-response[fn]
                        keyword_params.clj:35 ring.middleware.keyword-params/wrap-keyword-params[fn]
                                 Var.java:379 clojure.lang.Var.invoke
                         nested_params.clj:84 ring.middleware.nested-params/wrap-nested-params[fn]
                                reload.clj:18 ring.middleware.reload/wrap-reload[fn]
                                params.clj:64 ring.middleware.params/wrap-params[fn]
                            stacktrace.clj:17 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
                                  json.clj:65 ring.middleware.json/wrap-json-response[fn]
                            stacktrace.clj:80 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                                 Var.java:379 clojure.lang.Var.invoke
                                 jetty.clj:18 ring.adapter.jetty/proxy-handler[fn]
                                reload.clj:18 ring.middleware.reload/wrap-reload[fn]
                             (Unknown Source) ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
                            stacktrace.clj:17 ring.middleware.stacktrace/wrap-stacktrace-log[fn]
                      HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
                            stacktrace.clj:80 ring.middleware.stacktrace/wrap-stacktrace-web[fn]
                              Server.java:363 org.eclipse.jetty.server.Server.handle
                                 jetty.clj:18 ring.adapter.jetty/proxy-handler[fn]
              AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
                             (Unknown Source) ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
              AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
                      HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
              AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
                              Server.java:363 org.eclipse.jetty.server.Server.handle
                          HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
              AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
                          HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
              AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
                  AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
              AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
               SelectChannelEndPoint.java:628 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
                          HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
                SelectChannelEndPoint.java:52 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
                          HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
                    QueuedThreadPool.java:608 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
                  AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
                    QueuedThreadPool.java:543 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
               SelectChannelEndPoint.java:628 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
                              Thread.java:745 java.lang.Thread.run
                SelectChannelEndPoint.java:52 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
                    QueuedThreadPool.java:608 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
                    QueuedThreadPool.java:543 org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
                              Thread.java:745 java.lang.Thread.run

There is something not quite right here that we need to iron out

@cartermp
Copy link
Collaborator

Fixed it. Looks like we needed an explicit "else" clause in the check for a language code in the domain.

@lewismc
Copy link
Owner Author

lewismc commented Apr 13, 2015

Fantastic.

On Sunday, April 12, 2015, Phillip Carter notifications@github.com wrote:

Fixed it. Looks like we needed an explicit "else" clause in the check for
a language code in the domain.


Reply to this email directly or view it on GitHub
#21 (comment).

Lewis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants