球衣上/后

时间:2015-05-20 21:33:53

标签: heroku jersey

我试图在heroku托管的球衣项目上做一个put或post方法。我试图做一个put这个错误。我在发帖时遇到同样的错误。

2015-05-20T21:30:29.145683 + 00:00 app [web.1]:java.lang.NullPointerException 2015-05-20T21:30:29.146362 + 00:00 app [web.1]:at com.wings.wingcore.JerseyCreates.register(JerseyCreates.java:49) 2015-05-20T21:30:29.146503 + 00:00 app [web.1]:at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2015-05-20T21:30:29.146782 + 00:00 app [web.1]:at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 2015-05-20T21:30:29.147313 + 00:00 app [web.1]:at java.lang.reflect.Method.invoke(Method.java:606) 2015-05-20T21:30:29.160539 + 00:00 app [web.1]:at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) 2015-05-20T21:30:29.148228 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher $ 1.run(AbstractJavaResourceMethodDispatcher.java:164) 2015-05-20T21:30:29.149055 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider $ TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:203) 2015-05-20T21:30:29.160207 + 00:00 app [web.1]:at org.eclipse.jetty.server.Server.handle(Server.java:445) 2015-05-20T21:30:29.160210 + 00:00 app [web.1]:at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:269) 2015-05-20T21:30:29.160211 + 00:00 app [web.1]:at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) 2015-05-20T21:30:29.160804 + 00:00 app [web.1]:at java.lang.Thread.run(Thread.java:745) 2015-05-20T21:30:29.160213 + 00:00 app [web.1]:at org.eclipse.jetty.io.AbstractConnection $ ReadCallback.run(AbstractConnection.java:358) 2015-05-20T21:30:29.160544 + 00:00 app [web.1]:at org.eclipse.jetty.util.thread.QueuedThreadPool $ 3.run(QueuedThreadPool.java:532) 2015-05-20T21:30:29.146168 + 00:00 app [web.1]:at com.wings.wingcore.utils.UserController.createUser(UserController.java:85) 2015-05-20T21:30:29.150841 + 00:00 app [web.1]:at org.glassfish.jersey.internal.Errors.process(Errors.java:267) 2015-05-20T21:30:29.151920 + 00:00 app [web.1]:at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:222) 2015-05-20T21:30:29.152067 + 00:00 app [web.1]:at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698) 2015-05-20T21:30:29.147166 + 00:00 app [web.1]:at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2015-05-20T21:30:29.150836 + 00:00 app [web.1]:at org.glassfish.jersey.internal.Errors.process(Errors.java:297) 2015-05-20T21:30:29.151625 + 00:00 app [web.1]:at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386) 2015-05-20T21:30:29.152241 + 00:00 app [web.1]:at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519) 2015-05-20T21:30:29.147721 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory $ 1.invoke(ResourceMethodInvocationHandlerFactory.java:81) 2015-05-20T21:30:29.152384 + 00:00 app [web.1]:at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138) 2015-05-20T21:30:29.148645 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:181) 2015-05-20T21:30:29.150002 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) 2015-05-20T21:30:29.150006 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) 2015-05-20T21:30:29.151154 + 00:00 app [web.1]:at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288) 2015-05-20T21:30:29.151476 + 00:00 app [web.1]:at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:401) 2015-05-20T21:30:29.149323 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:101) 2015-05-20T21:30:29.151772 + 00:00 app [web.1]:at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335) 2015-05-20T21:30:29.150004 + 00:00 app [web.1]:at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) 2015-05-20T21:30:29.150995 + 00:00 app [web.1]:at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) 2015-05-20T21:30:29.152529 + 00:00 app [web.1]:at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:564) 2015-05-20T21:30:29.150053 + 00:00 app [web.1]:at org.glassfish.jersey.server.ServerRuntime $ 2.run(ServerRuntime.java:305) 2015-05-20T21:30:29.150168 + 00:00 app [web.1]:at org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:271) 2015-05-20T21:30:29.151314 + 00:00 app [web.1]:at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110) 2015-05-20T21:30:29.150504 + 00:00 app [web.1]:at org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:267) 2015-05-20T21:30:29.152675 + 00:00 app [web.1]:at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213) 2015-05-20T21:30:29.152851 + 00:00 app [web.1]:at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097) 2015-05-20T21:30:29.153416 + 00:00 app [web.1]:at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) 2015-05-20T21:30:29.150671 + 00:00 app [web.1]:at org.glassfish.jersey.internal.Errors.process(Errors.java:315) 2015-05-20T21:30:29.153001 + 00:00 app [web.1]:at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:446) 2015-05-20T21:30:29.159652 + 00:00 app [web.1]:at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) 2015-05-20T21:30:29.153412 + 00:00 app [web.1]:at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) 2015-05-20T21:30:29.153414 + 00:00 app [web.1]:at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)

我的put / post方法:

@Path("addedit")
public class JerseyCreates {
    Gson gson = new GsonBuilder().setDateFormat(
            "yyyy-MM-dd HH:mm:ss").create();



    @PUT
    @Path("/register")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public String register(String juserlogin) throws Exception {

        JUserLogin ju;
        String msg = "error";

            try{
                ju = gson.fromJson(juserlogin, JUserLogin.class);
                UserController.createUser(ju);
                msg = "done";
            }catch(Exception e){
                e.printStackTrace();
            }

        return  msg;
    }
}

0 个答案:

没有答案