Changes between Version 4 and Version 5 of QuickStart


Ignore:
Timestamp:
Feb 7, 2011, 5:12:44 PM (8 years ago)
Author:
jannekevdp@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • QuickStart

    v4 v5  
    44
    55There are three ways of running GSCF:
    6 * download a pre-compiled WAR into a Java servlet container such as Tomcat
    7 * compile and run it from source using the command line
    8 * compile and run it from source using a development environment
     6 * download a pre-compiled WAR into a Java servlet container such as Tomcat
     7 * compile and run it from source using the command line
     8 * compile and run it from source using a development environment
    99
    1010=== Download a pre-compiled WAR into a Java servlet container ===
    1111
    12 * Download the pre-compiled WAR from [https://trac.nbic.nl/gscf/downloads Trac].
    13 * Deploy the WAR into your Java servlet container (such as Apache Tomcat)
    14 * By default, the gscf-[version]-test.war download will use an in-memory database, which means that the database is emptied and filled with some example data at each restart. You can specify a database by creating your own configuration: create a file .grails-config/test-gscf.properties in the home directory of the user that runs the servlet container process (probably 'tomcat'). See Configuration below.
     12 * Download the pre-compiled WAR from [https://trac.nbic.nl/gscf/downloads Trac].
     13 * Deploy the WAR into your Java servlet container (such as Apache Tomcat)
     14 * By default, the gscf-[version]-test.war download will use an in-memory database, which means that the database is emptied and filled with some example data at each restart. You can specify a database by creating your own configuration: create a file .grails-config/test-gscf.properties in the home directory of the user that runs the servlet container process (probably 'tomcat'). See Configuration below.
    1515
    1616See for more details the INSTALLATION file that comes with the downloaded version, or Database/Production below.
     
    3535=== Use a development environment ===
    3636
    37 * The best free IDE out there for Grails seem to be SpringSource Tool Suite and NetBeans at the moment. Make sure to use the latest version, as Grails support is still much under development. Blog post http://www.grailsblog.com/archive/show?id=15 shows how to get NetBeans and Grails working. Another editor with excellent (and paid) Grails support is IntelliJ.
    38 * Checkout the gscf trunk from subversion in a new folder (https://trac.nbic.nl/svn/gscf/trunk)
    39 * Open the folder in the Grails-enabled NetBeans, it should recognize the Grails project
    40 * You might have to change your launch configuration to include the VM parameter -XX:MaxPermSize=256M if you run into PermGemSpace errors
    41 * Launch it from NetBeans (just press the green button ;-))
    42 * If this is a first time checkout and launch, you might get dependency errors. This can be resolved by running 'grails run-app', 'grails upgrade --non-interactive', and then 'grails run-app' to run the application again.
     37 * The best free IDE out there for Grails seem to be SpringSource Tool Suite and NetBeans at the moment. Make sure to use the latest version, as Grails support is still much under development. Blog post http://www.grailsblog.com/archive/show?id=15 shows how to get NetBeans and Grails working. Another editor with excellent (and paid) Grails support is IntelliJ.
     38 * Checkout the gscf trunk from subversion in a new folder (https://trac.nbic.nl/svn/gscf/trunk)
     39 * Open the folder in the Grails-enabled NetBeans, it should recognize the Grails project
     40 * You might have to change your launch configuration to include the VM parameter -XX:MaxPermSize=256M if you run into PermGemSpace errors
     41 * Launch it from NetBeans (just press the green button ;-))
     42 * If this is a first time checkout and launch, you might get dependency errors. This can be resolved by running 'grails run-app', 'grails upgrade --non-interactive', and then 'grails run-app' to run the application again.
    4343
    4444== A little more background ==
     
    5454When you run 'grails run-app' (as NetBeans does behind the scenes), grails automatically installs any plugins on which the application is depending. To view which plugins are in your Grails cache, run:
    5555{{{ls ~/.grails/1.1.1/plugins}}}
    56 * As of Grails 1.3.1, the plugin structure has changed, and this causes sometimes 'plugin not found' errors even on a fresh Grails download and project checkout. Try running 'grails upgrade', that should solve the problem.
    57 * It seems that NetBeans sometimes has trouble installing the Nimble plugin, so if it's not there (grails-nimble-0.3-SNAPSHOT.zip), try running 'grails run-app' from the command line in the application directory.
    58 * Also, if you get complaints about a certain plugin when building from scratch, it could be that some of the plugin versions were are using (see 'application.properties' in the project root) are outdated. Since Grails automatically fetches the newest version of any plugin when installing from scratch, this causes 'artefact not found' errors. You can check for plugin updates with the command 'grails list-plugin-updates'. One way of solving this problem is to upgrade the project plugin version to the newest available version (preferably only latest stable, no RC's), either by updating the version number in 'application.properties' or by using the install-plugin command, e.g. 'grails install-plugin webflow 1.2.2'.
     56 * As of Grails 1.3.1, the plugin structure has changed, and this causes sometimes 'plugin not found' errors even on a fresh Grails download and project checkout. Try running 'grails upgrade', that should solve the problem.
     57 * It seems that NetBeans sometimes has trouble installing the Nimble plugin, so if it's not there (grails-nimble-0.3-SNAPSHOT.zip), try running 'grails run-app' from the command line in the application directory.
     58 * Also, if you get complaints about a certain plugin when building from scratch, it could be that some of the plugin versions were are using (see 'application.properties' in the project root) are outdated. Since Grails automatically fetches the newest version of any plugin when installing from scratch, this causes 'artefact not found' errors. You can check for plugin updates with the command 'grails list-plugin-updates'. One way of solving this problem is to upgrade the project plugin version to the newest available version (preferably only latest stable, no RC's), either by updating the version number in 'application.properties' or by using the install-plugin command, e.g. 'grails install-plugin webflow 1.2.2'.
    5959
    6060=== Database/Production environment ===
     
    7474mysql> create database gscf;
    7575mysql> use gscf;
    76 mysql> grant all on gscf.* to gscf@localhost identified by 'dbnp';
     76mysql> grant all on gscf. * to gscf@localhost identified by 'dbnp';
    7777mysql> flush privileges;
    7878mysql> exit
     
    114114You can deploy this on Tomcat 6.
    115115Known issues:
    116 * If you downloaded Tomcat for Ubuntu, do not forget to set executable file properties to the scripts in /bin: {{{chmod u+x *.sh}}}
    117 * You need to increase the PermGenSpace, otherwise Tomcat will crash. This can be done by setting {{{export CATALINA_OPTS="-Xmx1024M -XX:MaxPermSize=256M"}}}
    118 * You need to upgrade to the latest version of JQuery plugin 1.4.1.1 (see http://jira.codehaus.org/browse/GRAILSPLUGINS-1864), otherwise you will get an error concerning JQueryTagLib: {{{org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.catalina.loader.WebappClassLoader' to required type 'groovy.lang.GroovyClassLoader' for property 'classLoader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.catalina.loader.WebappClassLoader] to required type [groovy.lang.GroovyClassLoader] for property 'classLoader': no matching editors or conversion strategy found}}}
    119 * The searchable plugin sometimes causes errors: http://n4.nabble.com/searchable-tomcat6-fail-td1339718.html - temporary fix: delete searchable plugin and searchable and plugin controllers+views
    120 * we use scaffolding, so make sure all scaffolding files (like Controller.groovy) are present in /src/templates/scaffolding when you build the war. You can install them with {{{grails install-templates}}}
     116 * If you downloaded Tomcat for Ubuntu, do not forget to set executable file properties to the scripts in /bin: {{{chmod u+x *.sh}}}
     117 * You need to increase the PermGenSpace, otherwise Tomcat will crash. This can be done by setting {{{export CATALINA_OPTS="-Xmx1024M -XX:MaxPermSize=256M"}}}
     118 * You need to upgrade to the latest version of JQuery plugin 1.4.1.1 (see http://jira.codehaus.org/browse/GRAILSPLUGINS-1864), otherwise you will get an error concerning JQueryTagLib: {{{org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.catalina.loader.WebappClassLoader' to required type 'groovy.lang.GroovyClassLoader' for property 'classLoader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.catalina.loader.WebappClassLoader] to required type [groovy.lang.GroovyClassLoader] for property 'classLoader': no matching editors or conversion strategy found}}}
     119 * The searchable plugin sometimes causes errors: http://n4.nabble.com/searchable-tomcat6-fail-td1339718.html - temporary fix: delete searchable plugin and searchable and plugin controllers+views
     120 * we use scaffolding, so make sure all scaffolding files (like Controller.groovy) are present in /src/templates/scaffolding when you build the war. You can install them with {{{grails install-templates}}}
    121121
    122122==== Set up a virtual host in Apache ====
     
    220220
    221221You probably noticed that in the previous step, we defined two authentication files, in this case /home/tomcat/authentication/users and /home/tomcat/authentication/groups, but you can place them wherever you want. Of course, make sure that you secure access and that the user that is running the apache process is allowed to read the file (as goes for all those files). You can create the files by using ht_passwd (see the [http://httpd.apache.org/docs/2.2/programs/htpasswd.html documentation]). Also be sure to check the [http://httpd.apache.org/docs/2.2/misc/security_tips.html Apache security tips].
    222