neo4jjqassistant

jqassistant-maven-plugin: cannot connect browser to embedded Neo4j


Note: There are already similar questions, but the solutions do not work for the jqassistant-maven-plugin.

I am facing an issue on a new client site, where I would like to view the Neo4j contents which have been scanned by JQAssistant, by using the jqassistant-maven-plugin (1.10.0).

Running mvn jqassistant:scan jqassistant:analyze jqassistant:server will spin up and embedded Neo4j, scan the contents of my Maven project, and keep the embedded instance open so I can access it via http://localhost:7474/

When trying to login in the browser (using the bolt protocol) I am facing a connection issue.

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

I've never seen anything like this before with this tool. The only ressource I've found was this documentation saying that the listenAddress should be changed.

Basically JQAssistant is configured as always, with the exception of the embeddedListenAddress:

<plugin>
  <groupId>com.buschmais.jqassistant</groupId>
  <artifactId>jqassistant-maven-plugin</artifactId>
  <version>${jqassistant.version}</version>
  <executions>
    <execution>
      <id>default-cli</id>
      <goals>
        <goal>scan</goal>
        <goal>analyze</goal>
      </goals>
      <configuration>
        <warnOnSeverity>INFO</warnOnSeverity>
        <failOnSeverity>MAJOR</failOnSeverity>
        <embeddedListenAddress>0.0.0.0</embeddedListenAddress>
      </configuration>
    </execution>
  </executions>
</plugin>

Does anyone had a similar experience? It seems to me that some corporate setting in the browsers (all which are available) are blocking websockets. Is there a way around this. My only workaround in the moment is using an dedicated Neo4j instance, which complicates the dev-setup and I would like to avoid this.

Further analysis:

Checking the browser-port, shows that it is listening

netstat -a | findstr 7474
  TCP    0.0.0.0:7474    
  TCP    [::]:7474

The bolt-port on the other hand is not available

netstat -a | findstr 7687

Solution

  • After setting <embeddedBoltPort>45856</embeddedBoltPort> (an arbitrary high number) I can finally connect. For some reason the port was not allowed to come up, even changing it to something commonly used like 8080 did not work.

    I do not understand why this happened, because the port was not used. When testing a used port the correct exception appears that it is already in use. I can only assume some weird security setting at the client.

    My only suggestion for the jqassistant-maven-plugin would be to test if all required ports are up and running even when no exception occured during startup.

    Thanks anyone for sharing ideas to track this down.