google.appengine.api.user spring null error -


package controller;  import java.io.ioexception;  import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import javax.servlet.http.httpsession;  import org.springframework.security.core.context.securitycontextholder; import org.springframework.stereotype.controller; import org.springframework.web.bind.annotation.requestmapping;  import com.google.appengine.api.users.userservicefactory;  import ro.mindit.configuration.userinfo;  @controller public class samplesecuredcontroller {      @requestmapping("/test")     public string test(httpservletrequest request, httpservletresponse response) throws ioexception {          com.google.appengine.api.users.userservice userservice = userservicefactory.getuserservice();         //response.sendredirect(userservice.createloginurl(request.getrequesturi()));         system.out.println(userservice.getcurrentuser());         return "redirect:/login";      } } 

can tell me why nullpointerexception here: null @ com.google.appengine.api.users.userserviceimpl.isuserloggedin(userserviceimpl.java:92)

if try : response.sendredirect(userservice.createloginurl(request.getrequesturi()));
error: api package 'user' or call 'createloginurl()' not found

can me ? need google account .i grateful if comes other sugestions .

this generated userservice.getcurrentuser() . null pointer exception inside getcurrentuser() , userservice not null

java.lang.nullpointerexception: null         @ com.google.appengine.api.users.userserviceimpl.getcurrentuser(userserviceimpl.java:105)         @ controller.samplesecuredcontroller.test(samplesecuredcontroller.java:25)         @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)         @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source)         @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source)         @ java.lang.reflect.method.invoke(unknown source)         @ org.springframework.web.method.support.invocablehandlermethod.doinvoke(invocablehandlermethod.java:221)         @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:137)         @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:110)         @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:776)         @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:705)         @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85)         @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959)         @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893)         @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:967)         @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:858)         @ javax.servlet.http.httpservlet.service(httpservlet.java:622)         @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:843)         @ javax.servlet.http.httpservlet.service(httpservlet.java:729)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:199)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:330)         @ org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:118)         @ org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:84)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.session.sessionmanagementfilter.dofilter(sessionmanagementfilter.java:103)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:154)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:199)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:110)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.csrf.csrffilter.dofilterinternal(csrffilter.java:85)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.header.headerwriterfilter.dofilterinternal(headerwriterfilter.java:57)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.context.request.async.webasyncmanagerintegrationfilter.dofilterinternal(webasyncmanagerintegrationfilter.java:50)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.filterchainproxy.dofilterinternal(filterchainproxy.java:192)         @ org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:160)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.web.filter.hiddenhttpmethodfilter.dofilterinternal(hiddenhttpmethodfilter.java:77)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:85)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:219)         @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:106)         @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502)         @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:142)         @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79)         @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:88)         @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518)         @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091)         @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:668)         @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1521)         @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1478)         @ java.util.concurrent.threadpoolexecutor.runworker(unknown source)         @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source)         @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)         @ java.lang.thread.run(unknown source) 

this generated response.sendredirect(userservice.createloginurl(request.getrequesturi()));

   com.google.apphosting.api.apiproxy$callnotfoundexception: api package 'user' or call 'createloginurl()' not found.         @ com.google.apphosting.api.apiproxy.makesynccall(apiproxy.java:111)         @ com.google.apphosting.api.apiproxy.makesynccall(apiproxy.java:66)         @ com.google.appengine.api.users.userserviceimpl.makesynccall(userserviceimpl.java:126)         @ com.google.appengine.api.users.userserviceimpl.createloginurl(userserviceimpl.java:59)         @ com.google.appengine.api.users.userserviceimpl.createloginurl(userserviceimpl.java:39)         @ controller.samplesecuredcontroller.test(samplesecuredcontroller.java:24)         @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)         @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source)         @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source)         @ java.lang.reflect.method.invoke(unknown source)         @ org.springframework.web.method.support.invocablehandlermethod.doinvoke(invocablehandlermethod.java:221)         @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:137)         @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:110)         @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:776)         @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:705)         @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85)         @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959)         @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893)         @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:967)         @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:858)         @ javax.servlet.http.httpservlet.service(httpservlet.java:622)         @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:843)         @ javax.servlet.http.httpservlet.service(httpservlet.java:729)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:199)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:330)         @ org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:118)         @ org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:84)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.session.sessionmanagementfilter.dofilter(sessionmanagementfilter.java:103)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:154)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:199)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:110)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.csrf.csrffilter.dofilterinternal(csrffilter.java:85)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.header.headerwriterfilter.dofilterinternal(headerwriterfilter.java:57)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.context.request.async.webasyncmanagerintegrationfilter.dofilterinternal(webasyncmanagerintegrationfilter.java:50)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)         @ org.springframework.security.web.filterchainproxy.dofilterinternal(filterchainproxy.java:192)         @ org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:160)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.security.oauth2.client.filter.oauth2clientcontextfilter.dofilter(oauth2clientcontextfilter.java:57)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.web.filter.hiddenhttpmethodfilter.dofilterinternal(hiddenhttpmethodfilter.java:77)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:85)         @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)         @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)         @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)         @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:219)         @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:106)         @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502)         @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:142)         @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79)         @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:88)         @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:518)         @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1091)         @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:668)         @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1521)         @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1478)         @ java.util.concurrent.threadpoolexecutor.runworker(unknown source)         @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source)         @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)         @ java.lang.thread.run(unknown source) 


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -