6 Replies Latest reply on Sep 2, 2005 5:12 AM by James Depoorter

    Adding a webapp to the starter's kit

    Kevin Galligan Newbie

      Hey. I "solved" my own problem. I gradually reduced all outside vars by doing the following:

      - Took out all filters but the ones for jbpm in my webapp. Still bombed
      - Created a new webapp with the jar from the jbpm.war ("jbpm-webapp-3.0.jar"). Made 1 jsp with those filters. That worked
      - Added the jar to my webapp, and switched my filters to those classes. Still bombed
      - Finally deleted the files in...
      - 'server\jbpm\tmp\deploy'
      - 'server\jbpm\work\jboss.web\localhost'
      - Restarted after that, and my webapp worked fine.

      I have no idea what was being kept in those dirs, but my webapp wars were be updated, so something was being kept around. Just wanted to post this in case anybody else ran into similar trouble.

        • 1. Re: Adding a webapp to the starter's kit
          Kevin Galligan Newbie

          Ok, scratch that. Still don't know what's wrong. Still think it didn't work till after I deleted the temp dir, but upon repeated testing, I can switch the problem on/off in a running instance.

          Now, the problem. I'm assuming jboss must be using the same connection under the hood, even though I have different services set up for database connections. Basically, the jbpm system is being committed, then the hibernate for my app is being committed. This is where things are bombing. If I take out the code that creates a transaction in app, jbpm works fine. As soon as commit gets called in my code, things bomb.

          More digging, poking and proding.

          Now, obviously, I should somehow configure 1 hibernate session to include my code and the jbpm stuff, which would allow a single session. On second thought, that might not even be a great plan. However, I'm now curious as to why this is bombing, and fell compelled to continue...

          • 2. Re: Adding a webapp to the starter's kit
            Kevin Galligan Newbie

            Final plea. Any info would be great.

            I have tried stripping out both jbpm and running and stripping out my hibernate calls, and both work individually in the same application. When both filters are running, it bombs out. The hibernate migration guide says that version 2.1 and 3 should be able to run side by side. I really have no idea what's wrong.

            Also, I actually set jbpm up in a different database just to see if that was the trouble. It wasn't. Still getting the...

            "You cannot commit during a managed transaction!"

            Error. Any thoughts?

            • 3. Re: Adding a webapp to the starter's kit
              Kevin Galligan Newbie

              Ok, final post from me. Sorry for the spamming.

              I have converted my code to use hibernate 3. I put my db code in a 'har' file, renamed my jboss-service to hibernate-server, etc. I removed the jars to version 2.

              Now, with the jbpm filters commented out in my web.xml file, my app runs fine. With those filters in, it does the following...

              MyAppFilter: grabs hibernate session and starts transaction
              JBPMFilter: Begins jbpm transaction
              MyApp: Runs a jsp page
              JBPMFilter: Tries to close the jbpm transaction with 'jbpmSession.commitTransactionAndClose();'

              It fails at this point. It should get past this and to my code to close the transaction for my app's code, but it bombs out with the old...

              "You cannot commit during a managed transaction!"

              So, my question to you all. Is this happening because my app's transactions are being handled by the jboss container, but the jbpm transactions aren't? At this point that seems to be the issue. If I run either in isolation, they're fine. Together, it seems like jboss gets upset because they should either both handle transactions on their own or both let jboss handle it.

              I could also be completely wrong about that. However, I'm totally lost. My setup for the jbpm is pretty much stock. Please, if anybody can help it would be much appreciated. I'm completely lost at this point.

              • 4. Declarative transaction and jBPM integration.
                Daniel Serodio Newbie

                I'd really like to hear about it, because we are having the same kind of problems, except we're using Spring managed transactions.

                How can a webapp, using declarative transaction management use a single transaction for both our "Business Objects" and jBPM?

                • 5. Re: Adding a webapp to the starter's kit
                  Kevin Galligan Newbie

                  Not sure on your issue. All I did with mine is put jbpm first and my app filter second. Now they play together. This is good news and bad news. Good because it works. Bad because I have no idea why it works. I'm sure I'll run into something related to this in the future and I'll have the "final showdown" with this issue.

                  • 6. Re: Declarative transaction and jBPM integration.
                    James Depoorter Novice

                     

                    "dserodio" wrote:
                    I'd really like to hear about it, because we are having the same kind of problems, except we're using Spring managed transactions.

                    How can a webapp, using declarative transaction management use a single transaction for both our "Business Objects" and jBPM?


                    Any success on this part (meaning declaritive transaction management on business objects and jBPM)? We would like to use jBPM (it looks promising in handling our particular WF demands), but we are heavily into Spring as well (because of certain architectural constraints).