Search code examples
springjsfspring-securityspring-roo

Unable to setup Spring Security with JSF in Spring Roo


I'm using the script command in spring roo to create an application I'm working on.

This is the roo script I'm using.

    project --topLevelPackage is.kdh.cyberdojo --projectName cyberdojo --java 6 --packaging WAR
    jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY

    entity jpa --class ~.domain.Attendance --testAutomatically --table ATTENDANCE
    field date --fieldName attended --type java.util.Date --notNull --column ATTENDED

    entity jpa --class ~.domain.BarCode --testAutomatically --table BARCODE

    entity jpa --class ~.domain.Person --testAutomatically --table PERSON
    field string --fieldName socialSecurityNumber --sizeMax 10 --notNull --column SOCIAL_SECURITY_NUMBER --unique true
    field string --fieldName name --sizeMax 128 --notNull --column NAME
    field string --fieldName address --sizeMax 128 --notNull --column ADDRESS
    field string --fieldName city --sizeMax 128 --notNull --column CITY
    field string --fieldName phone --sizeMax 128 --notNull --column PHONE
    field string --fieldName mobile --sizeMax 24 --notNull --column MOBILE
    field string --fieldName email --sizeMax 128 --notNull --column EMAIL
    field date --fieldName created --type java.util.Date --notNull --column CREATED
    field date --fieldName modified --type java.util.Date --notNull --column MODIFIED
    field boolean --fieldName active --column ACTIVE --notNull --value true
    field string --fieldName registrationNumber --column REGISTRATION_NUMBER --notNull --sizeMax 10
    field string --fieldName comments --column COMMENTS --sizeMax 4096
    field reference --fieldName parent --type is.kdh.cyberdojo.domain.Person --cardinality MANY_TO_ONE
    field reference --fieldName barCode --type is.kdh.cyberdojo.domain.BarCode --cardinality ONE_TO_ONE

    entity jpa --class ~.domain.Course --testAutomatically --table COURSE
    field string --fieldName name --sizeMax 128 --notNull --column NAME
    field string --fieldName description --sizeMax 2048 --notNull --column DESCRIPTION
    field boolean --fieldName active --notNull --column ACTIVE
    field date --fieldName validFrom --type java.util.Date --notNull --column VALID_FROM
    field date --fieldName validTo --type java.util.Date --notNull --column VALID_TO
    field number --fieldName occurrence --type int --notNull --column OCCURRENCE
    field set --fieldName instructors --type is.kdh.cyberdojo.domain.Person

    entity jpa --class ~.domain.UserType --testAutomatically --table USERTYPE
    field string --fieldName name --sizeMax 128 --notNull --column NAME

    test integration
    perform tests

    web jsf setup --implementation APACHE_MYFACES --theme  EGGPLANT
    web jsf all --package ~.jsf

    logging setup --level WARN --package WEB
    perform eclipse
    security setup
    quit

Everything is fine until I get to the security setup command - then the scripts execution is aborted.

The message roo prints out is

    Command 'security setup' was found but is not currently available (type 'help' then ENTER to learn about this command)

I know that its possible to use spring security and jsf together. Is there anything wrong with the way I'm setting up my roo script?

BTW: If I use mvc instead of jsf then spring security is setup nicely and everything works fine.


Solution

  • The problem is discussed here. The fix you're referring to consisted in just disabling the security command for JSF and GWT plugin. We have to wait until 1.3.0. :(