Getting started with GrailsOverviewGrails aims to bring the "coding by convention" paradigm to Groovy. It's an open-source web application framework that leverage the Groovy language and complements Java Web development. You can use Grails as a standalone development environment that hides all configuration details or integrate your Java business logic. Grails aims to make development as simple as possible and hence should appeal to a wide range of developers not just those from the Java community. GlassFish Support For Grails adds Grails framework to GlassFish application server and allows development and easy deployment of Grails applications. Applications can be deployed in shared or standalone mode. Shared mode allows library reuse and results in much smaller war files. It also provides run-app command to develop the grails applications using GlassFish. Install & Setup
Cannot resolve external resource into attachment.
On a Windows computer these step are done as follows: > set GRAILS_HOME=C:\GlassFish\grails > set PATH=%GRAILS_HOME%\bin;%PATH% On a Unix-like computer these steps are done as follows: > set GRAILS_HOME=~/glassfish/grails > export GRAILS_HOME > cd $GRAILS_HOME > set PATH=$GRAILS_HOME/bin:$PATH > export PATH > chmod a+x $GRAILS_HOME/bin/* Create Grails applicationYou can now run the grails command: > grails create-app BookLibrary For more details on developing Grails application refer to Grails QuickStart Deployment On GlassFishDeveloping your Grails applications with GlassFishTo run your grails application all you need to do is
> cd BookLibrary
This will start GlassFish v3 in embedded mode and deploy the application. You can keep editing your grails applications and refresh the application page in the browser to see the changes without restarting the application. Cannot resolve external resource into attachment. ... Cannot resolve external resource into attachment. Deploy on standalone GlassFish v3Grails recommends creating a war file using grails war command to package your application for production uses and testing. The all-in one WAR file packages around 49 jars and creates a large WAR file. The GlassFish Grails IPS package that you installed using updatetool, provides grails shared-war command in addition to grails war. shared-war command won't package all the grails dependency in a single war file and saves system resources arising from all-in-one war file. The WAR file created using shared-war is quite small couple hudred KBs compared to about 20 MB. Here is how you would deploy a shared WAR and all in one WAR.
~/GlassFish/bin/asadmin start-domain
cd BookLibrary
grails shared-war
~/GlassFish/bin/asadmin deploy --libraries $GRAILS_HOME/lib/glassfish-grails.jar BookLibrary-0.1.war Above, you tell GlassFish where the glassfish-grails.jar is. This jar file provides all the grails jars dependencies in it's MANIFEST files. This allows GlassFish to resolve classes required during grails application deployment.
grails war
~/GlassFish/bin/asadmin deploy BookLibrary-0.1.war
http://localhost:8080/BookLibrary-1.0/ References |