How to do it...

Follow these steps:

  1. First, we are deploying EAR, WAR, and JAR files. For EAR and WAR files, the deployment folder is the following:
 $GLASSFISH_HOME/glassfish/domains/[domain_name]/autodeploy

Usually domain_name is domain1, unless you've changed it in the installation process. For JAR files, the folder is $GLASSFISH_HOME/glassfish/lib.

  1. To create a datasource and a connection pool to help you use databases in your project, edit the $GLASSFISH_HOME/glassfish/domains/[domain_name]/config/domain.xml file. Inside the <resources> node, insert a child node like this one:
<jdbc-connection-pool   pool-resize-quantity="4"   max-pool-size="64"   max-wait-time-in-millis="120000"   driver-classname="com.mysql.jdbc.Driver"  datasource-classname="com.mysql.jdbc.jdbc2.optional ...

Get Jakarta EE Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.