I have followed this Tutorial to Create simple Java EE 7 Webservices using Netbean 7.3.1. I have Glassfish 4.0 running with Netbeans. I ran project successfully without any
To Fix First problem, open your glassfish-resource.xml
file from your project, it will look something like this.
if you don't have glassfish-resource.xml in server-configuration folder you can also check the these details by clicking on services tab in netbeans and furhter clicking on connection pools as shown in this screenshot.
Based on the information in it, and using Glassfish 4.0 web interface http://localhost:4848
Firstly Create new JDBC connection pool by navigating Common Tasks -> Resources -> JDBC -> JDBC Connection Pools. It will look something like this.
Then Secondly create Connection resource by navigating Common Tasks -> Resources -> JDBC -> JDBC Resources It will look somehting like this.
First Problem is sorted. you can test it using Ping button in connection pools
For Second problem. (if your ping is not successful do following)
Search mysql-connector-java-5.1.23-bin.jar
file in Netbeans installation folder and copy it to Glassfish library folder
C:\glassfish4\glassfish\lib
After copying stop & start server by running following commands in folder C:\glassfish4\glassfish\bin
asadmin.bat stop-domain domain1
asadmin.bat start-domain domain1
After above, deploy the application again and it will successfully deployed and you can access it using test interface
http://localhost:8080/CustomerDB/test-resbeans.html
exactly the way as in netbeans.