Results 1 to 4 of 4

Thread: Spring Roo 1.2.0.RELEASE: dao style access doesn't work (--activeRecord false)

  1. #1
    Join Date
    Dec 2011
    Posts
    11

    Default Spring Roo 1.2.0.RELEASE: dao style access doesn't work (--activeRecord false)

    I wanted to try the new feature
    Code:
    --activeRecord false
    of Spring Roo 1.2.0.RELEASE.

    Code:
    roo> project --topLevelPackage org.obliquid.jsf1 --java 6 
    roo> jpa setup --database H2_IN_MEMORY --provider HIBERNATE 
    roo> entity --class ~.domain.Task --activeRecord false
    I don't have the needed add on:

    Code:
    Command 'entity --class ~.domain.Task --activeRecord false' not found (for assistance press TAB or type "hint" then hit ENTER)
    Located add-on that may offer this command
    1 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
    ID T R DESCRIPTION -------------------------------------------------------------
    01 Y Y 1.2.0.M1 Support for the creation and management of domain entities.
    --------------------------------------------------------------------------------
    [HINT] use 'addon info id --searchResultId ..' to see details about a search result
    [HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
    [HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
    I check the available add on and notice that there isn't a 1.2.0.RELEASE yet:

    Code:
    roo> addon info id --searchResultId 01
    Name.........: Spring Roo - Addon - Entity
    BSN..........: org.springframework.roo.addon.entity
    Version......: 1.2.0.M1 [available versions: 1.1.1.RELEASE, 1.1.2.RELEASE,
                   1.1.3.RELEASE, 1.1.4.RELEASE, 1.1.5.RELEASE, 1.2.0.M1]
    Roo Version..: 1.2
    [...]
    I try anyway:

    Code:
    roo> addon install id --searchResultId 01
    but this is what I get:

    Code:
    [org.springframework.roo.shell.osgi [57]] [org.springframework.roo.shell.osgi.SimpleParserComponent] The bindCommand method has thrown an exception
    java.lang.IllegalArgumentException: Cannot specify an availability indicator for 'embeddable' more than once
        at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65)                              
        at org.springframework.roo.shell.SimpleParser.add(SimpleParser.java:1044) 
    [...]
                         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.EntityMetadataProviderImpl] The activate method has thrown an exception                
    java.lang.NoSuchFieldError: ROO_ENTITY
        at org.springframework.roo.addon.entity.EntityMetadataProviderImpl.activate(EntityMetadataProviderImpl.java:68)                                                 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                                               
    [...]
                         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.EntityMetadataProviderImpl] Component instance could not be created, activation failed 
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl] Error during instantiation of the implementation object 
    org.apache.felix.log.LogException: java.lang.NoClassDefFoundError: org/springframework/roo/classpath/customdata/PersistenceCustomDataKeys                                
        at org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl.<clinit>(JpaEntityMetadataProviderImpl.java:68)                                                
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)                  
    [...]
                         
    Caused by: java.lang.ClassNotFoundException: org.springframework.roo.classpath.customdata.PersistenceCustomDataKeys not found by org.springframework.roo.classpath [43]  
        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:812)
        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72) 
    [...]
         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl] Component instance could not be created, activation failed                                                                                                                                                                       
    Target resource(s):                                                                                                                                                      
    -------------------                                                                                                                                                      
       Spring Roo - Addon - Entity (1.2.0.M1)                                                                                                                                
                                                                                                                                                                             
    Deploying...done.                                                                                                                                                        
                                                                                                                                                                             
    Successfully installed add-on: Spring Roo - Addon - Entity [version: 1.2.0.M1]
    Note the "Successfully installed". After that, nothing works anymore, whenever I open roo, I get an exception on startup, and when I try to create a new project, it just hangs forever. I'll have to reinstall roo and be careful not to add this addon. Here is what I get:

    Code:
    [org.springframework.roo.shell.osgi [57]] [org.springframework.roo.shell.osgi.SimpleParserComponent] The bindCommand method has thrown an exception
    java.lang.IllegalArgumentException: Cannot specify an availability indicator for 'embeddable' more than once                                                             
        at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65)                               
        at org.springframework.roo.shell.SimpleParser.add(SimpleParser.java:1044)                                  
        at org.springframework.roo.shell.osgi.SimpleParserComponent.bindCommand(SimpleParserComponent.java:87)
                         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.EntityMetadataProviderImpl] The activate method has thrown an exception                 
    java.lang.NoSuchFieldError: ROO_ENTITY                                                                                                                                   
        at org.springframework.roo.addon.entity.EntityMetadataProviderImpl.activate(EntityMetadataProviderImpl.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                       
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)                                                                                     
    [...]
                         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.EntityMetadataProviderImpl] Component instance could not be created, activation failed 
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl] Error during instantiation of the implementation object 
        org.apache.felix.log.LogException: java.lang.NoClassDefFoundError: org/springframework/roo/classpath/customdata/PersistenceCustomDataKeys                                
        at org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl.<clinit>(JpaEntityMetadataProviderImpl.java:68)                                                
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)                                                                                             
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)                                                                      
    [...]
                         
    Caused by: java.lang.ClassNotFoundException: org.springframework.roo.classpath.customdata.PersistenceCustomDataKeys not found by org.springframework.roo.classpath [43]  
        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:812)                                                                        
        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)                                                                                              
        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)                                                                           
    [...]
         
    [org.springframework.roo.addon.entity [72]] [org.springframework.roo.addon.entity.JpaEntityMetadataProviderImpl] Component instance could not be created, activation failed
    I guess that all this means that the DAO access is not ready for prime time and I've to wait for 1.2.0.RELEASE of the add on. Am I the only one hitting this? Hints? Workarounds? Thanks!

  2. #2
    Join Date
    Dec 2005
    Posts
    930

    Default

    You are using the wrong command, "entity", hence the prompt to install a new add-on.

    The command is "entity jpa". You woul have seen this if you had pressed TAB after entity
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Dec 2011
    Posts
    11

    Default

    Thank you Alan, that does the trick. Next time I will make sure to try TAB before posting. I got confused because this syntax changed since 1.1.

  4. #4
    Join Date
    Dec 2011
    Posts
    11

    Default

    In New application layering and persistence choices in Spring Roo 1.2 blog post from Stefan Schmidt Pizza example, there is the same mistake. It's where I got it from originally... if he's reading the forums, it would be nice to fix it in his blog.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •