users@glassfish.java.net

Re: persistence.xml isn't read

From: Craig Ringer <craig_at_postnewspapers.com.au>
Date: Fri, 20 Aug 2010 19:38:16 +0800

On 20/08/10 19:30, glassfish_at_javadesktop.org wrote:

> javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException: Fehler beim Herstellen der Verbindung zum Server localhost am Port 1527. Nachricht: Verbindungsaufbau abgelehnt.
> Error Code: 0
>
> The MySQL Server is running on 3306, so i think my persistence.xml isn't used, how can i change this?

Well, strictly your issue is that the properties specified for the data
source in persistence.xml don't seem to be taking effect.

I'm wondering if you're actually using a JNDI-supplied DataSource in a
container-managed connection pool without realizing it. Have a look in
the Glassfish admin console at the JDBC connection pools and JDBC
resources, see if there's anything there that references your app. Check
for a sun-resources.xml file in your project.

Also, if the persistence.xml you posted was cut down at all, posting the
full one might help.

--
Craig Ringer