使用neo4j shell命令行工具时遭遇“connection refused” error的解决方法(草稿版)

展开阅读全文
博主设置当前文章不允许评论。

connection refused

03-21

server:rnrn#includern#includern#includern#includern#includern#includern#includern#includern#includern#define MYPORT 5110rn#define BACKLOG 10rnmain()rnrnint sockfd,new_fd;rnstruct sockaddr_in my_addr;rnstruct sockaddr_in their_addr;rnint sin_size;rnchar hostname[20];rngethostname(hostname,20);rnprintf("%s\n",hostname);rnif((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1)rnrnperror("socket");rnexit(1);rnrnmy_addr.sin_family=AF_INET;rnmy_addr.sin_addr.s_addr=INADDR_ANY;rnmy_addr.sin_port=MYPORT;rnbzero(&(my_addr.sin_zero),8);rnif((bind(sockfd,(struct sockaddr*)&my_addr,sizeof(struct sockaddr)))==-1)rnrnperror("bind");rnexit(1);rnrnif(listen(sockfd,BACKLOG)==-1)rnrnperror("listen");rnexit(1);rnrnwhile(1)rnrnsin_size=sizeof(struct sockaddr_in);rnif((new_fd=accept(sockfd,(struct sockaddr*)&their_addr,\rn&sin_size))==-1)rnrnperror("accept");rncontinue;rnrnprintf("server:got connection from %s\n",inet_ntoa(their_addr.sin_addr));rnif(!fork())rnrnif(send(new_fd,"Hello World!\n",14,0)==-1)rnperror("send");rnclose(new_fd);rnexit(0);rnrnclose(new_fd);rnwhile(waitpid(-1,NULL,WNOHANG)>0);rnrnrnrnrnrnclient:rnrn#includern#includern#includern#includern#includern#includern#includern#includern#includern#define PORT 5111rn#define MAXDATASIZE 100rn#define h_addr h_addr_list[0]rnint main(int argc,char *argv[])rnrnint sockfd,numbytes;rnchar buf[MAXDATASIZE];rnstruct hostent *he;rnstruct sockaddr_in their_addr;rnif(argc!=2)rnrnfprintf(stderr,"usage:client hostname\n");rnexit(1);rnrnif((he=gethostbyname(argv[1]))==NULL)rnrnherror("gethostbyname");rnexit(1);rnrnif((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1)rnrnperror("socket");rnexit(1);rnrntheir_addr.sin_family=AF_INET;rntheir_addr.sin_addr=*((struct in_addr *)he->h_addr);rntheir_addr.sin_port=htons(PORT);rnbzero((&their_addr.sin_zero),8);rnif(connect(sockfd,(struct sockaddr*)&their_addr,sizeof(st\rnruct sockaddr))==-1)rnrnperror("connect");rnexit(1);rnrnif((numbytes=recv(sockfd,buf,MAXDATASIZE,0))==-1)rnrnperror("recv");rnexit(1);rnrnbuf[numbytes]='\0';rnprintf("Recieved:%s",buf);rnclose(sockfd);rnreturn 0;rn 论坛

java.sql.SQLException: Listener refused the connection with the following error:

04-06

[code=Java]rnjava.sql.SQLException: Listener refused the connection with the following error:rnORA-12519, TNS:no appropriate service handler foundrnThe Connection descriptor used by the client was:rn192.168.1.209:1521:RUNMONITrnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)rn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)rn at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)rn at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)rn at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)rn at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rncom.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7b7874 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: rnjava.sql.SQLException: Listener refused the connection with the following error:rnORA-12519, TNS:no appropriate service handler foundrnThe Connection descriptor used by the client was:rn192.168.1.209:1521:RUNMONITrnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)rn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)rn at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)rn at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)rn at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)rn at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rncom.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1bbeb7b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: rnjava.sql.SQLException: Listener refused the connection with the following error:rnORA-12519, TNS:no appropriate service handler foundrnThe Connection descriptor used by the client was:rn192.168.1.209:1521:RUNMONITrnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)rn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)rn at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)rn at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)rn at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)rn at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rncom.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@611399 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: rnjava.sql.SQLException: Listener refused the connection with the following error:rnORA-12519, TNS:no appropriate service handler foundrnThe Connection descriptor used by the client was:rn192.168.1.209:1521:RUNMONITrnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)rn at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)rn at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)rn at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)rn at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)rn at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)rn at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)rn at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)rn at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)rn at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)rn at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)rn at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)rnjava.version ''1.6.0_10-rc2'' could not be parsed. Defaulting to JDK 1.1.rnRefreshing org.springframework.context.support.ClassPathXmlApplicationContext@f64a6c: startup date [Wed Apr 06 14:17:56 CST 2011]; root of context hierarchyrnRefreshing org.springframework.context.support.ClassPathXmlApplicationContext@f64a6c: startup date [Wed Apr 06 14:17:56 CST 2011]; root of context hierarchyrnLoading XML bean definitions from file [E:\tomcat\apache-tomcat-6.0.29\webapps\runmonitor\WEB-INF\classes\applicationContext-common.xml]rnLoading XML bean definitions from file [E:\tomcat\apache-tomcat-6.0.29\webapps\runmonitor\WEB-INF\classes\applicationContext-common.xml]rnLoading XML bean definitions from file [E:\tomcat\apache-tomcat-6.0.29\webapps\runmonitor\WEB-INF\classes\applicationContext-scheduler.xml]rnLoading XML bean definitions from file [E:\tomcat\apache-tomcat-6.0.29\webapps\runmonitor\WEB-INF\classes\applicationContext-service.xml]rnLoading XML bean definitions from file [E:\tomcat\apache-tomcat-6.0.29\webapps\runmonitor\WEB-INF\classes\applicationContext-scheduler.xml]rnLoading properties file from class path resource [init.properties]rnPre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1365e31: defining beans [/code]rn 论坛

没有更多推荐了,返回首页