I'm trying to define an application which has several application servers (i.e. JBoss7Server) each of them running on different locations.
I already made it work using a YAML plan and BYON locations for each server without any difficulties, but now I need to add some more functionality to it, such as defininig new sensors, and I can't find the proper way to define BYON locations in the java application descriptor.
I already tried with this for a single server:
JBoss7Server server = addChild(EntitySpec
.create(JBoss7Server.class)
.configure("httpPort", "8080+")
.configure("name", "Server")
.configure("war", "WAR_PATH")
.location(byonLocationResolver.newLocationFromString(
Maps.newHashMap(),
"byon:(hosts='10.0.1.1')",
getManagementContext().getLocationRegistry())));
But i'm getting this error:
2014-04-03 18:05:54,855 WARN Failed to create entity using spec EntitySpec{type=interface brooklyn.entity.Application} (rethrowing)
java.lang.IllegalStateException: Entity MyApplication{id=eIfSgB8c} (in null) requires a single SshMachineLocation, but has []
at brooklyn.entity.effector.EffectorTasks.getSshMachine(EffectorTasks.java:160) ~[brooklyn-core-0.7.0-SNAPSHOT.jar:na]
Caused by: java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.google.common.base.Absent.get(Absent.java:42) ~[guava-15.0.jar:na]
Any ideas?
Miguel