I want to start a h2 database server and connect multiple java applications to it. In order to do this I started a h2 server (version 1.4.196) with the below command
java -cp h2-1.4.196.jar org.h2.tools.Server -tcp -web
I see the below output of the above command
TCP server running at tcp://10.234.4.136:9092 (only local connections)
Web Console server running at http://10.234.4.136:8082 (only local connections)
Then I start a spring boot application with the below application.properties
server.port=9090
spring.datasource.url=jdbc:h2:tcp://10.234.4.136:9092/~/AZ
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=create
The java code is
@SpringBootApplication
public class Application {
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class)
.properties("spring.config.name:application")
.build()
.run(args);
}
}
The spring boot (version 1.3.6) application starts but gets stuck at schema export step with the below logs
2018-03-17 20:38:46.290 WARN 17260 --- [ost-startStop-1] o.h.e.jdbc.internal.JdbcServicesImpl : HHH000341: Could not obtain connection metadata : Connection is broken: "unexpected status 16843008" [90067-192]
2018-03-17 20:38:46.291 INFO 17260 --- [ost-startStop-1] o.h.e.jdbc.internal.LobCreatorBuilder : HHH000422: Disabling contextual LOB creation as connection was null
2018-03-17 20:38:46.348 INFO 17260 --- [ost-startStop-1] o.h.h.i.ast.ASTQueryTranslatorFactory : HHH000397: Using ASTQueryTranslatorFactory
2018-03-17 20:38:46.496 INFO 17260 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
I want to start multiple java applications that connect to the same h2 database server but the first one gets stuck as stated above.