Bug 1020578

Summary: Java Scalable Application don't get connection to MongoDB.
Product: OpenShift Online Reporter: romarcio <romarcio>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED WORKSFORME QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.xCC: romarcio
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-18 21:58:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
tomcat log none

Description romarcio 2013-10-18 02:31:57 UTC
Created attachment 813581 [details]
tomcat log

Description of problem:
Java Scalable Application don't get connection to MongoDB.
An exception kind of java.io.EOFException is thrown.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create a Java Scalable App in small gear - Tomcat 7 (JBoss EWS 2.0)
2. Add MongoDB as database to that App - MongoDB 2.2
3. Configure Mongo connection class by Spring-data (MongoTemplate)
4. Add the openshift environment variables in connection class 
5. Start App

Actual results:
Exception is thrown - 
WARNING: emptying DBPortPool to 525c4d3ae0b8cdc1f0000055-xxxxxxx.rhcloud.com/10.158.61.28:42331 b/c of error
java.io.EOFException
	at org.bson.io.Bits.readFully(Bits.java:48)
	at org.bson.io.Bits.readFully(Bits.java:33)
	at org.bson.io.Bits.readFully(Bits.java:28)
	at com.mongodb.Response.<init>(Response.java:40)
	at com.mongodb.DBPort.go(DBPort.java:124)
	at com.mongodb.DBPort.call(DBPort.java:74)
	at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
	at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
	at com.mongodb.DBCursor._check(DBCursor.java:368)
	at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
	at com.mongodb.DBCursor.hasNext(DBCursor.java:484)

	
Complete log was attached.	


Expected results:
The success in connection to MongoDB.

Additional info:
The same app is running as non-scalable and the connection to Mongodb is successful.

Comment 1 Jhon Honce 2013-10-18 16:31:36 UTC
Is your code on github or public so that I could use it for debugging?

Comment 2 romarcio 2013-10-18 20:54:53 UTC
(In reply to Jhon Honce from comment #1)
> Is your code on github or public so that I could use it for debugging?

Hello Jhon Honce!

After many days trying to do the application works, I decided to remove it and to create a new cartridge scalable. This new cartridge I added the same application and it is working, no problem or error appeared in relation to MongoDB connection.

It was a surprise to me and I don't know to say what may have gone wrong in the first attempt.

Comment 3 Jhon Honce 2013-10-18 21:58:10 UTC
Please reopen if you have another occurrence.

Sorry for the inconvenience.