2017-09-11 6 views
0

내 응용 프로그램에서 MongoDB를 사용하고 로컬 응용 프로그램 서버 및 로컬 MongoDB 데이터베이스에 배포 한 후 Wildfly 11.0.0.Alpha1과 함께 로컬로 올바르게 작동합니다 응용 프로그램은 컨텍스트 경로와 포트에서 도달 할 수 있습니다.Java 응용 프로그램을 MongoDB에 연결 - com.mongodb.MongoSocketReadException : 중간에 스트림에 도달했습니다.

다음 단계는이 응용 프로그램을 서버 maschine의 JBoss 서버에 배포하는 것입니다. 은 내가 MongoDB를 서버에 MongoDB를 URI를 변경 :

mongodb://user:[email protected]:27017/databaseName?authMechanism=SCRAM-SHA-1&ssl=true 

내가 아래쪽에 다음 로그 항목을 얻을이 응용 프로그램을 배포하는 경우. 사실 나는 왜 그것이 무엇을 의미하는지 모른다. 이 문제를 해결하기 위해 내가 할 수있는 일을 암시 해줄 사람이 있습니까?

08:38:42,249 INFO [org.mongodb.driver.cluster] (cluster- 
ClusterId{value='59b62f7238b5cb310bd6f438', description='null'}-myServer:27017) Exception in monitor thread while connecting 
to 
server myServer:27017: com.mongodb.MongoSocketReadException: Prematurely 
reached end of stream 
    at com.mongodb.connection.SocketStream.read(SocketStream.java:88) 
[mongodb-driver-core-3.4.1.jar:] 
    atm com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:85) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:45) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116) [mongodb-driver-core-3.4.1.jar:] 
    at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113) [mongodb-driver-core-3.4.1.jar:] 
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_112] 

08:38:42,855 INFO [org.mongodb.driver.cluster] (ServerService Thread Pool -- 290) No server chosen by WritableServerSelector from cluster description 
ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions= 
[ServerDescription{address=myServer:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]}. Waiting for 30000 ms before timing out 

답변

0

이것은 mongodb와의 연결에서 발생하는 시간 초과와 관련이있을 수 있습니다. 당신이

MongoClientOptions.Builder builder = new MongoClientOptions.Builder(); 
builder.maxConnectionIdleTime(<long_time>); 

를 연결을 구축 제한 시간이

말했다 제거하려고 할 때 API를 사용하여 시간 제한을 높이기 위해 시도