2009-11-30 188 views
1

我創建了幾乎與JobTypeColumn相同的插件。只有一個區別 - 它顯示工作描述而不是工作類型。 但我無法將此列添加到我的列表視圖。 我手動編輯我的config.xml後,我有一個NullPointerException。哈德森插件問題

java.lang.NullPointerException 
    at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:626) 
    at hudson.util.DescribableList.rebuildHetero(DescribableList.java:164) 
    at hudson.model.ListView.submit(ListView.java:262) 
    at hudson.model.View.doConfigSubmit(View.java:484) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:185) 
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101) 
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54) 
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74) 
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) 
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492) 
    at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:180) 
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) 
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492) 
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:408) 
    at org.kohsuke.stapler.Stapler.service(Stapler.java:117) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) 
    at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) 
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:335) 
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378) 
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) 
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:304) 
    at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:31) 
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) 
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) 
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) 
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) 
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) 
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) 
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) 
    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 winstone.FilterConfiguration.execute(FilterConfiguration.java:195) 
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) 
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) 
    at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) 
    at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) 
    at java.lang.Thread.run(Unknown Source) 

回答

2

你看過Hudson source code嗎? (描述符文件是here,但您必須首先訪問wiki頁面以閱讀用戶登錄名/密碼)。

當然,我不知道你是否使用最新的版本,但比較源代碼與堆棧跟蹤,它看起來像一個JSON對象的問題,其中哈德森無法實例化其中一個描述符。

2

直接編輯config.xml不是一個好方法。首先找出如何讓UI正確保存配置。這可能也會解決你的NPE問題,因爲你的插件可能沒有被哈德森正確拾取。