2

I have a springboot project and this project works on other computers. I tried it on 2 different computers and it works but it does not work on my computer. It gives an error and it says "The column name INDEX_NAME was not found in this resultset". I guess it cannot reach the indexes of the database tables. I use postgresql and I uninstalled it and I reinstalled. I even formatted my computer and reinstalled it. Why doesn't it just work on my computer?

Error message is :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JaversFromStarter' defined in class path resource [org/javers/spring/boot/sql/JaversSqlAutoConfiguration.class]: Invocation of init method failed; nested exception is org.polyjdbc.core.exception.SchemaInspectionException: [INDEX_LOOKUP_ERROR] Failed to obtain relation index list when looking for indexes for relation jv_global_id
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.21.jar:5.3.21]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.21.jar:5.3.21]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.1.jar:2.7.1]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.1.jar:2.7.1]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.1.jar:2.7.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.1.jar:2.7.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.1.jar:2.7.1]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.1.jar:2.7.1]
    at com.provera.taskmanapi.TaskmanapiApplication.main(TaskmanapiApplication.java:16) ~[classes/:na]
Caused by: org.polyjdbc.core.exception.SchemaInspectionException: [INDEX_LOOKUP_ERROR] Failed to obtain relation index list when looking for indexes for relation jv_global_id
    at org.polyjdbc.core.schema.SchemaInspectorImpl.indexExists(SchemaInspectorImpl.java:115) ~[polyjdbc-0.7.6.jar:na]
    at org.javers.repository.sql.schema.JaversSchemaManager.addIndex(JaversSchemaManager.java:336) ~[javers-persistence-sql-6.6.5.jar:na]
    at org.javers.repository.sql.schema.JaversSchemaManager.addDbIndexOnOwnerId(JaversSchemaManager.java:100) ~[javers-persistence-sql-6.6.5.jar:na]
    at org.javers.repository.sql.schema.JaversSchemaManager.ensureSchema(JaversSchemaManager.java:59) ~[javers-persistence-sql-6.6.5.jar:na]
    at org.javers.repository.sql.JaversSqlRepository.ensureSchema(JaversSqlRepository.java:186) ~[javers-persistence-sql-6.6.5.jar:na]
    at org.javers.spring.jpa.JaversTransactionalJpaDecorator$1.doInTransactionWithoutResult(JaversTransactionalJpaDecorator.java:64) ~[javers-spring-jpa-6.6.5.jar:na]
    at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:36) ~[spring-tx-5.3.21.jar:5.3.21]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.3.21.jar:5.3.21]
    at org.javers.spring.jpa.JaversTransactionalJpaDecorator.ensureSchema(JaversTransactionalJpaDecorator.java:61) ~[javers-spring-jpa-6.6.5.jar:na]
    at org.javers.spring.jpa.JaversTransactionalJpaDecorator.afterPropertiesSet(JaversTransactionalJpaDecorator.java:55) ~[javers-spring-jpa-6.6.5.jar:na]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.21.jar:5.3.21]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.21.jar:5.3.21]
    ... 16 common frames omitted
Caused by: org.postgresql.util.PSQLException: Bu ResultSet içinde INDEX_NAME sütun adı bulunamadı.
    at org.postgresql.jdbc.PgResultSet.findColumn(PgResultSet.java:2957) ~[postgresql-42.3.6.jar:42.3.6]
    at org.postgresql.jdbc.PgResultSet.getString(PgResultSet.java:2814) ~[postgresql-42.3.6.jar:42.3.6]
    at com.zaxxer.hikari.pool.HikariProxyResultSet.getString(HikariProxyResultSet.java) ~[HikariCP-4.0.3.jar:na]
    at org.polyjdbc.core.schema.SchemaInspectorImpl.indexExists(SchemaInspectorImpl.java:107) ~[polyjdbc-0.7.6.jar:na]
    ... 27 common frames omitted

3 Answers 3

1

Cause of the problem is your computer language. I guess, you use the computer as Turkish language. You should change as English

I had same problem. I fixed this way

Sign up to request clarification or add additional context in comments.

Comments

0

Your index is not created properly, it should include the foreign key as well, and also the index should have unique keys.

1 Comment

I am using the database as code first. Spring boot can create tables and indexes on other computers but same codes give an error on my computer. So should I create the database table myself?
0

The reason for this error is that the Java JDBC driver has difficulty processing the contents of the ResultSet object in accordance with Turkish localization settings. In this case, a column name within the ResultSet is misinterpreted and processed incorrectly, resulting in the error.

If you add the following environment to your .bashrc/.zshrc file, the problem will be fixed.

export JAVA_TOOL_OPTIONS="-Duser.language=en -Duser.region=US"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.