Changes between Version 2 and Version 3 of QuickStart


Ignore:
Timestamp:
Feb 7, 2011, 3:52:40 PM (8 years ago)
Author:
jannekevdp@…
Comment:

moved from nbic wiki

Legend:

Unmodified
Added
Removed
Modified
  • QuickStart

    v2 v3  
    2020If you run from source from command line, you don't need to set up a database as the default development configuration runs on an in-memory HSQLDB database.
    2121
    22 The following list of commands is known to work under Ubuntu 8.04, provided you have put <pre>grails-1.3.4</pre> in <pre>/app</pre> and installed <pre>sun-java6-jdk</pre>:
     22The following list of commands is known to work under Ubuntu 8.04, provided you have put {{{grails-1.3.4}}} in {{{/app}}} and installed {{{sun-java6-jdk}}}:
    2323{{{
    2424export JAVA_HOME=/usr/lib/jvm/java-6-sun
     
    5353
    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:
    55 <pre>ls ~/.grails/1.1.1/plugins</pre>
     55{{{ls ~/.grails/1.1.1/plugins}}}
    5656* 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.
    5757* 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.
     
    6363
    6464To create the Postgres database (be sure to set authentication to md5 in pg_hba.conf):
    65 <pre>
     65{{{
    6666sudo -u postgres createuser -d -R -P gscf;
    6767sudo -u postgres createdb -O gscf gscf;
    6868(and enter 'dbnp' as password)
    69 </pre>
     69}}}
    7070
    7171To create the empty database in MySQL (not tested for all versions of GSCF):
    72 <pre>
     72{{{
    7373$ mysql --user=root
    7474mysql> create database gscf;
     
    7777mysql> flush privileges;
    7878mysql> exit
    79 </pre>
     79}}}
    8080
    8181Also, make sure the right connector JARs are in the application /lib folder (both MySQL and Postgres drivers are in SVN now).
     
    8383If you set this up correctly, just run the application in production mode and you will see that the database is filled:
    8484
    85 <pre>
     85{{{
    8686$ mysql --user=gscf -p --database=gscf
    8787mysql> show tables;
     
    9898| _user_passwd_history          |
    9999...
    100 </pre>
     100}}}
    101101
    102102=== Testing ===
     
    110110==== Deploy in a Tomcat container ====
    111111
    112 To generate a production WAR, use <pre>grails prod war</pre>
     112To generate a production WAR, use {{{grails prod war}}}
    113113
    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: <pre>chmod u+x *.sh</pre>
    117 * You need to increase the PermGenSpace, otherwise Tomcat will crash. This can be done by setting <pre>export CATALINA_OPTS="-Xmx1024M -XX:MaxPermSize=256M"</pre>
    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: <pre>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</pre>
     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}}}
    119119* 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 <pre>grails install-templates</pre>
     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 ====
     
    129129First, we have to define the AJP 1.3 connector to the Tomcat instance. Assuming it's running on port 8080 here:
    130130
    131 <pre>
     131{{{
    132132worker.list=gscf
    133133
     
    135135worker.gscf.host=localhost
    136136worker.gscf.port=8080
    137 </pre>
     137}}}
    138138
    139139===== jk-httpd.conf =====
     
    141141Next, we have to configure JK to mount the actual GSCF instance on the worker. Assuming it's running on <server url>:<tomcat port>/gscf-0.4.0 here:
    142142
    143 <pre>
     143{{{
    144144LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
    145145
     
    165165#JkMount  /gscf-0.4.0/* gscf
    166166#JkMount  /gscf-0.4.0 gscf
    167 </pre>
     167}}}
    168168
    169169===== Set up virtual host =====
     
    173173
    174174So we create a file /sites-available/dbnp.org_example.conf:
    175 <pre>
     175{{{
    176176<VirtualHost *:80>
    177177        ServerName example.dbnp.org
     
    208208
    209209</VirtualHost>
    210 </pre>
     210}}}
    211211
    212212Then, we create a link to the file in /sites-enabled:
    213 <pre>
     213{{{
    214214kees@server:/etc/apache2/sites-enabled$ sudo ln ../sites-available/dbnp.org_example.conf
    215 </pre>
     215}}}
    216216
    217217This will create a link to the configuration file we just created with the same name in the current directory, which should be sites-enabled. You can check this with ls -al.