• Can't connect to H2 database of openkm from ouside of it

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #49222  by mamad
 
Hi guys
i installed openkm community edition with H2 database and now i want to connect to its H2 database from outside of it.
I installed H2 console and after opening console and entering information of server and database, it raised an exception and did not connect to the database.
This is a snapshot of login window :
( i installed H2 console on my local PC and openkm is running on a server with ip address of 192.168.1.50 )
Captureeee.PNG
Captureeee.PNG (26.89 KiB) Viewed 10509 times
And its the log made by the exception:
Code: Select all
Connection is broken: "java.net.ConnectException: Connection refused: connect: 192.168.1.50" [90067-200] 90067/90067 (Help)
org.h2.jdbc.JdbcSQLNonTransientConnectionException: Connection is broken: "java.net.ConnectException: Connection refused: connect: 192.168.1.50" [90067-200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:622)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
    at org.h2.message.DbException.get(DbException.java:194)
    at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:439)
    at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:321)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152)
    at org.h2.Driver.connect(Driver.java:69)
    at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:309)
    at org.h2.util.JdbcUtils.getConnection(JdbcUtils.java:289)
    at org.h2.server.web.WebServer.getConnection(WebServer.java:785)
    at org.h2.server.web.WebApp.login(WebApp.java:1008)
    at org.h2.server.web.WebApp.process(WebApp.java:223)
    at org.h2.server.web.WebApp.processRequest(WebApp.java:173)
    at org.h2.server.web.WebThread.process(WebThread.java:139)
    at org.h2.server.web.WebThread.run(WebThread.java:94)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at org.h2.util.NetUtils.createSocket(NetUtils.java:103)
    at org.h2.util.NetUtils.createSocket(NetUtils.java:83)
    at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:119)
    at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:435)
    ... 13 more
Whats the problem ?
Thank you
Last edited by mamad on Wed Nov 13, 2019 10:52 am, edited 1 time in total.
 #49223  by mamad
 
I used this values for connecting to the database :

Driver Class : org.h2.Driver
JDBC URL : jdbc:h2:tcp://192.168.1.50/home/openkm/tomcat/repository/okmdb
User Name : sa
Password : sa

Are these values valid ?
 #49230  by jllort
 
H2 database is an embedded database. This kind of database only allows a single connection, if you have OpenKM started then you can no get connection to the database. We do not suggest H2 for production, consider migration to MySQL, MariaDB, PostgreSQL, etc...
 #49241  by jllort
 
There're some tools for migration, I think mysql workbench comes into with migration wizard. Another option is a fresh installation with mysql and use export and import OpenKM features.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.