Spring Roo
  1. Spring Roo
  2. ROO-1545

Using Hibernate on JBoss cause problems and does not work out-of-the-box

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M3
    • Fix Version/s: 1.1.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      jboss-6.0.0.20100911-M5

      Description

      Issue is related to well know classlading JBoss problem. JBoss distribution contains Hibernate jars which are older then one used by Spring Roo-generated application.

      While using hibernate as provider adding these two properties in persistence.xml:

            <property name="hibernate.validator.apply_to_ddl" value="false"/>
            <property name="hibernate.validator.autoregister_listeners" value="false"/>
      

      solves problem.

      Solution from here.

      For google and anyone who does not want to waste time on JBoss classloading settings (which does not really work):

      Caused by: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>
      

        Activity

        Hide
        Alan Stewart added a comment -

        These properties only apply to JBoss. Since we can't detect what server the app is running on, what are the implications for having these properties on permanently? This may be better documented as a work around rather than changing the code.

        Show
        Alan Stewart added a comment - These properties only apply to JBoss. Since we can't detect what server the app is running on, what are the implications for having these properties on permanently? This may be better documented as a work around rather than changing the code.
        Hide
        Hamster added a comment -

        You are right Alan.

        Those settings are even not recommended.

        At least worth to be registered in JIRA so people can use this solution if run into same kind of troubles. Can you close this one as Known Issue?

        Show
        Hamster added a comment - You are right Alan. Those settings are even not recommended . At least worth to be registered in JIRA so people can use this solution if run into same kind of troubles. Can you close this one as Known Issue?
        Hide
        Alan Stewart added a comment -

        I added the properties as comments in the persistence.xml with a comment preceding to instruct users of JBoss to uncomment the lines. I think this is a good compromise

        Show
        Alan Stewart added a comment - I added the properties as comments in the persistence.xml with a comment preceding to instruct users of JBoss to uncomment the lines. I think this is a good compromise

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Hamster
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: