Announcement Announcement Module
Collapse
No announcement yet.
Upgraded from 1.3.7 to 2.0 and can no longer run application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgraded from 1.3.7 to 2.0 and can no longer run application

    Hi All,
    I have an application that i just upgraded to 2.0 and it does not run any more.

    I get the following trace at the interactive prompt on doing a clean then a run-app


    ~/projects/lc $ grails
    | Enter a script name to run. Use TAB for completion:
    grails> clean
    | Application cleaned.
    grails> run-app
    | Compiling 88 source files
    Note: /home/deuseks/.grails/2.0.0/projects/lc/plugins/ui-performance-1.2.2/src/java/com/studentsonly/grails/plugins/uiperformance/CacheFilter.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    | Running Grails application
    | Error 2011-12-25 00:33:57,694 [Thread-8] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomain Exception: Error evaluating ORM mappings block for domain [com.lc.domain.ShiroPermission]: No such property: org for class: org.codehaus.groovy.grails.orm.hibernate.cfg.Hiber nateMappingBuilder
    Possible solutions: LOG
    Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomain Exception: Error evaluating ORM mappings block for domain [com.lc.domain.ShiroPermission]: No such property: org for class: org.codehaus.groovy.grails.orm.hibernate.cfg.Hiber nateMappingBuilder
    Possible solutions: LOG
    Line | Method
    ->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    | 166 | run in java.util.concurrent.FutureTask
    | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
    | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
    ^ 636 | run . . . in java.lang.Thread

    Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomain Exception: Error evaluating ORM mappings block for domain [com.lc.domain.ShiroPermission]: No such property: org for class: org.codehaus.groovy.grails.orm.hibernate.cfg.Hiber nateMappingBuilder
    Possible solutions: LOG
    ->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    | 166 | run in java.util.concurrent.FutureTask
    | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
    | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
    ^ 636 | run . . . in java.lang.Thread

    Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsDomain Exception: Error evaluating ORM mappings block for domain [com.lc.domain.ShiroPermission]: No such property: org for class: org.codehaus.groovy.grails.orm.hibernate.cfg.Hiber nateMappingBuilder
    Possible solutions: LOG
    ->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    | 166 | run in java.util.concurrent.FutureTask
    | 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
    | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
    ^ 636 | run . . . in java.lang.Thread


    I did make the following changes

    1. I have a Base.groovy class that holds stuff like the version, id, dateCreated... etc.. and every single domain class inherits from this. I moved it out to the groovy folder as the release notes indicate.

    2. Compilation seems to work fine. The errors ou see only occur on running the application.


    The culprit property seems to be a hoax - I have no property in any domain class called 'org'
    But I do have a

    def org = new Organization..... in my bootstrap.groovy. I instantiate and save one of my domain classes called Organization. Nothing odd there.. the bootstrap always worked fine.


    Any clues as to why this could be happening ?

    thanks

    Deus

  • #2
    Update - Still cannot do run-app on upgraded 1.3.7 project from 2.0

    UPDATE ---

    Ok. Got a little further and hopefully this is a simpler issue.
    I got past the issue above as follows.

    I had the JodaTime plugin installed but when I installed it....it created some entries in the Config.groovy file. The plugin was uninstalled but these entries were not removed. This, i think..was the cause of the exceptions you see above.So I deleted those entries created by JodaTime. However, this created new problems. The application now compiles but the bootstrap does not seem to see the import for all domain classes in my grails-app/domain folder.

    my package name is com.lc.domain.*


    here is the exception:
    ----------------------
    ~/projects/lc $ grails run-app
    | Compiling 88 source files
    Note: /home/deus/.grails/2.0.0/projects/lc/plugins/ui-performance-1.2.2/src/java/com/studentsonly/grails/plugins/uiperformance/CacheFilter.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    | Running Grails application
    ------------------------------DEVELOPMENT MODE SETTING -----------------------------
    -> Bootstrap running now......
    -----------------------doing txn purposes ---------------
    | Error 2011-12-26 23:10:15,148 [Thread-9] ERROR context.GrailsContextLoader - Error executing bootstraps: Unknown entity: com.lc.domain.TransactionPurpose; nested exception is org.hibernate.MappingException: Unknown entity: com.lc.domain.TransactionPurpose
    Message: Unknown entity: com.lc.domain.TransactionPurpose; nested exception is org.hibernate.MappingException: Unknown entity: com.lc.domain.TransactionPurpose
    Line | Method
    ->> 27 | doCall in BootStrap$_closure1
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    | 290 | evaluateEnvironmentSpecificBlock in grails.util.Environment
    | 283 | executeForEnvironment . . . . . in ''
    | 259 | executeForCurrentEnvironment in ''
    | 334 | innerRun . . . . . . . . . . . . in java.util.concurrent.FutureTask$Sync
    | 166 | run in java.util.concurrent.FutureTask
    | 1110 | runWorker . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
    | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
    ^ 636 | run . . . . . . . . . . . . . . in java.lang.Thread

    Caused by MappingException: Unknown entity: com.lc.domain.TransactionPurpose
    ->> 27 | doCall in BootStrap$_closure1
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    | 290 | evaluateEnvironmentSpecificBlock in grails.util.Environment
    | 283 | executeForEnvironment . . . . . in ''
    | 259 | executeForCurrentEnvironment in ''
    | 334 | innerRun . . . . . . . . . . . . in java.util.concurrent.FutureTask$Sync
    | 166 | run in java.util.concurrent.FutureTask
    | 1110 | runWorker . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
    | 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
    ^ 636 | run . . . . . . . . . . . . . . in java.lang.Thread


    -------------------------

    ...and here is the bootstrap class... (partial.. it is large.. just showing the section with the error )

    --------------

    import grails.util.Environment
    import org.apache.commons.lang.RandomStringUtils
    import com.lc.domain.Base
    import com.lc.domain.*
    import org.apache.shiro.crypto.hash.Sha512Hash
    import java.util.GregorianCalendar
    import com.eventmanager.domain.Event
    import org.codehaus.groovy.grails.commons.ApplicationHold er

    class BootStrap {

    def init = { servletContext ->


    switch(Environment.current) {
    case Environment.DEVELOPMENT:

    println "------------------------------DEVELOPMENT MODE SETTING -----------------------------"
    println " -> Bootstrap running now......"
    //today's date
    def today = new Date()


    println "-----------------------doing txn purposes ---------------"
    //default values

    /* the line below is throwing an exception. NOt sure why it is not visible to a running bootstrap */
    def txnpurposes = new TransactionPurpose(description:"Opening Tuition Payment").save()
    txnpurposes = new TransactionPurpose(description:"Closing Tuition Payment").save()
    txnpurposes = new TransactionPurpose(description:"Account Adjustment Transaction").save()
    txnpurposes = new TransactionPurpose(description:"Total Amount Payment / Adjustment").save()
    txnpurposes = new TransactionPurpose(description:"Refund Setup Transaction").save()
    txnpurposes = new TransactionPurpose(description:"Funds Disbursement").save()
    txnpurposes = new TransactionPurpose(description:"Purchase Debit Transaction").save()
    txnpurposes = new TransactionPurpose(description:"Purchase Credit Transaction").save()




    //admin. god power
    def role = new ShiroRole(name:"Administrator")
    role.addToPermissions("*:*")
    role.save()

    ..... continues...

    and of course here is the TransactionPurpose class. It compiles

    ---------------------------------------

    package com.lc.domain
    import org.apache.commons.lang.RandomStringUtils
    import com.lc.domain.Base
    class TransactionPurpose extends Base {

    String description = "None"

    static constraints = {
    description(blank:false, nullable:false,widget:'textarea')
    }

    static mapping = {
    table 'transaction_purposes'
    cache true
    description type:'text'
    }

    String toString()
    {
    return "${description} : ${id}"
    }
    }

    ---------------------------------------

    WHY is this class compiling but not visible to the import statements in the Bootstrap ?

    thanks

    Comment

    Working...
    X