0 Replies Latest reply on Jul 27, 2006 5:47 AM by Daniel Sonic

    hibernate.queries.hbm.xml

    Daniel Sonic Newbie

      Hi,

      want to use the persistance of jBPM, but i get this error:

      10:57:17,796 [main] INFO Configuration : Configured SessionFactory: null
      10:57:17,796 [main] INFO Configuration : Reading mappings from resource: hibernate.queries.hbm.xml
      10:57:17,843 [main] DEBUG JbpmContext : closing JbpmContext
      Exception in thread "main" org.hibernate.MappingException: Could not read mappings from resource: hibernate.queries.hbm.xml
      at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.getConfiguration(DbPersistenceServiceFactory.java:71)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSchemaExport(DbPersistenceServiceFactory.java:79)
      at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:110)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:383)
      at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:375)
      at de.fhkl.bda.Test001.main(Test001.java:27)
      Caused by: org.hibernate.DuplicateMappingException: Duplicate query mapping GraphSession.findLatestProcessDefinitionQuery
      at org.hibernate.cfg.Mappings.checkQueryExist(Mappings.java:270)
      at org.hibernate.cfg.Mappings.addQuery(Mappings.java:259)
      at org.hibernate.cfg.HbmBinder.bindNamedQuery(HbmBinder.java:2555)
      at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:180)
      at org.hibernate.cfg.Configuration.add(Configuration.java:386)
      at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
      at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
      ... 6 more


      I had to manually update the config file and to insert a linkt to the hibernate.query-file


      what goes wrong ? i have absolutely no idea, i am on to this problem for now abot 10hours and i cant find any solution :/

      the file exists, is be found (without the file there comes a file not found excepption) but the content cant be read ?

      Thats my code:

      import java.util.ArrayList;
      import java.util.List;
      
      import org.jbpm.JbpmConfiguration;
      import org.jbpm.JbpmContext;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ProcessInstance;
      
      
      import org.jbpm.JbpmConfiguration;
      import org.jbpm.JbpmContext;
      import org.jbpm.db.GraphSession;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ProcessInstance;
      import org.jbpm.graph.exe.Token;
      
      
      
      public class Test001 {
       /**
       * @param args
       */
       public static void main(String[] args) {
       JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       jbpmConfiguration.createSchema();
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       try {
       ProcessInstance processInstance =
       jbpmContext.newProcessInstanceForUpdate("SimpleDefinition1");
       } finally {
       jbpmContext.close();
       }
       }
      }