Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring boot embedded neo4j: not able to connect from client when in docker container #1278

Closed
saritatewari4 opened this issue Jul 29, 2022 · 1 comment

Comments

@saritatewari4
Copy link

saritatewari4 commented Jul 29, 2022

Hello all, I upgraded one of my spring boot application from java 8 . I was using spring boot version 2.1.5.RELEASE previously with these all dependencies:

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<neo4j.version>3.5.20</neo4j.version>
<neo4j-ogm-core.version>3.1.9</neo4j-ogm-core.version>
<neo4j-ogm-api.version>3.1.8</neo4j-ogm-api.version>
<neo4j-ogm-embedded-driver.version>3.1.9</neo4j-ogm-embedded-driver.version>
<liquigraph.version>3.1.2</liquigraph.version>
<lombok.version>1.18.8</lombok.version>
<spring-data-neo4j.version>5.3.1.RELEASE</spring-data-neo4j.version>
<spring-boot-starter.version>2.1.5.RELEASE</spring-boot-starter.version>
<spring-boot-starter-test.version>2.1.5.RELEASE</spring-boot-starter-test.version>

Now upgraded that to java 11 with spring boot version 2.3.3.RELEASE with these dependencies:

<java.version>11</java.version>
<neo4j.version>4.2.4</neo4j.version>
<neo4j-ogm-core.version>3.2.32</neo4j-ogm-core.version>
<neo4j-ogm-api.version>3.2.32</neo4j-ogm-api.version>
<liquigraph.version>4.0.2</liquigraph.version>
<lombok.version>1.18.8</lombok.version>
<spring-data-neo4j.version>5.3.3.RELEASE</spring-data-neo4j.version>
<spring-boot-starter.version>2.3.3.RELEASE</spring-boot-starter.version>
<spring-boot-starter-test.version>2.3.3.RELEASE</spring-boot-starter-test.version>

I am running embedded neo4j on spring-boot application. It's working fine when running in local. I am not able to connect to database from client server and I am getting this error when server is running on docker container:

Connection to the database terminated. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.

It was working fine with previous dependency tree with java 8 version. To add on , I am getting this error on neo4j desktop:

ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3

On client side this is my code snippet:

Config config = Config.builder()
                .withoutEncryption()
                .build();
driver = GraphDatabase.driver( uri, config );

and on the server side this is how I am connecting to embedded Neo4J instance:

DatabaseManagementService managementService = new DatabaseManagementServiceBuilder(databaseDirectory.getCanonicalFile())
                .setConfig(GraphDatabaseSettings.allow_upgrade, true)
                .setConfig(GraphDatabaseSettings.default_database, neo4jProperties.getDbName())
                .setConfig(BoltConnector.encryption_level, BoltConnector.EncryptionLevel.DISABLED)
                .setConfig(BoltConnector.enabled, true)
                .setConfig(BoltConnector.listen_address,
                        new SocketAddress(neo4jProperties.getListeningAddress()))
                .build();
@injectives
Copy link
Contributor

If this issue is still active and neo4j-java-driver is suspected to have a bug, please provide some reproduction steps and I would be happy to take a look.

@injectives injectives closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants