[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15535975#comment-15535975
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
+1 for  merging.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15535932#comment-15535932
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/341


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
>

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15535929#comment-15535929
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
Tested by @duncangrant (for his use-case with kubernetes in clocker, which 
also motivated his https://github.com/apache/brooklyn-server/pull/361). Merging 
now.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedR

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526804#comment-15526804
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
@neykov can you review these additional commits please? Do you agree that 
we should merge this, and not @grkvlt 's #279?

When refactoring the tests to remove duplication, I realised that if one 
uses:

```
provisioning.properties:
  password: $brooklyn:config("password")
```
And then subsequently calls `jcloudsSshMachineLocation.getHostname()` 
outside of the context of an entity, then it fails to resolve (because it 
doesn't know which entity to look at the config on).

I discussed the short term fix with @neykov, and applied it here: it avoids 
propagating the exception if the credentials can't be obtained, and it only 
look up the credentials if we really need them (e.g. for hostname on AWS, where 
we ask the VM for it).

---
I also discussed the longer term solution with @neykov. Conclusion is that 
it's hard. And that we should resolve the DSL config's context at the time the 
entity is being instantiated (e.g. storing it as a field on the 
`DslConfigSupplier` or whatever). This would mean we'd always use the entity on 
which the config was declared, rather than relying on who is looking it up. 
However, there is (probably?!) an exception to that rule: if you declare config 
with an `@brooklyn:entitySpec`, such as for a `memberSpec`, then you probably 
want it to refer to the context of the entity to be created rather than the 
entity where you are declaring the entitySpec (and therefore if setting the 
entity context on the DSL object, you'd need to ensure it is a different DSL 
object instance for each member instantiated using the entitySpec!).

That deserves its own thread on dev@brooklyn.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
>

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15525643#comment-15525643
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
The changes make sense. I think they will work even if the DSL is set on 
the location object, nothing specific to `provisioning.properties` here. Worth 
a test case to confirm? 
The result still depends on the context where evaluation happens, not where 
it's set. Or may be not, not sure how #340 interacts with this and locations 
specifically. 
Good to merge.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15516474#comment-15516474
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
@ahgittin I've rebased this against master (now that #340 is merged), and 
confirmed `JcloudsRebindStubTest` still passes.

Can you review please?


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeE

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510712#comment-15510712
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/341
  
Can we merge #340 and then look at this?  It gives clearer methods for 
dealing with semantics of copying resolved / unresolved semantics, and it moves 
`Location`'s config to be treated like others.  Many of your changes here can 
still work but some may need changing to fit with how it works.

In particular note that with #340 the `ConfigBag` exposed by 
`AbstractLocation` is an RO view.  (Not sure if that matters.)


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510550#comment-15510550
 ] 

ASF GitHub Bot commented on BROOKLYN-349:
-

Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/279
  
See https://issues.apache.org/jira/browse/BROOKLYN-349 for a description of 
the underlying problem.

Also see https://github.com/apache/brooklyn-server/pull/341 for an 
alternative fix and a test for that fix. In PR #341 the resolution is deferred 
until the value is actually requested. This was a bit more fiddly to implement, 
but more because it highlighted a problem where the `DslComponent`'s task lost 
the context of the entity that called it.

We'll only want one of this PR or #341 to be merged, I think. @grkvlt 
@ahgittin @neykov I'm keen to hear your thoughts on it.


> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-21 Thread Aled Sage (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510542#comment-15510542
 ] 

Aled Sage commented on BROOKLYN-349:


As per [~andrew.kennedy]'s comment, his PR is an alternative way of fixing that 
(https://github.com/apache/brooklyn-server/pull/279).

However, the approach taken in that PR is to resolve the values immediately, 
within {{JcloudsLocation.obtain()}}. There is a comment from [~alex.heneveld] 
on that PR about instead deferring the resolution (which is more like the 
solution in https://github.com/apache/brooklyn-server/pull/341).

I expect we'll continue the discussion in the review of those two PRs!

> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at or

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-21 Thread Aled Sage (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510532#comment-15510532
 ] 

Aled Sage commented on BROOKLYN-349:


It turns out it's not as simple as just not dumbly copying 
{{ResolvingConfigBag}}. After fixing that, we then get an NPE later:

{noformat}
java.util.concurrent.ExecutionException: 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
 Error invoking start at BasicApplicationImpl{id=gly4cy0c06}: Error invoking 
start at EmptySoftwareProcessImpl{id=dciz1ecci0}: Error resolving 
config("password"), in 
org.apache.brooklyn.util.core.task.BasicExecutionContext@1e290f55([LocalManagementContext[htUZmyYJ-pOdLMzZZ],
 BROOKLYN-SERVER]): 
org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at 
com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
at 
org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
at 
org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
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:606)
at 
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at 
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at 
org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
Caused by: 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
 Error invoking start at BasicApplicationImpl{id=gly4cy0c06}: Error invoking 
start at EmptySoftwareProcessImpl{id=dciz1ecci0}: Error resolving 
config("password"), in 
org.apache.brooklyn.util.core.task.BasicExecutionContext@1e290f55([LocalManagementContext[htUZmyYJ-pOdLMzZZ],
 BROOKLYN-SERVER]): 
org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
NullPointerException
at 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.propagate(EffectorUtils.java:318)
at 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.access$0(EffectorUtils.java:311)
at 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:326)
at 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:281)
at 
org.apache.brooklyn.core.effector.MethodEffector.call(MethodEffector.java:148)
at 
org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:56)
at 
org.apache.brooklyn.core.entity.trait.Startable$StartEffectorBody.call(Startable.java:1)
at 
org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
at 
org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:359)
at 
org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(T

[jira] [Commented] (BROOKLYN-349) NPE using yaml DSL in entity's "provisioning.properties"

2016-09-21 Thread Andrew Kennedy (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510072#comment-15510072
 ] 

Andrew Kennedy commented on BROOKLYN-349:
-

See https://github.com/apache/brooklyn-server/pull/279 for a PR that fixes this

> NPE using yaml DSL in entity's "provisioning.properties"
> 
>
> Key: BROOKLYN-349
> URL: https://issues.apache.org/jira/browse/BROOKLYN-349
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT...
> Some usage of the brooklyn DSL within an entity's "provisioning.properties" 
> config fails. This is because it fails to find the entity in context.
> Therefore a config value like {{$brooklyn:config(\"password\")}} will fail 
> (but yaml like {{$brooklyn:external(\"creds\", \"test-identity\")}} should be 
> ok, because that does not need to resolve the entity).
> As an example, add the following catalog item and then deploy the given app:
> {noformat}
> brooklyn.catalog:
>   id: example-entity
>   version: "0.1.2"
>   itemType: entity
>   item:",
> brooklyn.parameters:
> - name: password
>   default: myYamlPassword
> type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
> location:
>   jclouds:softlayer:
> waitForSshable: false
> useJcloudsSshInit: false
> services:\n"+
> - type: example-entity
>   brooklyn.config:
> onbox.base.dir.skipResolution: true
> sshMonitoring.enabled: false
> provisioning.properties:
>   password: $brooklyn:config("password")
> #  password: $brooklyn:external("creds", "test-password")
> {noformat}
> This fails with an NPE:
> {noformat}
> java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in 
> org.apache.brooklyn.util.core.task.BasicExecutionContext@2f46ac03([LocalManagementContext[mujiHu35-oUhipl25],
>  BROOKLYN-SERVER]): 
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> NullPointerException
>   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
>   at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>   at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)
>   at 
> org.apache.brooklyn.camp.brooklyn.JcloudsRebindWithYamlDslTest.newJcloudsLocation(JcloudsRebindWithYamlDslTest.java:163)
>   at 
> org.apache.brooklyn.location.jclouds.JcloudsRebindStubTest.testRebind(JcloudsRebindStubTest.java:193)
>   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:606)
>   at 
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
>   at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
>   at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
>   at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
>   at 
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
>   at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>   at org.testng.TestRunner.privateRun(TestRunner.java:767)
>   at org.testng.TestRunner.run(TestRunner.java:617)
>   at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
>   at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
>   at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
>   at org.testng.SuiteRunner.run(SuiteRunner.java:254)
>   at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>   at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
>   at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
>   at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
>   at org.testng.TestNG.run(TestNG.java:1057)
>   at 
> org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
>   at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
>   at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at BasicApplicationImpl{id=wsufdg642b}: Error invoking 
> start at EmptySoftwareProcessImpl{id=j8rtiy99gr}: Error resolving 
> config("password"), in