10 Replies Latest reply on Apr 30, 2007 9:25 AM by jean-francois landry

    Problem using jbpm server with fuzzy logic library

    jean-francois landry Newbie

      Hi,
      I am having problem with the jbpm server, more precisely, I am trying to implement certain calculations following a task activation in a jbpm workflow, and everything works fine until I initialise a class from the external library FuzzyJToolkit

      I have no problem until I initialise an object from this class. If i create a local application with the same code and run it, everything executes fine... but when calling that function from the jbpm server i get the same problem every time.

      Here is the error, in case it might help:

      HTTP Status 500 -

      type Exception report

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: Error calling action method of component with id taskform:transitionButton
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
      org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
      org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:83)
      org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

      root cause

      javax.faces.FacesException: Error calling action method of component with id taskform:transitionButton
      org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
      javax.faces.component.UICommand.broadcast(UICommand.java:106)
      javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
      javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
      org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
      org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
      org.jbpm.webapp.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
      org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:83)
      org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


        • 1. Re: Problem using jbpm server with fuzzy logic library
          Ronald van Kuijk Master

          look in the serverlogging for more info on this error.... (it even says that at the bottom of the screen)

          • 2. Re: Problem using jbpm server with fuzzy logic library
            jean-francois landry Newbie

            Yeah i tired looking into the logs but could'nt actually find them! I have the jbpm-starters-kit-3.1.4 and simply run start.bat in the server directory to launch it, but the only logs i find are boot.log and localDB.log, which don't tell me anymore info about what's happened...

            • 3. Re: Problem using jbpm server with fuzzy logic library
              Martin Weiler Apprentice

              The log configuration that comes with the starters kit is indeed very minimal and doesn't create verbose file logging. Replace the jbpm-starters-kit-3.1.4/jbpm-server/server/jbpm/conf/log4j.xml file with a log4j.xml from a standard JBoss distribution and invoke your function call again.

              Regards, Martin

              • 4. Re: Problem using jbpm server with fuzzy logic library
                jean-francois landry Newbie

                Thanks for the answer.
                I replaced the log4j.xml with one from the release jbpm-jpdl-suite-3.2.GA, however I still only have the two log files i mentionned earlier...I don't see any full stack trace file :/

                Even then im not sure if i will find the answer in there, do you guys have any slightless idea what could cause the problem? it only occurs if i initialise the class, if i just declare it, it runs fine...

                (and again, it all works fine also if i run it on a local instance of the program)

                • 5. Re: Problem using jbpm server with fuzzy logic library
                  Edward Staub Expert

                  The error is arising out of MyFaces... I'd be looking at logging/debugging options for it.

                  It is possible that the FacesException has another nested exception inside it.

                  • 6. Re: Problem using jbpm server with fuzzy logic library
                    jean-francois landry Newbie

                    Ok so i've been able to further down isolate the problem.

                    It is created by a call to the FuzzySet class.

                    When i do something like the example:

                    double xHot[] = {25, 35};
                    double yHot[] = {0, 1};
                    double xCold[] = {5, 15};
                    double yCold[] = {1, 0};
                    FuzzyValue fval = null;

                    FuzzyVariable temp = new FuzzyVariable("temperature", 0, 100, "C");

                    temp.addTerm("hot", xHot, yHot, 2);
                    temp.addTerm("cold", xCold, yCold, 2);

                    Everything works fine, but if i do something like ;

                    FuzzyVariable temp = new FuzzyVariable("temperature", 0, 100, "C");
                    temp.addTerm("hot", PIFuzzySet(5,0.5));

                    I get an error, because i use PIFuzzySet (a subclass of FuzzySet) instead of FuzzySet...

                    So why would this work when running locally on a custom executable program, but not when deployed and accessed through the webserver?

                    • 7. Re: Problem using jbpm server with fuzzy logic library
                      jean-francois landry Newbie

                      Sorry all, i just realised that I posted stuff about the FuzzyJToolkit class while this forum is about JBPM.

                      However i was still wrong in my assessment, I still have the same problem whenever i just try to instantiate that class...

                      here is an example:

                      public static void blahblah(){
                      FuzzyVariable temp;

                      try {
                      temp = new FuzzyVariable("temperature", 0, 100, "C");
                      } catch (InvalidFuzzyVariableNameException e) {
                      e.printStackTrace();
                      } catch (InvalidUODRangeException e) {
                      e.printStackTrace();
                      }
                      }

                      That function will crash if i access it from the action handler, but not if i access it myself from a small main executable that i create...
                      The problem seems to be when i instantiate :
                      temp = new FuzzyVariable("temperature", 0, 100, "C");

                      If i remove it, it runs ok...

                      Is there a restriction to the kind of classes you can access with the action handler?

                      • 8. Re: Problem using jbpm server with fuzzy logic library
                        jean-francois landry Newbie

                        The XML file:

                        <?xml version="1.0" encoding="UTF-8"?>
                        
                        <process-definition
                         xmlns="urn:jbpm.org:jpdl-3.1" name="EmergencyWorkflow">
                         <swimlane name="swimlane1"></swimlane>
                         <start-state name="Emergency Situation">
                         <task name="Emergency" swimlane="swimlane1">
                         <controller>
                         <variable name="Event" access="read,write,required"></variable>
                         </controller>
                         </task>
                         <transition name="Go to Mayor" to="AlertMayor"></transition>
                         </start-state>
                         <task-node name="Analyse Gravity">
                         <task name="Get Details" swimlane="swimlane1">
                         <controller>
                         <variable name="Wounded" access="read,write,required"></variable>
                         <variable name="Proximity of residence" access="read,write,required"></variable>
                         <variable name="Accessibility" access="read,write,required"></variable>
                         <variable name="Hazmats" access="read,write,required"></variable>
                         <variable name="Temperature" access="read,write,required"></variable>
                         <variable name="Size of fire" access="read,write,required"></variable>
                         <variable name="Fire state (under control?)" access="read,write,required"></variable>
                         </controller>
                         </task>
                         <transition name="" to="Get %"></transition>
                         </task-node>
                         <state name="Fix Locally">
                         <transition name="" to="Gather Information"></transition>
                         </state>
                         <state name="Call Prefet">
                         <transition name="" to="end1"></transition>
                         </state>
                         <end-state name="end1"></end-state>
                         <task-node name="Gather Information">
                         <task name="Gather Info" swimlane="swimlane1">
                         <controller>
                         <variable name="Other info..." access="read"></variable>
                         </controller>
                         </task>
                         <transition name="tr6" to="fork1"></transition>
                         </task-node>
                         <task-node name="Results">
                         <transition name="" to="end1"></transition>
                         </task-node>
                         <task-node name="Get %">
                         <task name="Recommended decision" swimlane="swimlane1">
                         <controller>
                         <variable name="Keep Local" access="read"></variable>
                         <variable name="Contact Préfet" access="read"></variable>
                         </controller>
                         </task>
                         <event type="node-enter">
                         <action name="action1" class="evalFuzzy.ActionButton"></action>
                         </event>
                         <transition name="Keep Local" to="Fix Locally"></transition>
                         <transition name="Contact higher authorities" to="Call Prefet"></transition>
                         </task-node>
                         <node name="AlertMayor">
                         <transition name="Go To Gravity" to="Analyse Gravity"></transition>
                         </node>
                         <task-node name="Police">
                         <transition name="" to="join1"></transition>
                         </task-node>
                         <task-node name="Médias">
                         <transition name="" to="join1"></transition>
                         </task-node>
                         <task-node name="Samu">
                         <transition name="" to="join1"></transition>
                         </task-node>
                         <task-node name="Firefighters">
                         <transition name="" to="join1"></transition>
                         </task-node>
                         <task-node name="Civil Security">
                         <transition name="" to="join1"></transition>
                         </task-node>
                         <join name="join1">
                         <transition name="" to="Results"></transition>
                         </join>
                         <fork name="fork1">
                         <transition name="" to="Police"></transition>
                         <transition name="tr2" to="Médias"></transition>
                         <transition name="tr3" to="Samu"></transition>
                         <transition name="tr4" to="Firefighters"></transition>
                         <transition name="tr5" to="Civil Security"></transition>
                         </fork>
                        </process-definition>


                        • 9. Re: Problem using jbpm server with fuzzy logic library
                          Edward Staub Expert

                          "Is it plugged in?"
                          Is FuzzyVariable.class is in your classpath?

                          I think this can be accomplished by deploying it in the process, or by including it in the JBPM deployment (in the WAR file?) or by putting it in the global classpath for the webserver.

                          This is pretty basic stuff, so I may be talking "under your head", so to speak.

                          -Ed Staub

                          • 10. Re: Problem using jbpm server with fuzzy logic library
                            jean-francois landry Newbie

                            A late answer, but yeah it is plugged in as far as i know, else how would it work perfectly when i launch a small local app that calls that method?

                            I also make sure that it is selected from the list when i deploy it on the server..

                            But still thanks for the response, don't assume anything is "under my head" as i am still a beginner at all this :)
                            I had to put that project on hold for the weekend but im back on today and i really wanna fix this weird thing...
                            anyone else feel free to jump in with some suggestions :/