Caused by: java.lang.NoSuchMethodError: org.postgresql.core.BaseConnection.getEncoding()Lorg/postgresql/core/Encoding;

后端 未结 1 1436
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 12:44

I am configure PostgreSQL,Hibernate in spring mvc . i have getting following error

org.springframework.beans.factory.BeanCreationException: Error creating be         


        
相关标签:
1条回答
  • 2020-12-18 12:58

    You didn't completly explain the context you're getting the exception, but I'llm make a few assumptions.

    The error happens when you're using a postgres 8 driver, against a postgres 9 DB. A common case is that it is pulled in as a transitive dependency via whatever build system you're using. To make even more assumptions, the very common case is that an older driver is included when adding postgis dep e.g. via maven. The solution is to exclude the dep, e.g. like

    <dependency>
       <groupId>org.postgis</groupId>
       <artifactId>postgis-jdbc</artifactId>
       <version>1.3.3</version>
       <scope>compile</scope>
       <exclusions>
          <exclusion>
             <groupId>org.postgis</groupId>
             <artifactId>postgis-stubs</artifactId>
          </exclusion>
       </exclusions>
    </dependency>
    

    anyways, it could be a different dependency, or a different build system, but the gist of the answer should apply, find out what brings the erroneus dep to your classpath, and exclude it

    0 讨论(0)
提交回复
热议问题