我试图部署我的hibernatespringweb应用到heroku,但我总是在我的构建成功完成后得到这个白色标签错误页。我用cleardb插件为我的应用程序配置了mysql。
我的application.properties:
spring.datasource.url=jdbc:mysql://ba502d9d5b06ef:e654f0e3@us-cdbr-east-03.cleardb.com/heroku_ee4acc10d87140e?reconnect=true
spring.datasource.username=ba502d9d5b06ef
spring.datasource.password=e654f0e3
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.hibernate.ddl-auto=create
spring.datasource.initialization-mode=always
spring.jpa.show-sql=true
spring.jpa.open-in-view=false
在日志中我没有看到任何错误:
2021-04-14T16:58:22.657179+00:00 app[web.1]: =========|_|==============|___/=/_/_/_/
2021-04-14T16:58:22.658994+00:00 app[web.1]: :: Spring Boot :: (v2.4.4)
2021-04-14T16:58:22.666285+00:00 app[web.1]:undefined
2021-04-14T16:58:23.589943+00:00 app[web.1]: 2021-04-14 16:58:23.585 INFO 4 --- [ main] com.example.HibernateProjectApplication : Starting HibernateProjectApplication v0.0.1-SNAPSHOT using Java 1.8.0_282-heroku on a770f46c-38ea-4bd1-868b-12c5e5419cb5 with PID 4 (/app/target/hibernate-project-0.0.1-SNAPSHOT.jar started by u9499 in /app)
2021-04-14T16:58:23.603214+00:00 app[web.1]: 2021-04-14 16:58:23.602 INFO 4 --- [ main] com.example.HibernateProjectApplication : No active profile set, falling back to default profiles: default
2021-04-14T16:58:29.216266+00:00 app[web.1]: 2021-04-14 16:58:29.215 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-04-14T16:58:29.380911+00:00 app[web.1]: 2021-04-14 16:58:29.377 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 119 ms. Found 0 JPA repository interfaces.
2021-04-14T16:58:32.916029+00:00 app[web.1]: 2021-04-14 16:58:32.915 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8593 (http)
2021-04-14T16:58:32.983567+00:00 app[web.1]: 2021-04-14 16:58:32.983 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-04-14T16:58:32.983893+00:00 app[web.1]: 2021-04-14 16:58:32.983 INFO 4 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.44]
2021-04-14T16:58:33.401127+00:00 app[web.1]: 2021-04-14 16:58:33.400 INFO 4 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-04-14T16:58:33.401323+00:00 app[web.1]: 2021-04-14 16:58:33.401 INFO 4 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 9341 ms
2021-04-14T16:58:34.665387+00:00 app[web.1]: 2021-04-14 16:58:34.663 INFO 4 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-04-14T16:58:34.886885+00:00 app[web.1]: 2021-04-14 16:58:34.886 INFO 4 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.25.Final
2021-04-14T16:58:35.442081+00:00 app[web.1]: 2021-04-14 16:58:35.441 INFO 4 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-04-14T16:58:36.456909+00:00 app[web.1]: 2021-04-14 16:58:36.456 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-04-14T16:58:38.161072+00:00 app[web.1]: 2021-04-14 16:58:38.160 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-04-14T16:58:38.215198+00:00 app[web.1]: 2021-04-14 16:58:38.214 INFO 4 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2021-04-14T16:58:41.077382+00:00 app[web.1]: Hibernate: alter table experts_tags drop foreign key FKnl365tg8om78fg3ysbtghggkb
2021-04-14T16:58:41.602826+00:00 app[web.1]: Hibernate: alter table experts_tags drop foreign key FKe95y97r3gwwaboftk7gmekyg0
2021-04-14T16:58:41.850066+00:00 app[web.1]: Hibernate: drop table if exists experts
2021-04-14T16:58:42.086171+00:00 app[web.1]: Hibernate: drop table if exists experts_tags
2021-04-14T16:58:42.306130+00:00 app[web.1]: Hibernate: drop table if exists tags
2021-04-14T16:58:42.733054+00:00 app[web.1]: Hibernate: create table experts (id bigint not null auto_increment, mail varchar(255), name varchar(255), phone varchar(255), surname varchar(255), primary key (id)) engine=InnoDB
2021-04-14T16:58:43.053119+00:00 app[web.1]: Hibernate: create table experts_tags (tag_id bigint not null, expert_id bigint not null) engine=InnoDB
2021-04-14T16:58:43.350696+00:00 app[web.1]: Hibernate: create table tags (id bigint not null auto_increment, name varchar(255), primary key (id)) engine=InnoDB
2021-04-14T16:58:43.579415+00:00 app[web.1]: Hibernate: alter table experts_tags add constraint FKnl365tg8om78fg3ysbtghggkb foreign key (expert_id) references experts (id)
2021-04-14T16:58:46.064945+00:00 app[web.1]: Hibernate: alter table experts_tags add constraint FKe95y97r3gwwaboftk7gmekyg0 foreign key (tag_id) references tags (id)
2021-04-14T16:58:47.254179+00:00 app[web.1]: 2021-04-14 16:58:47.250 INFO 4 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-04-14T16:58:47.272102+00:00 app[web.1]: 2021-04-14 16:58:47.271 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-04-14T16:58:57.035254+00:00 app[web.1]: 2021-04-14 16:58:57.034 INFO 4 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-14T16:58:58.573400+00:00 app[web.1]: 2021-04-14 16:58:58.573 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8593 (http) with context path ''
2021-04-14T16:58:58.626807+00:00 app[web.1]: 2021-04-14 16:58:58.626 INFO 4 --- [ main] com.example.HibernateProjectApplication : Started HibernateProjectApplication in 37.989 seconds (JVM running for 41.665)
2021-04-14T16:58:59.176795+00:00 heroku[web.1]: State changed from starting to up
2021-04-14T16:59:00.209572+00:00 app[web.1]: 2021-04-14 16:59:00.209 INFO 4 --- [nio-8593-exec-3] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-04-14T16:59:00.212461+00:00 app[web.1]: 2021-04-14 16:59:00.209 INFO 4 --- [nio-8593-exec-3] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-04-14T16:59:00.247973+00:00 app[web.1]: 2021-04-14 16:59:00.247 INFO 4 --- [nio-8593-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 35 ms
2021-04-14T16:59:00.518471+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=3c699b2b-f033-441d-b0e0-4403b22e9174 fwd="212.225.157.40" dyno=web.1 connect=1ms service=408ms status=404 bytes=533 protocol=https
2021-04-14T16:59:01.439451+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=561dae27-41a7-47f6-a464-d769fa1f11f1 fwd="212.225.157.40" dyno=web.1 connect=1ms service=20ms status=404 bytes=533 protocol=https
2021-04-14T17:33:51.292986+00:00 heroku[web.1]: Idling
2021-04-14T17:33:51.295419+00:00 heroku[web.1]: State changed from up to down
2021-04-14T17:33:52.802193+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-04-14T17:33:53.379215+00:00 app[web.1]: 2021-04-14 17:33:53.378 INFO 4 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-04-14T17:33:53.382140+00:00 app[web.1]: 2021-04-14 17:33:53.381 INFO 4 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-04-14T17:33:53.403146+00:00 app[web.1]: 2021-04-14 17:33:53.402 INFO 4 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-04-14T17:33:53.422738+00:00 app[web.1]: 2021-04-14 17:33:53.422 INFO 4 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2021-04-14T17:33:53.581621+00:00 heroku[web.1]: Process exited with status 143
2021-04-14T17:50:36.705241+00:00 heroku[web.1]: Unidling
2021-04-14T17:50:36.739207+00:00 heroku[web.1]: State changed from down to starting
2021-04-14T17:50:41.707826+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=27335 $JAVA_OPTS -jar target/hibernate-project-0.0.1-SNAPSHOT.jar`
2021-04-14T17:50:44.513305+00:00 app[web.1]: Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
2021-04-14T17:50:44.541874+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2021-04-14T17:50:44.546769+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2021-04-14T17:50:47.249610+00:00 app[web.1]:undefined
2021-04-14T17:50:47.249643+00:00 app[web.1]: . ____ _ __ _ _
2021-04-14T17:50:47.249710+00:00 app[web.1]: /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2021-04-14T17:50:47.249796+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2021-04-14T17:50:47.249891+00:00 app[web.1]: \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2021-04-14T17:50:47.249979+00:00 app[web.1]: ' |____| .__|_| |_|_| |_\__, | / / / /
2021-04-14T17:50:47.250075+00:00 app[web.1]: =========|_|==============|___/=/_/_/_/
2021-04-14T17:50:47.251699+00:00 app[web.1]: :: Spring Boot :: (v2.4.4)
2021-04-14T17:50:47.251767+00:00 app[web.1]:undefined
2021-04-14T17:50:47.821357+00:00 app[web.1]: 2021-04-14 17:50:47.815 INFO 4 --- [ main] com.example.HibernateProjectApplication : Starting HibernateProjectApplication v0.0.1-SNAPSHOT using Java 1.8.0_282-heroku on c643d1ef-1bf9-4afe-b781-67fcf736b8de with PID 4 (/app/target/hibernate-project-0.0.1-SNAPSHOT.jar started by u11638 in /app)
2021-04-14T17:50:47.838303+00:00 app[web.1]: 2021-04-14 17:50:47.838 INFO 4 --- [ main] com.example.HibernateProjectApplication : No active profile set, falling back to default profiles: default
2021-04-14T17:50:51.605839+00:00 app[web.1]: 2021-04-14 17:50:51.605 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-04-14T17:50:51.658438+00:00 app[web.1]: 2021-04-14 17:50:51.658 INFO 4 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14 ms. Found 0 JPA repository interfaces.
2021-04-14T17:50:54.657321+00:00 app[web.1]: 2021-04-14 17:50:54.656 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 27335 (http)
2021-04-14T17:50:54.683536+00:00 app[web.1]: 2021-04-14 17:50:54.683 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-04-14T17:50:54.683875+00:00 app[web.1]: 2021-04-14 17:50:54.683 INFO 4 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.44]
2021-04-14T17:50:54.823579+00:00 app[web.1]: 2021-04-14 17:50:54.823 INFO 4 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-04-14T17:50:54.823782+00:00 app[web.1]: 2021-04-14 17:50:54.823 INFO 4 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6823 ms
2021-04-14T17:50:55.505119+00:00 app[web.1]: 2021-04-14 17:50:55.503 INFO 4 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-04-14T17:50:55.619977+00:00 app[web.1]: 2021-04-14 17:50:55.619 INFO 4 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.25.Final
2021-04-14T17:50:56.007715+00:00 app[web.1]: 2021-04-14 17:50:56.007 INFO 4 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-04-14T17:50:56.344137+00:00 app[web.1]: 2021-04-14 17:50:56.343 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-04-14T17:50:57.512229+00:00 app[web.1]: 2021-04-14 17:50:57.511 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-04-14T17:50:57.544862+00:00 app[web.1]: 2021-04-14 17:50:57.544 INFO 4 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2021-04-14T17:50:59.168629+00:00 app[web.1]: Hibernate: alter table experts_tags drop foreign key FKnl365tg8om78fg3ysbtghggkb
2021-04-14T17:50:59.439632+00:00 app[web.1]: Hibernate: alter table experts_tags drop foreign key FKe95y97r3gwwaboftk7gmekyg0
2021-04-14T17:50:59.512568+00:00 app[web.1]: Hibernate: drop table if exists experts
2021-04-14T17:50:59.707009+00:00 app[web.1]: Hibernate: drop table if exists experts_tags
2021-04-14T17:51:00.077891+00:00 app[web.1]: Hibernate: drop table if exists tags
2021-04-14T17:51:00.408296+00:00 app[web.1]: Hibernate: create table experts (id bigint not null auto_increment, mail varchar(255), name varchar(255), phone varchar(255), surname varchar(255), primary key (id)) engine=InnoDB
2021-04-14T17:51:00.634624+00:00 app[web.1]: Hibernate: create table experts_tags (tag_id bigint not null, expert_id bigint not null) engine=InnoDB
2021-04-14T17:51:01.089138+00:00 app[web.1]: Hibernate: create table tags (id bigint not null auto_increment, name varchar(255), primary key (id)) engine=InnoDB
2021-04-14T17:51:01.332440+00:00 app[web.1]: Hibernate: alter table experts_tags add constraint FKnl365tg8om78fg3ysbtghggkb foreign key (expert_id) references experts (id)
2021-04-14T17:51:02.912298+00:00 app[web.1]: Hibernate: alter table experts_tags add constraint FKe95y97r3gwwaboftk7gmekyg0 foreign key (tag_id) references tags (id)
2021-04-14T17:51:03.534716+00:00 app[web.1]: 2021-04-14 17:51:03.534 INFO 4 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-04-14T17:51:03.550682+00:00 app[web.1]: 2021-04-14 17:51:03.550 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-04-14T17:51:06.083841+00:00 app[web.1]: 2021-04-14 17:51:06.083 INFO 4 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-14T17:51:07.111251+00:00 app[web.1]: 2021-04-14 17:51:07.110 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 27335 (http) with context path ''
2021-04-14T17:51:07.114552+00:00 heroku[web.1]: State changed from starting to up
2021-04-14T17:51:07.142281+00:00 app[web.1]: 2021-04-14 17:51:07.141 INFO 4 --- [ main] com.example.HibernateProjectApplication : Started HibernateProjectApplication in 20.845 seconds (JVM running for 22.595)
2021-04-14T17:51:08.387673+00:00 app[web.1]: 2021-04-14 17:51:08.387 INFO 4 --- [io-27335-exec-3] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-04-14T17:51:08.389990+00:00 app[web.1]: 2021-04-14 17:51:08.387 INFO 4 --- [io-27335-exec-3] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-04-14T17:51:08.402205+00:00 app[web.1]: 2021-04-14 17:51:08.401 INFO 4 --- [io-27335-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 11 ms
2021-04-14T17:51:08.553786+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=c901837f-c079-465c-ab92-471e625d439e fwd="212.225.157.40" dyno=web.1 connect=1ms service=265ms status=404 bytes=533 protocol=https
2021-04-14T17:51:09.924826+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=20e7a49c-5522-408e-a640-dc6cb2598c03 fwd="212.225.157.40" dyno=web.1 connect=1ms service=11ms status=404 bytes=533 protocol=https
2021-04-14T17:51:28.336794+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=d5c31acb-73f6-4799-ac11-a4a1ee68cfea fwd="212.225.157.40" dyno=web.1 connect=0ms service=10ms status=404 bytes=533 protocol=https
2021-04-14T17:55:00.328739+00:00 heroku[router]: at=info method=GET path="/" host=serene-wave-12377.herokuapp.com request_id=84cd646d-4c8c-4c4c-bc2b-3814a8eab886 fwd="212.225.157.40" dyno=web.1 connect=1ms service=12ms status=404 bytes=533 protocol=https
为什么我不能访问我的应用程序?任何帮助都将不胜感激!
2条答案
按热度按时间vhipe2zx1#
您正在使用mysql将应用程序部署到heroku。所以你必须使用这个插件。否则,您可以使用postgresql,然后一切都会正常工作。
dluptydi2#
问题是我没有访问正确的端点。我不得不添加api/Maven来获取我的信息。如果有人有同样的问题,希望这能起作用。