Thanks, I figured it out. It is because one of my dependency jar is missing and it caused the javax object cannot be initialized due to NullPointer problem.
On Friday, July 12, 2013 5:23:33 AM UTC-7, Ullrich Hafner wrote: > > What about setting a NPE breakpoint in your debugger? Then you will see > what is causing the NPE… > > Am 11.07.2013 um 19:43 schrieb Zhengyuan Shen <esdo...@gmail.com<javascript:> > > > > Hi everyone, > > I am implementing the function below in my Jenkins plugin. > > Utilities.login(uri, username, password); > > If I put this function inside the perform() function then there is no > problem, but if I put it inside a doFillDropdownItems() function, it gives > error like this: > > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288) > at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151) > at > org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) > at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111) > at > org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) > at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) > at > org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) > at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241) > at > org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677) > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770) > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583) > at org.kohsuke.stapler.Stapler.service(Stapler.java:214) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074) > at > hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) > at > hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) > at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) > at > hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) > at > hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) > at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) > at > org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) > at > hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) > at > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) > at org.mortbay.jetty.Server.handle(Server.java:285) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) > at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) > at > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) > > Caused by: java.lang.NullPointerException > at the line of the login function call > > > I hard coded all the uri, username, password, and I really have no idea > how can there be any null pointers. > > > > Does anyone have any idea of why this happens? > > Thanks, > > > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-de...@googlegroups.com <javascript:>. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.