- Go to Edit Configurations in Intellij:
- In the window that just appeared, click in the left pane the link "Add new..", and select Glassfish Server, Local variant:
- Make sure that the forms are filled like this:
- Click plus button at Before Launch pane
- Select Build Artifacts from the list
- If this list contains a .war file, jump to step 8, otherwise continue
- To get the .war file, project must be built; close the windows and go to the gradle panel and go to build and run it (double click); wait for it to finish
- After the build has been completed, go back to step 6 (Select Artifacts window) and select first .war file (not exploded)
- This is how that pane should look like
- Go to the deployment tab of same window and add artifact
- Select same war file as step 8
- This is how the window should look like (click ok)
- Now Glassfish should be available in the run list
Before all the steps, make sure you have created a database in MySQL Workbench with the name "inhuman_resources". And added a user with the following credentials:
Login Name: InhumanResourcesUser
Password: InhumanResourcesPassword
Also add the following user privileges:
- Deploy the application and go to http://localhost:4848
- Go to JDBC -> JDBC Connection Pools -> Press New
- Fill the form as follows, then click Next

- Add this

- Add the additional properties as follows

- Check the ping and click Finish
- Go to JDBC -> JDBC Resources -> Press New
- Fill the form as follows, then click OK

