4 Replies Latest reply on May 16, 2006 8:11 AM by Ronald van Kuijk

    hibernate mapping Exception

    ajeet phadnis Newbie

      I am running jBPM 3.1, MySql 5.0 startup kit.
      Everyings is fine and all the examples run as they should.
      I have used the PayRaise example and am trying to persist it on the db.
      However i get this error :

      org.hibernate.MappingException: Could not determine type for: string_max, for columns: [org.hibernate.mapping.Column(MESSAGE_)]
      at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
      at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:137)
      at org.hibernate.mapping.Column.getSqlType(Column.java:181)
      at org.hibernate.mapping.Table.sqlCreateString(Table.java:349)
      at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:738)
      at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:97)
      at org.hibernate.tool.hbm2ddl.SchemaExport.(SchemaExport.java:64)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSchemaExport(DbPersistenceServiceFactory.java:76)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:107)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:404)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:396)
      at com.pay.pay_dbTest.setUp(pay_dbTest.java:66)
      at junit.framework.TestCase.runBare(TestCase.java:125)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)




      i highly appreciate your help.

      Ajeet

        • 1. Re: hibernate mapping Exception
          Ronald van Kuijk Master

          hmmm.. I've seen this problem on CVS head when you update your classes and hibernate mappings without updating your hibernate.cfg.xml.

          Are you sure you are using 3.1?

          • 2. Re: hibernate mapping Exception
            ajeet phadnis Newbie

            Hi Ronald,
            Yes ! I have checked that it is jBPM 3.1.
            I will try to look at hibernate.cfg.xml and see
            if I could make out any thing.
            Thanks for your reply and continued help.

            Ajeet

            • 3. Re: hibernate mapping Exception
              ajeet phadnis Newbie

              Hi Ronald,
              Now I have added the line -

              to the hibernate.cfg.xml
              and I get exception :

              org.hibernate.MappingException: Resource: org/jbpm/context/exe/variableinstance/StringMax.hbm.xml not found
              at org.hibernate.cfg.Configuration.addResource(Configuration.java:478)
              at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443)
              at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411)
              at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392)
              at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368)
              at org.hibernate.cfg.Configuration.configure(Configuration.java:1288)
              at org.jbpm.db.hibernate.HibernateHelper.createConfiguration(HibernateHelper.java:90)
              at org.jbpm.persistence.db.DbPersistenceServiceFactory.getConfiguration(DbPersistenceServiceFactory.java:68)
              at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSchemaExport(DbPersistenceServiceFactory.java:76)
              at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:107)
              at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:404)
              at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:396)
              at com.pay.pay_dbTest.setUp(pay_dbTest.java:66)
              at junit.framework.TestCase.runBare(TestCase.java:125)
              at junit.framework.TestResult$1.protect(TestResult.java:106)
              at junit.framework.TestResult.runProtected(TestResult.java:124)
              at junit.framework.TestResult.run(TestResult.java:109)
              at junit.framework.TestCase.run(TestCase.java:118)
              at junit.framework.TestSuite.runTest(TestSuite.java:208)
              at junit.framework.TestSuite.run(TestSuite.java:203)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)



              The actual file is at : jBPM_HOME\build\classes.jbpm\org\jbpm\context\exe\variableinstance

              Do you know where this file should be located ??

              Thanks in advance for help.

              Ajeet

              • 4. Re: hibernate mapping Exception
                Ronald van Kuijk Master

                don't try to add one thing at a time from a newer config to your specific one. Do it the other way around. Add your changes to the new hibernate file and use that from now on. Worked in 5 minutes for me.