users@glassfish.java.net

Re: Not Connecting to Database

From: <glassfish_at_javadesktop.org>
Date: Thu, 23 Aug 2007 12:12:03 PDT

Please forget about your properties if you are running inside GlassFish the way you described above. Those properties are not used.

Now other concerns:
1. This code in one of the previous post is wrong (you can't define @PersistenceUnit on a EM):
        @PersistenceUnit(unitName="MYEJBPU")
        @PersistenceContext private EntityManager entityManager;

2. You don't need to define @Resource(name="jdbc/<databasename>",...) either (I hope you don't intend to use the same resource in 2 ways - via JPA and JDBC).

3.TopLink logs - the datasource is looked up by the container, so the provider doesn't know the name, so you can ignore that message, but the following mesage should be meaningful (replace my default settings with your actual one):
[#|2007-08-23T11:59:53.862-0700|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=16;_Thread
Name=Thread-32;|[TopLink Config]: 2007.08.23 11:59:53.862--ServerSession(8490467)--Connection(4117493)--Connecte
d: jdbc:derby://localhost:1527/sun-appserv-samples;create=true
        User: APP
        Database: Apache Derby Version: 10.1.1.0
        Driver: Apache Derby Network Client JDBC Driver Version: 10.1.1.0
|#]

4. Googling for your error message brings this link: http://forums.codecharge.com/posts.php?post_id=37828 - can it be that your settings are not complete?

thanks,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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