griddb / webapi

GridDB WebAPI
Apache License 2.0
5 stars 5 forks source link

Setting the port number in griddb_webapi.properties doesn't seem to work #9

Closed Imisrael closed 5 months ago

Imisrael commented 6 months ago

I have set the port to be 8080 in my configuration but it seems to default to 8081 no matter what I do.

Here is the conf in my docker container

$ docker exec -it web-api cat /webapi/conf/griddb_webapi.properties

port=8080

failoverTimeout=5

transactionTimeout=30

containerCacheSize=100

maxResponseSize=20

maxRequestSize=20

loginTimeout=5

maxQueryNum=10

maxLimit=1000000

And then if you look at the logs, it is still running on port 8081:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.0.RELEASE)

2024-02-26 19:27:05,098 INFO  [main] org.springframework.boot.StartupInfoLogger: Starting Application on 01703ff58ddb with PID 1 (/webapi/webapi-ce/build/libs/griddb-webapi-ce-5.5.0.jar started by root in /webapi/webapi-ce/build/libs)
2024-02-26 19:27:05,101 INFO  [main] org.springframework.boot.SpringApplication: No active profile set, falling back to default profiles: default
2024-02-26 19:27:06,097 INFO  [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer: Tomcat initialized with port(s): 8081 (http)
2024-02-26 19:27:06,113 INFO  [main] org.apache.juli.logging.DirectJDKLog: Initializing ProtocolHandler ["http-nio-8081"]
2024-02-26 19:27:06,120 INFO  [main] org.apache.juli.logging.DirectJDKLog: Starting service [Tomcat]
2024-02-26 19:27:06,121 INFO  [main] org.apache.juli.logging.DirectJDKLog: Starting Servlet Engine: Apache Tomcat/9.0.12
2024-02-26 19:27:06,131 INFO  [main] org.apache.juli.logging.DirectJDKLog: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2024-02-26 19:27:06,192 INFO  [main] org.apache.juli.logging.DirectJDKLog: Initializing Spring embedded WebApplicationContext
2024-02-26 19:27:06,193 INFO  [main] org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext: Root WebApplicationContext: initialization completed in 1057 ms
2024-02-26 19:27:06,220 INFO  [main] org.springframework.boot.web.servlet.ServletRegistrationBean: Servlet dispatcherServlet mapped to [/]
2024-02-26 19:27:06,224 INFO  [main] org.springframework.boot.web.servlet.AbstractFilterRegistrationBean: Mapping filter: 'characterEncodingFilter' to: [/*]
2024-02-26 19:27:06,224 INFO  [main] org.springframework.boot.web.servlet.AbstractFilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2024-02-26 19:27:06,224 INFO  [main] org.springframework.boot.web.servlet.AbstractFilterRegistrationBean: Mapping filter: 'formContentFilter' to: [/*]
2024-02-26 19:27:06,225 INFO  [main] org.springframework.boot.web.servlet.AbstractFilterRegistrationBean: Mapping filter: 'requestContextFilter' to: [/*]
2024-02-26 19:27:06,506 INFO  [main] org.springframework.scheduling.concurrent.ExecutorConfigurationSupport: Initializing ExecutorService 'applicationTaskExecutor'
2024-02-26 19:27:06,679 INFO  [main] org.apache.juli.logging.DirectJDKLog: Starting ProtocolHandler ["http-nio-8081"]
2024-02-26 19:27:06,683 INFO  [main] org.apache.juli.logging.DirectJDKLog: Using a shared selector for servlet write/read
2024-02-26 19:27:06,695 INFO  [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer: Tomcat started on port(s): 8081 (http) with context path ''
2024-02-26 19:27:06,697 INFO  [main] org.springframework.boot.StartupInfoLogger: Started Application in 1.977 seconds (JVM running for 2.377)
2024-02-26 19:27:14,471 INFO  [http-nio-8081-exec-1] org.apache.juli.logging.DirectJDKLog: Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-02-26 19:27:14,471 INFO  [http-nio-8081-exec-1] org.springframework.web.servlet.FrameworkServlet: Initializing Servlet 'dispatcherServlet'
2024-02-26 19:27:14,477 INFO  [http-nio-8081-exec-1] org.springframework.web.servlet.FrameworkServlet: Completed initialization in 5 ms

here is my Dockerfile:

FROM gradle:jdk8 as gradleimage
COPY webapi /webapi
COPY repository.json /webapi/conf/repository.json
COPY griddb_webapi.properties /webapi/conf/griddb_webapi.properties

WORKDIR /webapi/webapi-ce/
RUN ./gradlew build

ENV GS_WEBAPI_HOME=/webapi

WORKDIR /webapi/webapi-ce/build/libs/
ENTRYPOINT ["java","-jar","griddb-webapi-ce-5.5.0.jar"]

Here I am copying the properties file prior to building and running jar file.

knonomura commented 6 months ago

Thank you for your report. I'll check it.

knonomura commented 6 months ago

I'm sorry, but the specification for port was changed.

Could you try the following steps ?

  1. Copy webapi-ce/src/main/resource/application.properties to your working directory (in case of your Dockerfile, it is /webapi/webapi-ce/build/libs/)
  2. Edit server.port in it

I'll update README and API Reference.

knonomura commented 5 months ago

I have updated the following files:

Imisrael commented 5 months ago

thank you