0

我尝试使用 docker -toolbox将 Apache Isis 的 simple-app 1.15.0 与 Postgresql 集成。但是我遇到了一个问题,它说我无法创建架构,因为数据库权限被拒绝。我试图用谷歌搜索它并阅读 apache isis 文档,但无法获得解决方案。

我想我在 isis.properties 中搞砸了。我只取消了对 isis.properties 的这一部分的注释,并做了一些小的修改。

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

这是堆栈跟踪的一部分。

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)

编辑:
这是固定的。但我不知道为什么它得到了修复。请提供一个答案。我正在使用Docker Toolbox。并使用来自sameersbn 链接的这个 docker-compose.yml,我认为由于这个 yml,当我执行命令docker-compose up -d时它没有下载所有必要的文件。所以当我从这个vovimayhem 链接尝试这个 docker-compose.yml 时,它是固定的。我只是假设这可以解决问题。

4

1 回答 1

0

根据您的错误,我假设用户root无法连接到mubuss数据库,例如:

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.

因此您需要使用不同的用户或只授予连接,例如:

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=>

所以对你来说

grant connect ON DATABASE mubuss to root;
于 2017-11-01T13:45:35.297 回答