You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am new to armeria. I build a simple project using armeria 0.5.60 according to armeria documentation, everything goes well until using 'Service discovery with ZooKeeper'. I got this exception
java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
at com.linecorp.armeria.server.zookeeper.ZooKeeperUpdatingListener.serverStarting(ZooKeeperUpdatingListener.java:69)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
at com.linecorp.armeria.server.Server$StateManager.notifyState(Server.java:585)
at com.github.liuzhengyang.server.Bootstrap.main(Bootstrap.java:38)
at com.linecorp.armeria.server.Server$StateManager.enterStarting(Server.java:541)
Caused by: java.lang.IllegalStateException: failed to notify all server listeners
at com.linecorp.armeria.server.Server.start(Server.java:250)
at com.linecorp.armeria.server.Server$StateManager.enterStarting(Server.java:542)
at com.linecorp.armeria.server.Server.start(Server.java:235)
at com.linecorp.armeria.server.Server.start(Server.java:250)
at com.github.liuzhengyang.server.Bootstrap.main(Bootstrap.java:38)
at com.linecorp.armeria.server.Server.start(Server.java:235)
... 1 more
And here is my example code.
public class Bootstrap {
public static void main(String[] args) {
ServerBuilder sb = new ServerBuilder();
sb.port(8081, "http");
sb.serviceUnder("/hello",
new GrpcServiceBuilder()
.addService(new MyHelloService())
.supportedSerializationFormats(GrpcSerializationFormats.values())
.enableUnframedRequests(true)
.build());
sb.accessLogWriter(AccessLogWriters.common());
sb.serviceUnder("/docs", new DocService());
Server server = sb.build();
ServerListener serverListener = new ZooKeeperUpdatingListener("localhost:2181", "/myProducionEndpoints", 1000);
server.addListener(serverListener);
server.start().join();
}
}
If i remove the ServerListener, it works well. And i looked into com.linecorp.armeria.server.Server, found primaryActivePort is set in ServerPortStartListener, but ZooKeeperUpdatingListener.serverStarting is triggered before ServerPortStartListener added to Server start future listeners.
Did I miss something?
I am not sure whether I explained this problem clear or not. Thanks in advance.
The text was updated successfully, but these errors were encountered:
Motivation:
ZooKeeperUpdatingListener attempts to access `Server.activePort()` in
`serverStarting()`. `Server.activePort()` is supposed to be available in
`serverStarted()`.
Modifications:
Use `serverStarted()` rather than `serverStarting()`.
Result:
- Fixesline#933
Motivation:
ZooKeeperUpdatingListener attempts to access `Server.activePort()` in
`serverStarting()`. `Server.activePort()` is supposed to be available in
`serverStarted()`.
Modifications:
Use `serverStarted()` rather than `serverStarting()`.
Result:
- Fixes#933
Motivation:
ZooKeeperUpdatingListener attempts to access `Server.activePort()` in
`serverStarting()`. `Server.activePort()` is supposed to be available in
`serverStarted()`.
Modifications:
Use `serverStarted()` rather than `serverStarting()`.
Result:
- Fixesline#933
Hi, I am new to armeria. I build a simple project using armeria 0.5.60 according to armeria documentation, everything goes well until using 'Service discovery with ZooKeeper'. I got this exception
And here is my example code.
If i remove the
ServerListener
, it works well. And i looked intocom.linecorp.armeria.server.Server
, foundprimaryActivePort
is set inServerPortStartListener
, butZooKeeperUpdatingListener.serverStarting
is triggered beforeServerPortStartListener
added to Server start future listeners.Did I miss something?
I am not sure whether I explained this problem clear or not. Thanks in advance.
The text was updated successfully, but these errors were encountered: