brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-215) NPE during rebind, because SshMachineLocation.port config was null
Date Fri, 15 Jan 2016 13:40:39 GMT

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

ASF GitHub Bot commented on BROOKLYN-215:
-----------------------------------------

Github user bostko commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1150#discussion_r49853491
  
    --- Diff: brooklyn-server/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindSshMachineLocationTest.java
---
    @@ -80,5 +80,23 @@ public void testMachineUsableAfterRebind() throws Exception {
             
             assertEquals(newChildLoc.execScript(Collections.<String,Object>emptyMap(),
"mysummary", ImmutableList.of("true")), 0);
         }
    -    
    +
    +    // See https://issues.apache.org/jira/browse/BROOKLYN-215
    +    @Test(groups="Integration")
    +    public void testRebindWhenPortNull() throws Exception {
    +        SshMachineLocation machine = origManagementContext.getLocationManager().createLocation(LocationSpec.create(SshMachineLocation.class)
    +                .configure("address", "localhost")
    +                .configure("port", null));
    --- End diff --
    
    You could use SshTool.PROP_PORT.getName()


> NPE during rebind, because SshMachineLocation.port config was null
> ------------------------------------------------------------------
>
>                 Key: BROOKLYN-215
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-215
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.8.0
>            Reporter: Aled Sage
>            Priority: Critical
>             Fix For: 0.9.0
>
>
> When attempting to rebind, it failed with the exception shown below.
> {noformat}
> 2016-01-15 08:28:14,199 ERROR o.a.b.l.BrooklynLauncher [main]: Subsystem for persistence
had startup error (continuing with startup): org.apache.brooklyn.util.exceptions.PropagatedRuntimeException:
org.apache.brooklyn.util.excepti
> ons.PropagatedRuntimeException: Failure rebinding: java.lang.NullPointerException
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
>         at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:107)
~[brooklyn-utils-common-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebind(RebindManagerImpl.java:507)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.startReadOnly(RebindManagerImpl.java:303)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.ha.HighAvailabilityManagerImpl.activateHotProxy(HighAvailabilityManagerImpl.java:950)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.ha.HighAvailabilityManagerImpl.changeMode(HighAvailabilityManagerImpl.java:428)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.ha.HighAvailabilityManagerImpl.start(HighAvailabilityManagerImpl.java:255)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.launcher.BrooklynLauncher.startPersistence(BrooklynLauncher.java:889)
~[brooklyn-launcher-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.launcher.BrooklynLauncher.start(BrooklynLauncher.java:604)
~[brooklyn-launcher-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.cli.Main$LaunchCommand.call(Main.java:459) [brooklyn-cli-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.cli.Main$LaunchCommand.call(Main.java:196) [brooklyn-cli-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.cli.AbstractMain.execCli(AbstractMain.java:252) [brooklyn-cli-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.cli.AbstractMain.execCli(AbstractMain.java:244) [brooklyn-cli-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
> Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException:
Failure rebinding: java.lang.NullPointerException
>         at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.7.0_75]
>         at java.util.concurrent.FutureTask.get(FutureTask.java:188) ~[na:1.7.0_75]
>         at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
~[guava-16.0.1.jar:na]
>         at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:342) ~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebind(RebindManagerImpl.java:505)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         ... 11 common frames omitted
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Failure rebinding: java.lang.NullPointerException
>         at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:320)
~[brooklyn-utils-common-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindExceptionHandlerImpl.onDoneImpl(RebindExceptionHandlerImpl.java:482)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindExceptionHandlerImpl.onFailed(RebindExceptionHandlerImpl.java:409)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:275)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:552)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:502)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:500)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:468)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_75]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
~[na:1.7.0_75]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
~[na:1.7.0_75]
>         at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_75]
> Caused by: java.lang.NullPointerException: null
>         at org.apache.brooklyn.location.ssh.SshMachineLocation.getPort(SshMachineLocation.java:527)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.location.ssh.SshMachineLocation.toString(SshMachineLocation.java:869)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at java.lang.String.valueOf(String.java:2847) ~[na:1.7.0_75]
>         at java.lang.StringBuilder.append(StringBuilder.java:128) ~[na:1.7.0_75]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindExceptionHandlerImpl.onRebindFailed(RebindExceptionHandlerImpl.java:271)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.reconstructEverything(RebindIteration.java:540)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:240)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:263)
~[brooklyn-core-0.9.0-20151120.1523.jar:0.9.0-20151120.1523]
>         ... 8 common frames omitted
> {noformat}
> Looking at the persisted state, there was an {{SshMachineLocation}} in a BYON location
that had configuration to explicitly set the port to null.
> This meant that the call to {{getConfig(PROP_PORT)}} was returning null, which caused
the {{NullPointerException}} during the location's {{toString()}}, which caused rebind to
fail.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message