我正试图将从http请求发送的数据保存到本地数据库,但问题是在关闭spring启动应用程序后数据丢失。我寻找类似的问题,并遇到了这个问题,但它不适合我。
我不知道我是做错了什么,还是需要做更多的工作来保存数据。
下面是my application.properties文件的外观:
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database=sql_server
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
logging.level.root=INFO
logging.level.org.springframework=WARN
logging.file=/home/LogFiles/boot.log
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://localhost/test
spring.datasource.platform=sqlserver
spring.datasource.username=xxxxxx
spring.datasource.password=xxxxxx
关闭应用程序时从控制台记录
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2021-01-18 14:46:16.219 INFO 20436 --- [ main] .t.TransfertprotocolbackendApplicationKt : Starting TransfertprotocolbackendApplicationKt on FRLYONWXT003660 with PID 20436 (started by a369958 in C:\Users\A369958\Desktop\Transport Protocol\transport-protocol-backend)
2021-01-18 14:46:16.231 INFO 20436 --- [ main] .t.TransfertprotocolbackendApplicationKt : No active profile set, falling back to default profiles: default
2021-01-18 14:46:18.656 INFO 20436 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2021-01-18 14:46:18.865 INFO 20436 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 193ms. Found 8 repository interfaces.
2021-01-18 14:46:19.559 INFO 20436 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$bae5d67d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-01-18 14:46:20.540 INFO 20436 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-01-18 14:46:20.581 INFO 20436 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-01-18 14:46:20.582 INFO 20436 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
2021-01-18 14:46:20.594 INFO 20436 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Users\A369958\.jdks\adopt-openj9-1.8.0_275\jre\bin\compressedrefs;C:\Users\A369958\.jdks\adopt-openj9-1.8.0_275\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Common Files\Pulse Secure\VC142.CRT\X86\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\A369958\.jdks\adopt-openj9-1.8.0_275\bin;C:\Gradle\gradle-5.2.1\bin;C:\Users\A369958\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\A369958\AppData\Local\Programs\Python\Python39\;C:\Users\A369958\AppData\Local\Microsoft\WindowsApps;C:\Users\A369958\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\A369958\AppData\Roaming\npm;C:\Users\A369958\AppData\Local\GitHubDesktop\bin;C:\Users\A369958\.jdks\adopt-openj9-1.8.0_275\jre;;.]
2021-01-18 14:46:20.804 INFO 20436 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-01-18 14:46:20.804 INFO 20436 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4447 ms
2021-01-18 14:46:20.818 INFO 20436 --- [ main] c.r.t.api.config.CorsFilter : SimpleCORSFilter init
2021-01-18 14:46:21.134 INFO 20436 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-01-18 14:46:21.370 INFO 20436 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-01-18 14:46:21.481 INFO 20436 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2021-01-18 14:46:21.604 INFO 20436 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final}
2021-01-18 14:46:21.606 INFO 20436 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2021-01-18 14:46:21.846 INFO 20436 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2021-01-18 14:46:22.283 INFO 20436 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2021-01-18 14:46:23.388 INFO 20436 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@3dad5f95'
2021-01-18 14:46:23.392 INFO 20436 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-01-18 14:46:25.036 INFO 20436 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'clientInboundChannelExecutor'
2021-01-18 14:46:25.043 INFO 20436 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'clientOutboundChannelExecutor'
2021-01-18 14:46:25.424 WARN 20436 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-01-18 14:46:25.761 INFO 20436 --- [ main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
2021-01-18 14:46:25.791 INFO 20436 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'messageBrokerTaskScheduler'
2021-01-18 14:46:25.870 INFO 20436 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'brokerChannelExecutor'
2021-01-18 14:46:26.413 INFO 20436 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-01-18 14:46:26.448 INFO 20436 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-01-18 14:46:26.559 INFO 20436 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2021-01-18 14:46:27.003 INFO 20436 --- [ main] o.s.m.s.b.SimpleBrokerMessageHandler : Starting...
2021-01-18 14:46:27.003 INFO 20436 --- [ main] o.s.m.s.b.SimpleBrokerMessageHandler : BrokerAvailabilityEvent[available=true, SimpleBrokerMessageHandler [DefaultSubscriptionRegistry[cache[0 destination(s)], registry[0 sessions]]]]
2021-01-18 14:46:27.003 INFO 20436 --- [ main] o.s.m.s.b.SimpleBrokerMessageHandler : Started.
2021-01-18 14:46:27.041 INFO 20436 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-01-18 14:46:27.043 INFO 20436 --- [ main] .t.TransfertprotocolbackendApplicationKt : Started TransfertprotocolbackendApplicationKt in 11.477 seconds (JVM running for 11.993)
2021-01-18 14:46:27.484 INFO 20436 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-01-18 14:46:27.484 INFO 20436 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-01-18 14:46:27.493 INFO 20436 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 9 ms
2021-01-18 14:46:44.573 INFO 20436 --- [nio-8080-exec-6] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Process finished with exit code -1
暂无答案!
目前还没有任何答案,快来回答吧!