HTML and CSS Reference
After the server starts, you can use asadmin add-resources command as follows in order to add the defined
resources to your server.
> asadmin add-resources <<full path>>/glassfish-resources.xml
After running the previous command, the resources will be added to your GlassFish server and you will see the
JDBC connection pool derby_net_megaApp_megaPool created successfully.
JDBC resource jdbc/mega created successfully.
Command add-resources executed successfully.
Mega App database is a JavaDB Derby database; it is included with the application source code under
( src/main/database ) directory for your reference. In order to install the database in your GlassFish 4 server, stop
your GlassFish 4 server if it is running as follows:
> asadmin stop-domain domain1
We are here assuming that your GlassFish domain name is (domain1).
After stopping the server, also stop GlassFish Java DB by running the following command:
> asadmin stop-database
After stopping GlassFish server and its Java DB, copy megaApp directory located under ( src/main/database )
directory to your ( [GlassFish server]/glassfish/databases ) directory, and then start the server and Java DB. Java
DB can start using the following command:
> asadmin start-database
After starting the server and Java DB, you can deploy the Mega App application in your GlassFish server using the
GlassFish administration console, which can be accessed usually from the following URL:
■ application Deployment in glassFish is a very straightforward process: after login to the administration console,
click the “applications” menu item in the administration console side menu and then upload the application war. you may
need to change the default context root to a friendly name (for example: “megaapp”) in order to access the application
directly using a simple context root.
Finally, you need to configure the application realm in order to properly login to the application. You can do this
by creating a new realm from configurations -> server-config -> security -> Realms and then entering the realm
information typical for the ones mentioned in Table 13-6 .
After doing the realm step, now you can access the application from