geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-7167) Geode incorrectly parses the 'locators' property throwing a NullPointerException
Date Thu, 17 Oct 2019 18:02:00 GMT

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

ASF subversion and git services commented on GEODE-7167:
--------------------------------------------------------

Commit f30f9367bd7334a4e9f191d80568d7a1e0c13536 in geode's branch refs/heads/develop from
Bill Burcham
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=f30f936 ]

GEODE-7167: eliminate NPE when parsing locators property (#4018)



> Geode incorrectly parses the 'locators' property throwing a NullPointerException
> --------------------------------------------------------------------------------
>
>                 Key: GEODE-7167
>                 URL: https://issues.apache.org/jira/browse/GEODE-7167
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Bill Burcham
>            Assignee: Bill Burcham
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> 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.4#803005)

Mime
View raw message