lundi 25 mai 2015

Glassfish docker in AWS - Error connecting to server localhost on port 1527 with message Connection refused

I am currently developing a backend application for an Android aplication, the application works fines when I test it locally, however when I try to deploy it to Elastic Beanstalk on AWS the server gives me the following errors":

Caused by: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused. at com.sun.gjc.spi.base.AbstractDataSource.getConnection(AbstractDataSource.java:152) at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:132)

When I test it locally it was tested on Glassfish 4.1 server, and on AWS it was deployed on Elastic Beanstalk with preconfigured Glassfish 4.1 docker container, I suspect this environment change causes some problems.

This is what I have in my persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://ift.tt/1cKbVbQ" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/1cKbVbQ http://ift.tt/1kMb4sd">
  <persistence-unit name="TheLorryAmazon2PU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>entities.LorryCities</class>
    <class>entities.LorryManpower</class>
    <class>entities.PortalBookings</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
        <property name="javax.persistence.jdbc.url" value="jdbc:mysql://ABAB.chg3sjfpdj.us-east-1.rds.amazonaws.com:3306/ABAB_db"/>
        <property name="javax.persistence.jdbc.user" value="adminA"/>
        <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        <property name="javax.persistence.jdbc.password" value="adminB"/>

    </properties>
  </persistence-unit>
</persistence>



Aucun commentaire:

Enregistrer un commentaire