2 Replies Latest reply on Mar 19, 2009 5:55 AM by boercher

    deployment problem with additional hibernate classes

      Hi,

      with jbpm-3.2.6.SP1, JBoss AS 4.2.3.GA I got a simple process working in a unit test and on the application server where it can be examined in the jbpm-console.

      Problems arise however as soon as I try to use my own hibernate classes with the jbpm hibernate session like this:

       Session session = context.getJbpmContext().getSession();
       UrlLock lock = new UrlLock(url.toString(), this, new Date());
       session.save(lock);
      


      After adding an appropriate hibernate mapping to a local hibernate.extra.hbm.xml this works in my unit tests (run from within Eclipse) but it's not working on the server since when the process gets to this line an exception is thrown:


      Error signalling token: An exception of type "org.jbpm.graph.def.DelegationException" was thrown. The message is: Unknown entity: testprocess.UrlLock


      I tried the following fixes:

      1) add hibernate.extra.hbm.xml to the deployed par archive: Did not work since it is obviously ignored by hibernate.

      2) copy hibernate.extra.hbm.xml to jbpm/jbpm-service.sar/ in the JBoss deploy directory: Results in the following error:


      DEBUG [javax.enterprise.resource.webcontainer.jsf.renderkit] Value to be rendered Error loading process list
      DEBUG [javax.enterprise.resource.webcontainer.jsf.renderkit] component.getValue() returned : An exception of type "org.hibernate.InvalidMappingException" was thrown. The message is: Could not parse mapping document from resource hibernate.extra.hbm.xml


      Unfortunately there are no more detailed logs from the renderkit. I do not believe that it's a simple parse error since the same hibernate.extra.hbm.xml did work in the unit test.

      Might this error occur due to the fact that hibernate has no access to the UrlLock.class file (although the table jbpm_bytearray contains an entry classes/testprocess/UrlLock.class)? What is the best approach for using additional hibernate classes from within a process?

      Any advice is appreciated.

      Regards
      Volker

        • 1. Re: deployment problem with additional hibernate classes
          kukeltje

          1: it is not ignored by hibernate, hibernate can not look into the process classloader afaik
          2: Correct, access is the problem.

          A (not specifically the best) solution is to use the war for this if versioninig of this UrlLock class is not needed.

          • 2. Re: deployment problem with additional hibernate classes

             

            "kukeltje" wrote:
            1: it is not ignored by hibernate, hibernate can not look into the process classloader afaik
            2: Correct, access is the problem.

            A (not specifically the best) solution is to use the war for this if versioninig of this UrlLock class is not needed.


            Ouch! a classloader issue. That kind of problems stole a lot of my time in my recent eclipse plugin project :-( I could imagine that this is especially hard to solve if I configure jBPM to access hibernate via a datasource. Otherwise jBPM might have the chance to adjust the SessionFactory (found http://opensource.atlassian.com/projects/hibernate/browse/HHH-3603 and http://forum.hibernate.org/viewtopic.php?p=2403881 dealing with related problems).

            Not to version the entities might be possible (have to check this) although this would be the only "hole" in the process versioning.

            Either way it might be worth mentioning this issue in the userguide.

            Thanks!