neo4j服务器扩展示例-java.net.BindException:地址已在使用中

问题描述 投票:1回答:2

我正在查看github-中发布的neo4j服务器扩展示例,并且在运行mvn软件包时,MovieServiceIntegrationTest上的端口7474获得了“ java.net.BindException:地址已在使用中。”>

我已经通过命令'lsof -i:7474'和'netstat -n'查看了端口,但没有发现任何干扰。

我也曾在linux上尝试过(最初在os X上尝试过,但我遇到了同样的问题。

下一步是研究此错误的最佳方法是什么?

] >>
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running example.extension.movies.MovieServiceIntegrationTest
server.baseUri() = http://localhost:7474/
05:46:21.067 [main] WARN  o.e.j.server.handler.ContextHandler - o.e.j.s.ServletContextHandler@29314cc9{/,null,null} contextPath ends with /
05:46:21.070 [main] WARN  o.e.j.server.handler.ContextHandler - Empty contextPath
05:46:21.078 [main] INFO  org.eclipse.jetty.server.Server - jetty-9.0.5.v20130815
05:46:21.133 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler@7b208b45{/,null,AVAILABLE}
Mar 23, 2015 5:46:21 AM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
  example.extension.movies
Mar 23, 2015 5:46:21 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
  class example.extension.movies.MovieResource
Mar 23, 2015 5:46:21 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Mar 23, 2015 5:46:21 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
05:46:21.588 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@ba354ca{/movie,null,AVAILABLE}
Mar 23, 2015 5:46:21 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
05:46:21.757 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@7b4acdc2{/db/manage,null,AVAILABLE}
Mar 23, 2015 5:46:21 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
05:46:21.957 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@736048ed{/db/data,null,AVAILABLE}
05:46:22.061 [main] INFO  o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /browser, did not find org.apache.jasper.servlet.JspServlet
05:46:22.078 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@64693226{/browser,jar:file:/Users/brianchase/.m2/repository/org/neo4j/app/neo4j-browser/2.1.4/neo4j-browser-2.1.4.jar!/browser,AVAILABLE}
Mar 23, 2015 5:46:22 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
05:46:22.191 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@29314cc9{/,null,AVAILABLE}
05:46:22.251 [main] WARN  o.e.j.u.component.AbstractLifeCycle - FAILED ServerConnector@3f985a86{HTTP/1.1}{localhost:7474}: java.net.BindException: Address already in use
java.net.BindException: Address already in use

端口调查(侦听中的7474 neo4j服务器):

Computer:~ user$ lsof -i:7474
COMMAND PID       USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    421 user  137u  IPv6 0x4c075845f5b86ccd      0t0  TCP localhost:7474 (LISTEN)

Netstat:

Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4       0      0  192.168.44.208.49303   65.115.96.238.80       SYN_SENT   
tcp4       0      0  192.168.44.208.49301   209.197.20.103.80      ESTABLISHED
tcp4       0      0  192.168.44.208.49300   4.31.28.74.80          ESTABLISHED
tcp4     164      0  192.168.44.208.49276   52.0.233.188.80        CLOSE_WAIT 
tcp4       0      0  192.168.44.208.49208   108.160.170.34.80      ESTABLISHED
tcp4      37      0  192.168.44.208.49186   108.160.165.211.443    CLOSE_WAIT 
tcp4      37      0  192.168.44.208.49185   108.160.165.211.443    CLOSE_WAIT 
tcp4      37      0  192.168.44.208.49184   108.160.165.211.443    CLOSE_WAIT 
tcp4      37      0  192.168.44.208.49183   108.160.165.211.443    CLOSE_WAIT 
tcp4       0      0  192.168.44.208.49178   17.172.233.120.5223    ESTABLISHED
tcp4       0      0  192.168.44.208.49177   17.110.227.101.5223    ESTABLISHED
tcp4      37      0  192.168.44.208.49170   108.160.166.141.443    CLOSE_WAIT 
udp4       0      0  *.58920                *.*                               
udp4       0      0  *.17500                *.*                               
udp4       0      0  *.53249                *.*                               
udp4       0      0  192.168.44.208.123     *.*                               
udp6       0      0  fe80::2ef0:eeff:.123   *.*                               
udp6       0      0  fe80::8402:97ff:.123   *.*                               
udp6       0      0  fe80::1%lo0.123        *.*                               
udp4       0      0  127.0.0.1.123          *.*                               
udp6       0      0  ::1.123                *.*                               
udp6       0      0  *.123                  *.*                               
udp4       0      0  *.123                  *.*                               
udp6       0      0  *.5353                 *.*                               
udp4       0      0  *.5353                 *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.58003                *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp6       0      0  *.5353                 *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp6       0      0  *.5353                 *.*                               
udp4       0      0  *.5353                 *.*                               
udp46      0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp46      0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.*                    *.*                               
udp4       0      0  *.137                  *.*                               
udp4       0      0  *.138                  *.* 

[我正在查看github-中发布的neo4j服务器扩展示例,并且在运行mvn软件包时,我在端口7474上获取了“ java.net.BindException:地址已在使用中” ...] >

似乎在运行maven测试时正在运行neo4j实例。确保在运行Maven之前将其关闭。

运行mvn之前,请使用jps列出所有正在运行的Java进程。 jps列表中将neo4j进程称为Bootstrapper。确保没有这样的过程。

我刚刚重新启动计算机,瞧!它成功了!

java maven neo4j jersey
2个回答
0
投票

似乎在运行maven测试时正在运行neo4j实例。确保在运行Maven之前将其关闭。


0
投票

我刚刚重新启动计算机,瞧!它成功了!

© www.soinside.com 2019 - 2024. All rights reserved.