My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GrailsProjectPlugin  
Grails 400 Utils as a Standard Grails Plugin.
Updated Dec 11, 2010 by dondenon...@gmail.com

Introduction

This page details how to install and use the Grails 400 Utilities via a standard Grails plugin.

Details

Steps to create a Grails project and generate Grails domain classes from System i files

  • Note: These directions assumes Grails has already been installed and configured to your PC
  • From DOS:
    • Change to a working directory to which a Grails project will be created
      • > cd \grailswork
    • Create a grails project
      • > grails create-app yourprojname
    • Change the directory to the newly generated Grails project
      • > cd \grailswork\yourprojname
    • Install the System i Grails Domain Tool plugin
    • Use the plugin to reverse-engineer a 400 file into a Grails domain
      • > grails build-systemi-grails-domain
        • this will prompt for ip, user, password, library, file, and domainName
        • optionally, you could type the arguments in the command string space delimited:
          • > grails build-systemi-grails-domain 172.16.1.4 denoncourt secret mylib custmast Customer
      • If you get a stack trace, run the following and it should work on a second try:
        • > grails clean
          • I'm not sure why this happens but it should be fixed in a subsequent release
      • You will get a message "be sure to modify grails-app/conf/DataSource.groovy to specify your System i settings" and then list the code such as (but with your info):
      • dataSource {
            pooled = true
            url = "jdbc:as400://yourip/yourlib"
            driverClassName = "com.ibm.as400.access.AS400JDBCDriver"
            username = "yourusername"
            password = "yourpassword"
            dialect = org.hibernate.dialect.DB2400Dialect.class
        }
        • paste/replace that dataSource code over the dataSource specified within the development section, you should see the following in your DataSource.groovy file:
        • development {
              dataSource {
                  dbCreate = "create-drop" // one of 'create', 'create-drop','update'
                  url = "jdbc:hsqldb:mem:devDB"
              }
          }
    • Use the Grails utility to generate the controller and views
      • > grails generate-systemi-all yourGrailsDomainName
        • Note: to handle legacy data, the System i Grails Domain generator also replaced the default Grails controller and page view templates.
        • Note: the standard generate-all and generate-controller tasks may not behave properly after installing this plugin. But the code generated by these tools does not work with legacy systemi tables/domain objects anyway.
    • Test your application
      • > grails run-app
Comment by francesc...@gmail.com, Dec 17, 2008

I have tried the GrailsProjectPlugin to generate a CRUD for a generic entity stored in System i.

I have two problem.

In edit view of a record the field are empty.

When I try to create a new record i receive two type of error:

Failed to convert property value of type [java.lang.String] to required type boolean? for property newEntity; nested exception is java.lang.IllegalArgumentException?: Invalid boolean value Failed to convert property value of type [java.lang.String] to required type int? for property ts2nums2; nested exception is java.lang.IllegalArgumentException?: Cannot convert value of type [java.lang.String] to required type int? for property ts2nums2: PropertyEditor? [org.springframework.beans.propertyeditors.CustomNumberEditor?] returned inappropriate value

Where ts2nums2 is the field name.

Any issue?

Thank's in advance.

Comment by project member dondenon...@gmail.com, Aug 8, 2009

Version 0.4 resolved this issue.

Comment by solajo...@gmail.com, Apr 24, 2010

Cannot make this application to work. Do I need to install the JT400 classes? I am seeing a lot of messages regarding the JDBD Driver for AS/400.

Thanks

Comment by sante_ma...@yahoo.it, Jul 15, 2010

I've tried to follow these steps, but when building systemi domain I get this message "Welcome to Grails 1.3.3 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\GRAILS\grails-1.3.3

Base Directory: C:\challenge Resolving dependencies... Dependencies resolved in 1125ms. Running script C:\Documents and Settings\campagne\.grails\1.3.3\projects\challenge\plugins\systemitools-0.5\scripts\BuildSystemiGrailsDomain?.groovy Error executing script BuildSystemiGrailsDomain?: startup failed: BuildSystemiGrailsDomain?: 3: unable to resolve class com.cassevern.grails.util.Build400GrailsDomain?

@ line 3, column 1.
1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException?: startup failed: BuildSystemiGrailsDomain?: 3: unable to resolve class com.cassevern.grails.util.Build400GrailsDomain?

@ line 3, column 1.
1 error

at org.codehaus.groovy.control.ErrorCollector?.failIfErrors(ErrorCollector?.java:296) at org.codehaus.groovy.control.CompilationUnit?.applyToSourceUnits(CompilationUnit?.java:828) at org.codehaus.groovy.control.CompilationUnit?.doPhaseOperation(CompilationUnit?.java:511) at org.codehaus.groovy.control.CompilationUnit?.processPhaseOperations(CompilationUnit?.java:487) at org.codehaus.groovy.control.CompilationUnit?.compile(CompilationUnit?.java:464) at org.codehaus.groovy.control.CompilationUnit?.compile(CompilationUnit?.java:448) at gant.Gant.compileScript(Gant.groovy:635) at gant.Gant.this$2$compileScript(Gant.groovy) at gant.Gant$closure1.doCall(Gant.groovy:129) at gant.Gant$closure1.call(Gant.groovy) at gant.Gant.loadScript(Gant.groovy:266) at gant.Gant$loadScript.callCurrent(Unknown Source) at gant.Gant.loadScript(Gant.groovy:248)

Error executing script BuildSystemiGrailsDomain?: startup failed: BuildSystemiGrailsDomain?: 3: unable to resolve class com.cassevern.grails.util.Build400GrailsDomain?

@ line 3, column 1.
1 error "" which ends with an error, so I can't go on. Thanks

Comment by sante_ma...@yahoo.it, Jul 16, 2010

Problem solved using version 0.8 of systemitools

Comment by sante_ma...@yahoo.it, Jul 16, 2010

Going on, I now get the following messagge "Welcome to Grails 1.3.3 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\GRAILS\grails-1.3.3

Base Directory: C:\challenge Resolving dependencies... Dependencies resolved in 1219ms. Running script C:\Documents and Settings\campagne\.grails\1.3.3\projects\challenge\plugins\systemitools-0.8\scripts\GenerateSystemiAll?.groovy Environment set to development

groovyc? Compiling 1 source file to C:\challenge\target\classes
name: Inevastest
groovyc? Compiling 1 source file to C:\challenge\target\classes
Cannot create JDBC driver of class 'com.ibm.as400.access.AS400JDBCDriver' for connect URL 'dbc:as400://10.10.2.203/leva' java.sql.SQLException: No suitable driver etc.etc" when executing generating-systemi-all. Is there anybody helping to solve this new problem?

Comment by ale.mich...@gmail.com, Aug 26, 2010

Hi, i'm getting the same error as sante_ma... ,: Cannot create JDBC driver of class 'com.ibm.as400.access.AS400JDBCDriver' for co nnect URL 'jdbc:hsqldb:mem:devDB' java.sql.SQLException: No suitable driver

Could it be something related to the JDK or JSE installed?


Sign in to add a comment
Powered by Google Project Hosting