我已经下载了最新的activity源码。我已按如下方式更改了 db.properties 文件:
db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/WorkflowEngine
jdbc.username=postgres
jdbc.password=password
我还添加了 postgres 依赖项。当我尝试通过“intellij idea”进行部署时,它通过指向正确的数据库工作正常,使用相同的代码,我创建了一个 war 文件,并尝试通过将 war 放在 webapps 中直接通过 tomcat 进行部署。 在这里我得到了这样的异常:
caused by: org.activiti.engine.ActivitiException: couldn't check if tables are already present using metadata: connection refused. check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections
caused by: org.postgresql.util.PSQLException: connection refused. check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections
谁能帮我解决这个错误。
更新
我已经给了一个新的数据库名称并尝试启动。 Activiti 能够在新数据库中创建 25 个表,但仍然给出连接被拒绝的错误。
最佳答案
问题很明显是一个 jdbc 连接被拒绝的错误。因此,让我们从排查这些问题的 list 开始。
你能在本地套接字上 psql 进入服务器吗?只需从命令行输入 psql 即可。如果您收到身份验证错误或密码提示,那您就没事了。如果连接被拒绝,您还有更多工作要做。
PostgreSQL 是否在运行?如果没有,请启动它并重试。如果是这样,请检查 postgresql.conf 以查找非标准端口设置。
检查可能阻止网络连接的防火墙。
关于java - PostgresSqlException 与 activiti 源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38968923/