3 Replies Latest reply on Jul 26, 2011 9:06 AM by Aslak Knutsen

    Intégration jbpm 4.4 jsf

    rachid kersit Newbie

      i have follow the topic http://planet.jboss.org/view/post.seam;jsessionid=630A5400AF2625CBCBADA32921074CCD?post=combining_jbpm_and_jsf to install integrate jbpm 4.4 to jsf.

       

      but when i developped my bean like this:

       

      package jbpm;

       

       

      import java.util.List;

       

       

      import org.jbpm.api.Configuration;

      import org.jbpm.api.ExecutionService;

      import org.jbpm.api.ProcessDefinition;

      import org.jbpm.api.ProcessDefinitionQuery;

      import org.jbpm.api.ProcessEngine;

      import org.jbpm.api.ProcessInstance;

      import org.jbpm.api.RepositoryService;

       

       

      public class Test {

       

       

                private static ProcessEngine processEngine = null;

                private static RepositoryService repositoryService;

                /*

                public Test(){

                          initialize();

                }

       

                private synchronized void initialize(){

                          if(processEngine==null){

                             processEngine = Configuration.getProcessEngine();

                             repositoryService=processEngine.getRepositoryService();

                          }

                }

                */

                public List<ProcessDefinition> getDeployedProcessDefinitions(){

                          return repositoryService.createProcessDefinitionQuery().orderAsc(ProcessDefinitionQuery.PROPERTY_NAME).list();

       

                          }

       

       

       

                public String getTester()

                {

                          System.out.print("l'entrée est faite");

              processEngine = Configuration.getProcessEngine();

                          RepositoryService repositoryService = processEngine.getRepositoryService();

                          ExecutionService executionService = processEngine.getExecutionService();

       

                          String deployment = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/examples/webapp/jsf/Besoin.jpdl.xml").deploy();

                          ProcessInstance processInstance = executionService.startProcessInstanceByKey("Bes");

       

                          String str= processInstance.getId();

       

                          return str;

                }

                }

       

      after i develop my page jsp like this

       

       

      <%@ page language="java" contentType="text/html; charset=ISO-8859-1"

          pageEncoding="ISO-8859-1"%>

            

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

       

       

       

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

      <html>

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

      <title>Hello JBPM AND JSF</title>

      </head>

      <body>

       

       

      <f:view>

      <h:form>

        <h:graphicImage value="/images/jbpm.png" />

        <h1>

         <h:outputText  value="#{test.tester}" />

         <h:outputText value="Welcome to the hello jbpm and jsf application" />

        </h1>

       

        <h3>

         <h:outputText value="This is the list of currently deployed processes:" />

        </h3>

       

        </h:form>

      </f:view>

       

       

      </body>

      </html>

       

      when i try t execute this page i get this error

       

      l'entrée est faite26 juil. 2011 11:13:53 org.apache.catalina.core.StandardWrapperValve invoke

      GRAVE: "Servlet.service()" pour la servlet Faces Servlet a généré une exception

      org.jbpm.pvm.internal.wire.WireException: couldn't find configuration

                at org.jbpm.pvm.internal.wire.descriptor.HibernateSessionFactoryDescriptor.construct(HibernateSessionFactoryDescriptor.java:59)

                at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:487)

                at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:466)

                at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:455)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:429)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:339)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:704)

                at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:154)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:711)

                at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:132)

                at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:123)

                at org.jbpm.pvm.internal.wire.descriptor.HibernateSessionDescriptor.construct(HibernateSessionDescriptor.java:63)

                at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:487)

                at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:466)

                at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:455)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:429)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:339)

                at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:704)

                at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:132)

                at org.jbpm.pvm.internal.env.BasicEnvironment.get(BasicEnvironment.java:123)

                at org.jbpm.pvm.internal.env.EnvironmentImpl.getFromCurrent(EnvironmentImpl.java:207)

                at org.jbpm.pvm.internal.env.EnvironmentImpl.getFromCurrent(EnvironmentImpl.java:196)

                at org.jbpm.pvm.internal.cmd.CheckDbCmd.execute(CheckDbCmd.java:44)

                at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

                at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)

                at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

                at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

                at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)

                at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

                at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:152)

                at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.<init>(ProcessEngineImpl.java:105)

                at org.jbpm.pvm.internal.cfg.ConfigurationImpl.instantiateProcessEngine(ConfigurationImpl.java:100)

                at org.jbpm.pvm.internal.cfg.ConfigurationImpl.buildProcessEngine(ConfigurationImpl.java:92)

                at org.jbpm.api.Configuration.getProcessEngine(Configuration.java:126)

                at jbpm.Test.getTester(Test.java:40)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at javax.el.BeanELResolver.getValue(BeanELResolver.java:83)

                at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)

                at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)

                at org.apache.el.parser.AstValue.getValue(AstValue.java:123)

                at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)

                at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)

                at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)

                at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)

                at javax.faces.component.UIOutput.getValue(UIOutput.java:168)

                at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)

                at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)

                at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)

                at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)

                at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)

                at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)

                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)

                at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:420)

                at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:209)

                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)

                at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)

                at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)

                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

                at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

                at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

                at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                at java.lang.Thread.run(Unknown Source)

      26 juil. 2011 11:13:53 org.apache.catalina.core.ApplicationDispatcher invoke

      GRAVE: "Servlet.service()" pour la servlet jsp a lancé une exception

      java.lang.RuntimeException: Cannot find FacesContext

                at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)

                at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)

                at org.apache.jsp.error_jsp._jspx_meth_f_005fview_005f0(error_jsp.java:135)

                at org.apache.jsp.error_jsp._jspService(error_jsp.java:108)

                at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)

                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)

                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

                at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421)

                at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342)

                at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                at java.lang.Thread.run(Unknown Source)

      26 juil. 2011 11:13:53 org.apache.catalina.core.StandardHostValve custom

      GRAVE: Exception Processing ErrorPage[errorCode=500, location=/error.jsp]

      org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext

                at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)

                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)

                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

                at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)

                at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

                at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

                at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421)

                at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342)

                at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.RuntimeException: Cannot find FacesContext

                at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)

                at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)

                at org.apache.jsp.error_jsp._jspx_meth_f_005fview_005f0(error_jsp.java:135)

                at org.apache.jsp.error_jsp._jspService(error_jsp.java:108)

                at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)

                ... 20 more

       

       

       

      i think so that the probleme is in jbpm.cfg.xml, so who to integrate jbpm 4.4 to jsf,

       

      help me please,

       

      thanks