通过awselb使用ssl时neo4j java驱动程序的问题

时间:2017-02-21 06:04:40

标签: java ssl neo4j

我正在使用neo4j社区版3.1.1和企业版3.0.1版,并通过awselb配置了ssl。 连接我使用neo4j java驱动程序版本1.0.0 在我通过awselb配置ssl和连接后,我对打开的文件有问题,他们增长如此之快,而且数量没有减少。 enter image description here 应用程序中的代码使用ssl

GraphDatabase.driver(host, authToken, Config.build().withEncryptionLevel(Config.EncryptionLevel.REQUIRED).toConfig());

我尝试将neo4j驱动程序升级到版本1.1.1和1.1.2,但还有另一个问题: 当我定期查询neo4j一切都很好,我从数据库中获取数据,但我定期有500错误,并在应用程序中记录此异常

没有ssl我没有问题

org.neo4j.driver.v1.exceptions.ServiceUnavailableException: SSL Connection terminated while receiving data. This can happen due to network instabilities, or due to restarts of the database.
    at org.neo4j.driver.internal.security.TLSSocketChannel.channelRead(TLSSocketChannel.java:170)
    at org.neo4j.driver.internal.security.TLSSocketChannel.unwrap(TLSSocketChannel.java:229)
    at org.neo4j.driver.internal.security.TLSSocketChannel.read(TLSSocketChannel.java:419)
    at org.neo4j.driver.internal.net.BufferingChunkedInput.readNextPacket(BufferingChunkedInput.java:409)
    at org.neo4j.driver.internal.net.BufferingChunkedInput.readChunkSize(BufferingChunkedInput.java:345)
    at org.neo4j.driver.internal.net.BufferingChunkedInput.read(BufferingChunkedInput.java:247)
    at org.neo4j.driver.internal.net.BufferingChunkedInput.fillScratchBuffer(BufferingChunkedInput.java:216)
    at org.neo4j.driver.internal.net.BufferingChunkedInput.readByte(BufferingChunkedInput.java:110)
    at org.neo4j.driver.internal.packstream.PackStream$Unpacker.unpackStructHeader(PackStream.java:430)
    at org.neo4j.driver.internal.messaging.PackStreamMessageFormatV1$Reader.read(PackStreamMessageFormatV1.java:398)
    at org.neo4j.driver.internal.net.SocketClient.receiveOne(SocketClient.java:176)
    at org.neo4j.driver.internal.net.SocketConnection.receiveOne(SocketConnection.java:214)
    at org.neo4j.driver.internal.net.ConcurrencyGuardingConnection.receiveOne(ConcurrencyGuardingConnection.java:166)
    at org.neo4j.driver.internal.net.pooling.PooledConnection.receiveOne(PooledConnection.java:182)
    at org.neo4j.driver.internal.InternalStatementResult.tryFetchNext(InternalStatementResult.java:324)
    at org.neo4j.driver.internal.InternalStatementResult.hasNext(InternalStatementResult.java:191)
    at org.neo4j.driver.internal.InternalStatementResult.list(InternalStatementResult.java:261)
    at carx.neo4j.beans.services.Neo4jClient.getResults(Neo4jClient.java:90)
    at carx.mpserver.beans.services.impl.StorageFacadeServiceImpl.getLastTopPeriodIds(StorageFacadeServiceImpl.java:395)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:97)
    at carx.web.spark.beans.aspect.abased.ProfilerUtilAspect.profile(ProfilerUtilAspect.java:55)
    at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:620)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:609)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
    at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy94.getLastTopPeriodIds(Unknown Source)
    at carx.mpserver.beans.services.impl.TopServiceImpl.getPeriodInfo(TopServiceImpl.java:265)
    at carx.mpserver.beans.services.impl.TopServiceImpl.list(TopServiceImpl.java:162)
    at carx.mpserver.beans.services.impl.MpServerUserApiImpl.topList(MpServerUserApiImpl.java:168)
    at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy126.topList(Unknown Source)
    at carx.mpserver.beans.bootstraps.CarxMpRoutesServiceImpl.lambda$initRoutes$14(CarxMpRoutesServiceImpl.java:102)
    at carx.web.spark.beans.service.impl.BaseSparkRoutesService$ContextAwareAndToJsonRoute.handle(BaseSparkRoutesService.java:292)
    at spark.RouteImpl$1.handle(RouteImpl.java:61)
    at spark.http.matching.Routes.execute(Routes.java:61)
    at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:128)
    at spark.servlet.SparkFilter.doFilter(SparkFilter.java:173)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:201)
    at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
    at org.eclipse.jetty.server.Server.handle(Server.java:517)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)  

1 个答案:

答案 0 :(得分:0)

我的Rest API遇到了同样的问题。最初我已经实例化了GraphDatabase.driver(..)每个推荐的API调用。然后我在构造函数中实例化了GraphDatabase.driver(..),并在每个API中重用它。然后没遇到任何问题。