You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Darrel Schneider (Jira)" <ji...@apache.org> on 2019/08/27 17:37:00 UTC

[jira] [Assigned] (GEODE-6153) Geode incorrectly parses the 'locators' property throwing a NullPointerException

     [ https://issues.apache.org/jira/browse/GEODE-6153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darrel Schneider reassigned GEODE-6153:
---------------------------------------

    Assignee: Bruce Schuchardt  (was: Galen O'Sullivan)

> Geode incorrectly parses the 'locators' property throwing a NullPointerException
> --------------------------------------------------------------------------------
>
>                 Key: GEODE-6153
>                 URL: https://issues.apache.org/jira/browse/GEODE-6153
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: John Blum
>            Assignee: Bruce Schuchardt
>            Priority: Major
>
> When defining Geode Properties and using the API to start a Geode Server connecting to an existing Locator, if the {{hostname}} of the Locator is incorrectly typed, Geode will throw a {{NullPointerException}}.
> For instance, if I define Geode Properties using...
> {code:java}
> ...
>   private static Properties gemfireProperties() {
>     Properties gemfireProperties = new Properties();
>     gemfireProperties.setProperty("name", "SessionGeodeServer");
>     gemfireProperties.setProperty("log-level", LOG_LEVEL);
>     gemfireProperties.setProperty("locators", "loclhost[10334]");
>     gemfireProperties.setProperty("jmx-manager", "true");
>     gemfireProperties.setProperty("jmx-manager-start", "true");
>     gemfireProperties.setProperty("start-locator", "localhost[10334]");
>     return gemfireProperties;
>   }
>   private static Cache gemfireCache(Properties gemfireProperties) {
>     return new CacheFactory(gemfireProperties).create();
>   }
> ...
> {code}
> And, as you can see, I mistyped "localhost" as "loclhost" in {{gemfireProperties.setProperty("locators", "loclhost[10334]");}}, this results in...
> {code:java}
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.geode.distributed.internal.membership.gms.GMSUtil.parseLocators(GMSUtil.java:91)
> 	at org.apache.geode.distributed.internal.membership.gms.locator.GMSLocator.<init>(GMSLocator.java:109)
> 	at org.apache.geode.distributed.internal.membership.gms.GMSMemberFactory.newLocatorHandler(GMSMemberFactory.java:125)
> 	at org.apache.geode.distributed.internal.membership.MemberFactory.newLocatorHandler(MemberFactory.java:100)
> 	at org.apache.geode.distributed.internal.InternalLocator.startPeerLocation(InternalLocator.java:537)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.startInitLocator(InternalDistributedSystem.java:867)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:749)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:355)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:343)
> 	at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:335)
> 	at org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:211)
> 	at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:219)
> 	at example.tests.geode.SessionGeodeServer.gemfireCache(SessionGeodeServer.java:70)
> 	at example.tests.geode.SessionGeodeServer.main(SessionGeodeServer.java:52)
> {code}
> Even worse, if I had not set my {{log-level}} to at least "warn" (e.g. suppose I set the {{log-level}} to "error") I would possibly never have seen these warning messages...
> {code:java}
> [warn 2018/12/06 10:14:34.365 PST <main> tid=0x1] Unknown locator host: loclhost
> [warn 2018/12/06 10:14:34.367 PST <main> tid=0x1] Unknown locator host: loclhost
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)