Created
April 21, 2016 17:20
-
-
Save strokine/1dd575d219c2d90edb91695de829eb45 to your computer and use it in GitHub Desktop.
This code demonstrates the problem creating Geode Locator and Server in the same process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.gemstone.gemfire.distributed.LocatorLauncher; | |
import com.gemstone.gemfire.distributed.ServerLauncher; | |
public class Server { | |
public static void main(String[] args){ | |
new LocatorLauncher.Builder() | |
.setBindAddress("localhost") | |
.setPort(7300) | |
.build() | |
.start(); | |
new ServerLauncher.Builder() | |
.setServerBindAddress("localhost") | |
.setServerPort(9900) | |
.set("locators", "localhost[7300]") | |
.build() | |
.start(); | |
} | |
} |
Hi, I have a question that which version of GemFire can work with your codes? I tried to remove the line 16 with GemFire 8.2 but got the following error:
Exception in thread "main" java.lang.NullPointerException
at com.gemstone.gemfire.internal.cache.BridgeServerImpl.start(BridgeServerImpl.java:301)
at com.gemstone.gemfire.distributed.ServerLauncher.startCacheServer(ServerLauncher.java:918)
at com.gemstone.gemfire.distributed.ServerLauncher.start(ServerLauncher.java:705)
at server.main(server.java:20)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note, that if you remove line 16, everything would work.
Here is the exception: