SpringBoot之hello world

在这里插入图片描述
这个错误的出现一般是SpringBoot的启动类(类名上面有@SpringBootApplication注解 )与controller包不在同一个目录下,解决方案就是把启动类和controller包放在同目录下就可以啦。在这里插入图片描述在这里插入图片描述
常见错误:

  • Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
    解决办法:在properties文件中增加下面这行
    spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
  • Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    解决办法:设置标准时间
    spring.datasource.url=jdbc:mysql:///album?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
发布了262 篇原创文章 · 获赞 491 · 访问量 33万+

猜你喜欢

转载自blog.csdn.net/qq_42859864/article/details/104462240