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

Jan Martin Keil updated JENA-2042:
----------------------------------
    Description: 
{{FusekiServer::getPort()}} does not return the actual port (but 0), if Fuseki 
was configured to select a random free port. E.g. 
{{FusekiServer.create().port(0).build().start().getPort()}} returns 0. I would 
expect and Java Doc states the method should return the selected port.

In case of HTTP only, one can use {{((ServerConnector) 
fuseki.getJettyServer().getConnectors()[0]).getLocalPort()}} instead. However, 
including HTTPS, things become more complicated, as the correct port of the 
correct connector needs to be selected first.

  was:
{{FusekiServer::getPort()}} does not return the actual port (but 0), if Fuseki 
was configured to select a random free port. E.g. 
{{FusekiServer.create().port(0).build().start().getPort()}} returns 0. I would 
expect and Java Doc states the method should return the selected port.

In case of HTTP only, one can use {{((ServerConnector) 
fuseki.getJettyServer().getConnectors()[0]).getLocalPort()}} instead. However, 
including HTTPS, things become a little bit more complicated, as the correct 
port of the correct connector needs to be selected first.


> FusekiServer::getPort() does not return actual port
> ---------------------------------------------------
>
>                 Key: JENA-2042
>                 URL: https://issues.apache.org/jira/browse/JENA-2042
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Fuseki
>    Affects Versions: Jena 3.17.0
>            Reporter: Jan Martin Keil
>            Priority: Major
>
> {{FusekiServer::getPort()}} does not return the actual port (but 0), if 
> Fuseki was configured to select a random free port. E.g. 
> {{FusekiServer.create().port(0).build().start().getPort()}} returns 0. I 
> would expect and Java Doc states the method should return the selected port.
> In case of HTTP only, one can use {{((ServerConnector) 
> fuseki.getJettyServer().getConnectors()[0]).getLocalPort()}} instead. 
> However, including HTTPS, things become more complicated, as the correct port 
> of the correct connector needs to be selected first.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to