0

注意:已经有类似的问题,但解决方案不适用于 jqassistant-maven-plugin。

我在一个新的客户端站点上遇到了一个问题,我想通过使用 jqassistant-maven-plugin (1.10.0) 查看 JQAssistant 扫描的 Neo4j 内容。

运行mvn jqassistant:scan jqassistant:analyze jqassistant:server将启动并嵌入 Neo4j,扫描我的 Maven 项目的内容,并保持嵌入式实例打开,以便我可以通过 http://localhost:7474/ 访问它

尝试登录浏览器(使用螺栓协议)时,我遇到了连接问题。

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

我以前从未见过这样的工具。我发现的唯一资源是这个文档说应该更改listenAddress。

基本上 JQAssistant 像往常一样配置,除了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>

有没有人有类似的经历?在我看来,浏览器中的一些公司设置(所有这些都可用)正在阻止 websocket。有没有解决的办法。目前我唯一的解决方法是使用专用的 Neo4j 实例,这会使开发设置复杂化,我想避免这种情况。

进一步的分析:

检查浏览器端口,表明它正在侦听

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

另一方面,螺栓端口不可用

netstat -a | findstr 7687
4

1 回答 1

0

设置<embeddedBoltPort>45856</embeddedBoltPort>(任意高数字)后,我终于可以连接了。由于某种原因,该端口不允许出现,即使将其更改为常用的 8080 也不起作用。

我不明白为什么会这样,因为端口没有被使用。测试使用的端口时,出现正确的异常,表明它已在使用中。我只能在客户端假设一些奇怪的安全设置

我对 jqassistant-maven-plugin 的唯一建议是测试是否所有必需的端口都已启动并运行,即使在启动期间没有发生异常也是如此。

感谢任何人分享想法以追踪这一点。

于 2021-07-29T13:25:09.243 回答