springboot(一)

 

错误信息:

  javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

处理结果:

  是否缺少少jar包:

错误信息:

  Missing artifact com.oracle:ojdbc14:jar:10.2.0.2.0

处理结果:

  解决maven官方库中没有oracle jdbc驱动的问题:Missing artifact com.oracle:ojdbc14:jar:10.2.0.1.0:

  配置本地库,将下好的jar包通过maven的命令工具放在仓库中对应的文件夹位置。(ojdbc1410.2.0.1.0)里。

  命令:mvn install:install-file -DgroupId=com.Oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

      -Dfile=C:UsersAdministrator.m2 epositorycomoracleojdbc1410.2.0.4.0ojdbc14-10.2.0.4.0.jar

错误信息:

  Consider defining a bean of type 'com.example.demo.repository.UserRepository' in your configuration.

处理结果:

  仔细查看下是否是jar包导错了。应该是 spring-boot-starter-data-jpa 的jar包。而不是spring-data-jpa的jar包。

  我发现 jar 包路径都是:import org.springframework.data.jpa.repository.JpaRepository;遗留下一个疑问:

    既然路径都是一毛一样,或许这两个jar包就是同一个的。之所以会出错,可能是版本号跟springboot的版本不一样引起的。

错误信息:

  could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

处理结果:

  是hibernate的数据库配置问题。

  属性:spring.jpa.properties.hibernate.hbm2ddl.auto=update

原文地址:https://www.cnblogs.com/myknow/p/9241963.html