I use Glassfish 3.1.2.2 (build 5), JPA, EclipseLink, MySQL
I created MySQL pool via Glassfish admin panel. Ping to MySQL from GF admin panel is ok.
I created
I had the same problem.
The solution (for anybody that still have this issue):
if you are using the NetBeans IDE 8.1 with Glassfish 4.1.1, I advise you to change it to Glassfish 4.1
Go to the left panel in NetBeans.
Click on services > server > glassfish
then right-click (in Glassfish server) and choose view domain admin console, a web page should show up.
Go to the left and choose resources > JDBC
and JDBC connection pool
.
Add a new connection pool by clicking on new
, type the name of your pool.
Next, choose the javax.sql.ConnectionPoolDataSource
and the datadriver
(in my case is MySQL) and click next.
After that, you should enter all the needed information for your database.
Go back to Resources > JDBC
. This time, JDBC Resources
create a new JDBC resources (for me, I named it jdbc/test
). Don't forget to link it with the connection pool you already created.
In NetBeans go to your ejb
project and modify the persistence.xml
file. Change the datasource
to the database resource (in my case jdbc/test
) and save all.
That should work.