History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2651
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robin Shen
Reporter: Jaroslav Gorjatsev
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
QuickBuild

NullPointerException when trying to run conf that was copied via REST

Created: 29/Feb/16 09:35 PM   Updated: 02/Mar/16 12:12 AM
Component/s: None
Affects Version/s: 6.1.0
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: None
Image Attachments:

1. var_prompt.png
(23 kb)


 Description  « Hide

We've bunch of configurations that where copied via REST and after that they can't be started manually giving exception below.
However, build can be started via scheduler or if triggered by "Trigger Step".
Also if create an any new configuration under this copied configuration, then it will give the same exception. So it seems something is wrong in the topmost copied config.


Stacktrace:

Error Details:

Message: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at [ [Component id = run]] on component [ [Component id = run]] threw an exception

Root cause:

java.lang.NullPointerException


Complete stack:

org.apache.wicket.WicketRuntimeException: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at [ [Component id = run]] on component [ [Component id = run]] threw an exception
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:282)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:220)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:179)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:719)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor527.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:272)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:220)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:179)
at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:165)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:719)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)



 All   Comments   Work Log   Change History      Sort Order:
Jaroslav Gorjatsev [29/Feb/16 09:47 PM]
Also triggering via REST works, so affects only UI triggering

Jaroslav Gorjatsev [29/Feb/16 10:22 PM]
Found an issue. For some reason variables that were also copied along with configurations had no prompt option set (had to be No Prompt)

Robin Shen [01/Mar/16 12:40 AM]
I tried but can not reproduce. Can you please demonstrate this issue with an sample database and get it send to [robin AT pmease DOT com]?

Jaroslav Gorjatsev [01/Mar/16 01:26 AM]
To repro try following:

Create confs:

Root/level1/level2/level3

create var on level2, let's say named test
issue following REST request for level3 config with following payload:

<?xml version="1.0" ?>
<com.pmease.quickbuild.model.Configuration>
  <id>LEVEL3_ID</id>
  <parent>LEVEL2_ID</parent>
  <name>test</name>
  <versionManagerDOM>
    <com.pmease.quickbuild.setting.configuration.version.UseSpecifiedVersion revision="0.0.0">
      <version>1.0.0</version>
    </com.pmease.quickbuild.setting.configuration.version.UseSpecifiedVersion>
  </versionManagerDOM>
  <statusDate>2016-02-29T23:04:52.000Z</statusDate>
  <pluginSettingDOMs/>
  <data/>
  <stepDOMs/>
  <repositoryDOMs/>
  <aggregationDOMs/>
  <variables>
     <com.pmease.quickbuild.variable.Variable>
<name>test</name>
<valueProvider class="com.pmease.quickbuild.variable.CleartextValueProvider">
<value>testValue</value>
</valueProvider>
</com.pmease.quickbuild.variable.Variable>
  </variables>
  <notifications/>
  <promotions/>
</com.pmease.quickbuild.model.Configuration>


Click edit button in UI for this modified conf and you'll see that prompt option is not set. Or try running the conf and it will throw the exception.

To fix the issue we've added explicit prompt setting, i.e:
 <com.pmease.quickbuild.variable.Variable>
<name>test</name>
<valueProvider class="com.pmease.quickbuild.variable.CleartextValueProvider">
<value>testValue</value>
</valueProvider>
           <promptSetting class="com.pmease.quickbuild.variable.DoNotPrompt">
                        <remember>true</remember>
                        <allowEmpty>false</allowEmpty>
                        <order>100</order>
                       <readOnly>false</readOnly>
           </promptSetting>
</com.pmease.quickbuild.variable.Variable>

Robin Shen [02/Mar/16 12:12 AM]
The variable must have its prompt setting specified. If you are not sure about the correct format of XML, just create some template conf via UI, and then dump it via RESTful API to get it.