SOLVE!
It looks like the piping service in Bluemix has been updated, connecting to ClearDB works great now! Thanks to the one who pushed this change! :)
-
I run the code in the assembly and deployment pipeline of Bluemix, and not on the Liberty profile application server (the application works fine there), the problem is the BUILD Pipeline (mvn clean install) stage during the operation of my Tests module, here is the error message
Creating a new Hibernate SessionFactory 2015-04-11 15:04:49 [main] ERROR ohutil.JDBCExceptionReporter - Communication channel failure
The last packet successfully sent to the server was 0 milliseconds ago. The driver did not receive any packets from the server.
Unit Test classes cannot connect to the database.
There is nothing special in my code, you can create any standard JDBC connection in the JUnit Test class and try to establish a connection to db, but if you want to easily confirm this communication restriction, here is how you can test it without Java code:
- Create a Liberty Profile Application with Beginner Code
- Create and bind the ClearDB MySQL service to it
- On the Application Overview page, expand the ClearDB window by clicking the "Show Credentials" button and copy the host name (for example, us-cdbr-test-west-07.cleardb.net).
- Add GIT, return to Application Overview, click EDIT CODE, click Build and Deploy, click the BUILD Stage icon, select Configure Stage, and add the following code to the command field:
code
REMOTEHOST=us-cdbr-test-west-07.cleardb.net REMOTEPORT=3306 TIMEOUT=1 if nc -w $TIMEOUT -z $REMOTEHOST $REMOTEPORT; then echo "I was able to connect to ${REMOTEHOST}:${REMOTEPORT}" else echo "Connection to ${REMOTEHOST}:${REMOTEPORT} failed; exit code from netcat was $?" fi
- Run the BUILD step and check if this message appears:
[86d18f86-4ade-4e02-8282-171dc9757272] $ /bin/bash /tmp/hudson5506792757013948518.sh Connection to us-cdbr-test-west-07.cleardb.net:3306 failed; exit code from netcat was 1
Please advise if there is a way to configure the pipeline so that it can interact with ClearDB.
source share