4 Replies Latest reply on Dec 22, 2005 1:39 PM by aguizar

    JBPM randomly goes catatonic

    michaelholtzman

      Greetings. I have built a java app that invokes JBPM and communicates with our core application. I have also deployed a "real-world" prototype process definition. All is working pretty much as expected, except ... every so often JBPM stops responding. This happens in various places, but most often when calling processInstance.signal() or loadProcessInstance(). If I bring down the app, restart it, and attempt the same jbpm operation it will work correctly.

      When this happens, the JVM becomes totally unresponsive, and attempting to call any other JBPM methods results in a JVM crash.

      JBPM is hooked up to an Oracle database, which passes all the tests in jbpm-db.

      Any ideas on what might be causing this? I have already upped the heap and stack allocations. I get the same behavior with 1.4 and 1.5 jvms.

      Thanx.

        • 1. Re: JBPM randomly goes catatonic
          koen.aers

          Not sure, but I have the impression that this could be a locking issue. Do you lock your process instances somewhere?

          Regards,
          Koen

          • 2. Re: JBPM randomly goes catatonic
            michaelholtzman

            No, I don't lock the process instance. (Should I ?)

            Could anyone summarize (1) when I would need to lock a process instance and (2) when I should be saving a process instance to the datbase?

            Thanx.

            • 3. Re: JBPM randomly goes catatonic
              michaelholtzman

              Solved. My application communicates with JBPM via Rendezvous (Tibco) messages. I was incorrectly passing a JNI environment pointer (JNIEnv*) through the callback to the listening thread. You need to maintain or create a pointer to the JVM, and allocate a new JNIENV pointer in each thread.

              Who knew?

              Creating a new JNIEnv pointer in the listening thread eliminated my random JVM hangups.

              • 4. Re: JBPM randomly goes catatonic
                aguizar

                 

                who knew?
                Nobody, because you didn't mention it earlier ;-)

                Back when I was in college I programmed a neural network in C++ with a Java front-end. Every n cycles the processing code would pause and notify the front end of its progress. And also at random the program freezed with no apparent reason. It turned out that the first few lines of native code I wrote and later forgot about, mistakenly kept local references to classes.

                Oh, subtle, mysterious world of native programming.