You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/06 10:47:01 UTC

[2/2] brooklyn-server git commit: Closes #99

Closes #99

Rest API location transformers use mutable map

LocationConfig contains null values which Guava's ImmutableMap rejects with a NullPointerException.

This fixes an error observed when deploying the "Template 1: Server" sample to localhost then running `br application <id>` with the CLI. The output from the CLI was "500 Server Error". The server logs contained:

```
java.lang.NullPointerException: null value in entry: byon.machineSpecs=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33) ~[com.google.guava-guava-16.0.1.jar:na]
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:135) ~[com.google.guava-guava-16.0.1.jar:na]
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:206) ~[com.google.guava-guava-16.0.1.jar:na]
	at org.apache.brooklyn.rest.transform.LocationTransformer.copyConfig(LocationTransformer.java:128) ~[org.apache.brooklyn-brooklyn-rest-resources-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
	at org.apache.brooklyn.rest.transform.LocationTransformer.newInstance(LocationTransformer.java:189) ~[org.apache.brooklyn-brooklyn-rest-resources-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
	at org.apache.brooklyn.rest.resources.LocationResource.get(LocationResource.java:139) ~[org.apache.brooklyn-brooklyn-rest-resources-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
	at org.apache.brooklyn.rest.resources.LocationResource.get(LocationResource.java:132) ~[org.apache.brooklyn-brooklyn-rest-resources-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]

```


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/17c21d05
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/17c21d05
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/17c21d05

Branch: refs/heads/master
Commit: 17c21d05c3a2fc4d696c90d26a145ffb66302556
Parents: 423bb58 067c208
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Apr 6 11:46:40 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Apr 6 11:46:40 2016 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/brooklyn/rest/domain/LocationSpec.java | 5 +++--
 .../org/apache/brooklyn/rest/transform/LocationTransformer.java | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------