[
https://issues.apache.org/jira/browse/BROOKLYN-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15276491#comment-15276491
]
ASF GitHub Bot commented on BROOKLYN-259:
-----------------------------------------
Github user johnmccabe commented on the pull request:
https://github.com/apache/brooklyn-server/pull/132#issuecomment-217896393
Throwing an NPE when deploying an app to a JcloudsByonLocation that was
working before this PR:
```
2016-05-09 14:30:30,074 WARN o.a.b.c.m.i.LocalLocationManager
[brooklyn-execmanager-K1kS1uK9-466]: Failed to create location using spec
LocationSpec{type=class
org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation}@4c055676
(rethrowing)
java.lang.NullPointerException: null
at
org.apache.brooklyn.location.jclouds.JcloudsLocation.createJcloudsSshMachineLocation(JcloudsLocation.java:2319)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.jclouds.JcloudsLocation.registerJcloudsSshMachineLocation(JcloudsLocation.java:2255)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.jclouds.JcloudsLocation.registerMachineLocation(JcloudsLocation.java:2106)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.jclouds.JcloudsLocation.registerMachine(JcloudsLocation.java:2097)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.jclouds.JcloudsByonLocationResolver$1.get(JcloudsByonLocationResolver.java:156)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.jclouds.JcloudsByonLocationResolver$1.get(JcloudsByonLocationResolver.java:147)
~[brooklyn-locations-jclouds-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation.init(FixedListMachineProvisioningLocation.java:173)
~[brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.core.objs.proxy.InternalLocationFactory.createLocation(InternalLocationFactory.java:137)
~[brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.core.mgmt.internal.LocalLocationManager.createLocation(LocalLocationManager.java:94)
~[brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
org.apache.brooklyn.core.objs.proxy.InternalEntityFactory$1.run(InternalEntityFactory.java:331)
[brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[na:1.7.0_99]
at
org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
[brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[na:1.7.0_99]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_99]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_99]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_99]
```
Example location:
```
brooklyn.location.named.my-named-byon=jcloudsByon:(provider="cloudstack",endpoint="xxxxxxxxxxxxxx",region="xxxxxxxxxxxxxx",networkName="xxxxxxxxxxxxxx",user="root",password="xxxxxxxxxxxxxx",hosts="xxxxxxxxxxxxxx,yyyyyyyyyyyyy,zzzzzzzzzzzzz")
brooklyn.location.named.bt-beta-byon.identity=xxxxxxx
brooklyn.location.named.bt-beta-byon.credential=xxxxxxx
```
> jcloudsByon location spec leaks location instances
> --------------------------------------------------
>
> Key: BROOKLYN-259
> URL: https://issues.apache.org/jira/browse/BROOKLYN-259
> Project: Brooklyn
> Issue Type: Bug
> Affects Versions: 0.9.0
> Reporter: Aled Sage
> Fix For: 0.10.0
>
>
> When declaring in brooklyn.properties a location spec such as
> {noformat}
> jcloudsByon(provider="aws-ec2",region="us-east-1",user="brooklyn",password="pa55w0rd",hosts="i-12345678")
> {noformat}
> It caused new locations to be created and persisted every few seconds, but
> for those locations to be never deleted.
> ---
> This was caused by changes made in 0.9.0 to {{LocationResolver}}
> implementations, so that it creates a {{LocationSpec}} rather than
> instantiating a location directly. Unfortunately,
> {{JcloudsByonLocationResolver}} had not been updated. The REST api would poll
> this regularly to find out about the types of location, and on every poll it
> would create new locations.
> This is similar to the problem encountered for localhost, fixed in time for
> 0.9.0 in https://github.com/apache/brooklyn-server/pull/97.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)