users@glassfish.java.net

Re: Not Connecting to Database

From: <glassfish_at_javadesktop.org>
Date: Thu, 23 Aug 2007 13:55:07 PDT

First of all, thank you for providing me with some good feedback!

I am not sure I am following your logic completely in your response. The object here is to use application managed Entity Manager inside the Java EE container. This is why I have defined the following:

[code]
@PersistenceUnit
        private EntityManagerFactory entityManagerFactory;
        private EntityManager entityManager;
[/code]

Also, I am led to believe the Application server is using the properties file. This is based upon the weak support from the log file:

[code]
[#|2007-08-23T15:13:39.697-0500|CONFIG|sun-appserver-pe9.0|oracle.toplink.essentials.file:/C:/glassfish/domains/domain1/applications/j2ee-apps/MYPROJECT/MYEJB_jar/-MYEJBPU.connection|_ThreadID=11;_ThreadName=httpWorkerThread-8080-0;jdbc:mysql://:3306/;my_user_at_localhost;MySQL;5.0.45-community-nt;MySQL-AB JDBC Driver;mysql-connector-java-5.0.7 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ );
        ;|connected_user_database_driver|#]
[/code]

I want to draw your attention to the point MYEJBPU. This is the persistence unit's name. However, I am "ignoring" the properties file for now..... :-)

I have googled the error messages several times. In the link you provided, it ask one to ensure certain properties are set within the application server. I have accompled this and saved my changes. However, I am STILL getting the same error.

I have also ensured the MYSQL JDBC drivers are located in the below directory:
[code]
C:\glassfish\domains\domain1\lib\ext
[/code]

What am I missing?

I see TopLink is attempting to connect:

[code]
[#|2007-08-23T15:13:39.728-0500|FINEST|sun-appserver-pe9.0|oracle.toplink.essentials.file:/C:/glassfish/domains/domain1/applications/j2ee-apps/MyPROJECT/MYEJB_jar/-MYEJBPU.connection|_ThreadID=11;_ThreadName=httpWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=b256d605-d623-4521-8367-309bf4046fd7;|reconnecting_to_external_connection_pool|#]
[/code]

Am I missing something here?

Any suggestions would be greatly appreciated.....

Russ
[Message sent by forum member 'russ_ray' (russ_ray)]

http://forums.java.net/jive/thread.jspa?messageID=232395