приложение весенней загрузки успешно разворачивается, но через некоторое время останавливается - PullRequest
3 голосов
/ 06 апреля 2020

У меня есть API весенней загрузки (1.5.18), развернутый на сервере Tomcat 7. Развертывание прошло успешно, и я могу получить json результатов от конечных точек, но затем примерно через час он перестает работать, давая пустые результаты и 500 кодов состояния. когда война разворачивается снова, происходит то же самое, какое-то время она работает нормально, а затем останавливается

, это моя помпа. xml:

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.18</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

это результат после ее остановки работает: enter image description here

Может ли кто-нибудь объяснить мне, что происходит?

Редактировать: Я проверил catalina.out и нет регистрирует ошибку.

Edit2: это моя трассировка стека после добавления журналов и повторного развертывания. Я удалил повторяющиеся строки для пробела. ПРИМЕЧАНИЕ: после 6-го апреля около 16:46 был успешный запрос, а 7-го апреля в 6:25

............
07-04 06:25:39.134 [http-bio-8080-exec-103] DEBUG org.springframework.orm.jpa.JpaTransactionManager :: Found thread-bound EntityManager [org.hibernate.jpa.internal.EntityManagerImpl@45ad55e7] for JPA transaction  
07-04 06:25:39.135 [http-bio-8080-exec-103] DEBUG org.springframework.orm.jpa.JpaTransactionManager :: Creating new transaction with name [org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly  
07-04 06:25:39.135 [http-bio-8080-exec-103] DEBUG org.springframework.jdbc.datasource.DataSourceUtils :: Setting JDBC Connection [ProxyConnection[PooledConnection[com.mysql.cj.jdbc.ConnectionImpl@3912f9b6]]] read-only  
07-04 06:25:39.173 [http-bio-8080-exec-103] DEBUG org.springframework.jdbc.datasource.DataSourceUtils :: Could not set JDBC Connection read-only com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 49,209,777 milliseconds ago. The last packet sent successfully to the server was 49,209,778 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 49,209,777 milliseconds ago. The last packet sent successfully to the server was 49,209,778 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Caused by: java.net.SocketException: Broken pipe (Write failed)
    at java.net.SocketOutputStream.socketWrite0(Native Method)   
произошел сбой.
...