Postgres Database type error

Hello. I faced with a strange error in IntellijIDEA (any version) with CUBA plugin. There is a postgres database in the project I am working at. Inspite of right settings IDEA show me the error window about unsupported data store type.cuba_error_conf cuba_error_window
Then, when the app is running, it leads to many erorrs of the middleware in the brouser output.

Hello, lets see if I can help.

  • what Postgres driver version are you using, and the JDK?
  • make a new PostgreSQL 8.4 or greater database (what is the version you are using?) and create a new CUBA project and connect to it - is it working?
  • did you copy the project from one PC to another? If yes, what was the IntelliJ version on the origin, CUBA plugin version and Postgres version? What versions are present on the current system?

Hi,

Please attach idea.log file.
Help -> Show Log in (Explorer/Finder/etc…)

Regards
Alexander

Hi. I am having this problem in platform 7.2.8. I am able to create other Postgres projects without a problem.

My project used to work but I recently build from my git repository. So maybe there is a critical file that is missing from repository?

I am able to run the application without a problem. But this error prevents me from accessing menu options: Create Database, Update Database, Generate Database Scripts and Main Data Store Settings. But I am able to use gradle tasks createDb and updateDb. The loss of Generate Database Scripts is critical because I am not getting any update db scripts for my entity changes.

The idea.log has a few suspicious messages in it:

2022-02-18 10:45:42,359 [349772394] INFO - pl.ProjectRootManagerComponent - Project roots of Insight have changed (trace_hash = -647408049)
java.lang.Throwable

2022-02-18 10:48:18,046 [349928081] INFO - llij.lang.ant.ReflectedProject - org.apache.tools.ant.Project
java.lang.ClassNotFoundException: org.apache.tools.ant.Project

Any ideas? Thanks!

I found my issue. I am using JNDI and I modified the context.xml file to use variables.

<Context>
    <!-- Database connection -->
    <Resource driverClassName="org.postgresql.Driver"
              maxIdle="2"
              maxTotal="20"
              maxWaitMillis="5000"
              name="jdbc/CubaDS"
              type="javax.sql.DataSource"
              url="${indigo.db.url}"
              username="${indigo.db.username}"
              password="${indigo.db.password}"
    />
    <!-- Switch off session serialization -->
    <Manager pathname=""/>
</Context>

I thought this was pretty smart because I could modify the database when running by passing in variable values with Edit Configurations menu option. (It also helps with Docker deployments). But it broke all the plugin database actions.

Hi
You can use environment variables for Application JDBC DataSource definition.
See https://youtrack.cuba-platform.com/issue/STUDIO-8458