paul
paul

Reputation: 402

Apache Isis 1.15.0 - PostgreSQL

I tried to integrate the Apache Isis' simple-app 1.15.0 with Postgresql using docker-toolbox. But i had a problem, it says I cannot create a schema because of permission denied to database. I tried to google it and read the apache isis documentations but cannot get a solution.

I think i got messed up in isis.properties. I only uncommented this part of isis.properties and do some little modification.

isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://192.168.99.100:5432/mubuss
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=root
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=root

Here is a part of the stacktrace.

19:49:56,498  [IsisConfigurationDefault main       INFO ]  adding isis.persistor.datanucleus.classMetadataLoadedListener = org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata
19:49:56,499  [IsisConfigurationDefault main       INFO ]  adding isis.reflector.facet.cssClass.patterns = delete.*:btn-danger,discard.*:btn-warning,remove.*:btn-warning
19:49:56,499  [IsisConfigurationDefault main       INFO ]  adding isis.persistor.datanucleus.impl.datanucleus.schema.validateConstraints = true
19:49:56,499  [IsisConfigurationDefault main       INFO ]  adding isis.persistor.datanucleus.impl.datanucleus.identifier.case = MixedCase
19:49:56,505  [ServicesInstallerFromConfigurationAndAnnotation main       INFO ]  installing org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation
19:49:56,693  [IsisConfigurationDefault main       INFO ]  adding isis.fixtures = 
19:49:56,697  [IsisSessionFactoryBuilder main       INFO ]  initialising Isis System
19:49:56,697  [IsisSessionFactoryBuilder main       INFO ]  working directory: D:\Paul\Workspace\petclinic\webapp\.
19:49:56,697  [IsisSessionFactoryBuilder main       INFO ]  resource stream source: chain [file system (directory 'D:\Paul\Workspace\petclinic\webapp\src\main\webapp\WEB-INF'), context loader classpath, context loader classpath, context loader classpath, current class' classpath, servlet context ('/WEB-INF')]
19:49:58,556  [PersistenceSessionFactory main       INFO ]  did *not* find config properties to use JNDI datasource; will use JDBC
19:49:59,779  [Schema               main       DEBUG]  Column ""DELETEME1509536999770"."UNUSED"" added to internal representation of table.
19:49:59,784  [Schema               main       DEBUG]  Attempt to find JDBC driver 'typeInfo' for jdbc-type=INTEGER but sql-type=INTEGER is not found. Using default sql-type for this jdbc-type.
19:49:59,784  [Schema               main       DEBUG]  Creating table "DELETEME1509536999770"
19:49:59,787  [Schema               main       DEBUG]  CREATE TABLE "DELETEME1509536999770"
(
    "UNUSED" int4 NOT NULL
)
19:49:59,790  [Schema               main       DEBUG]  Execution Time = 3 ms
19:49:59,794  [Schema               main       DEBUG]  Catalog Name could not be determined for this datastore
19:49:59,794  [Schema               main       DEBUG]  Dropping table "DELETEME1509536999770"
19:49:59,794  [Schema               main       DEBUG]  DROP TABLE "DELETEME1509536999770" CASCADE
19:49:59,796  [Schema               main       DEBUG]  Execution Time = 1 ms
19:50:00,701  [Schema               main       DEBUG]  Column ""DELETEME1509537000701"."UNUSED"" added to internal representation of table.
19:50:00,701  [Schema               main       DEBUG]  Attempt to find JDBC driver 'typeInfo' for jdbc-type=INTEGER but sql-type=INTEGER is not found. Using default sql-type for this jdbc-type.
19:50:00,701  [Schema               main       DEBUG]  Creating table "DELETEME1509537000701"
19:50:00,701  [Schema               main       DEBUG]  CREATE TABLE "DELETEME1509537000701"
(
    "UNUSED" int4 NOT NULL
)
19:50:00,704  [Schema               main       DEBUG]  Execution Time = 3 ms
19:50:00,707  [Schema               main       DEBUG]  Catalog Name could not be determined for this datastore
19:50:00,708  [Schema               main       DEBUG]  Dropping table "DELETEME1509537000701"
19:50:00,708  [Schema               main       DEBUG]  DROP TABLE "DELETEME1509537000701" CASCADE
19:50:00,709  [Schema               main       DEBUG]  Execution Time = 1 ms
19:50:00,786  [CreateSchemaObjectFromClassMetadata main       WARN ]  Unable to create schema
org.postgresql.util.PSQLException: ERROR: permission denied for database mubuss
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
    at org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:120)
    at org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:79)

EDIT:
This is fixed. But I dont know why it got fixed. Please provide an answer maybe. I was using Docker Toolbox. And use this docker-compose.yml from sameersbn link and I think because of this yml, it did not download all the necessary files when I execute the command docker-compose up -d. So when I tried this docker-compose.yml from this vovimayhem link, it was fixed. I am just assuming on this one that this fix the problem.

Upvotes: 0

Views: 217

Answers (1)

Vao Tsun
Vao Tsun

Reputation: 51529

from your error I assume that user root can't connect to mubuss database, eg:

postgres=# revoke connect ON DATABASE t from c;
REVOKE
postgres=# \q
-bash-4.2$ psql -U c t
psql: FATAL:  permission denied for database "t"
DETAIL:  User does not have CONNECT privilege.

thus you need to either use different user or just grant connect, eg:

postgres=# grant connect ON DATABASE t to c;
GRANT
postgres=# \q
-bash-4.2$ psql -U c t
psql (9.3.14)
Type "help" for help.

t=>

so for you it would be

grant connect ON DATABASE mubuss to root;

Upvotes: 0

Related Questions