Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Springmodules jBPM: default configuration instead of custom jbpm.cfg.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Springmodules jBPM: default configuration instead of custom jbpm.cfg.xml

    Hi,

    I am currently trying to integrate jBPM into a spring based application using springmodules jBPM 3.1 v0.8a. However I can't convince jBPM to load a configuration other than the default one. It is always using the configuration at org/jbpm/default.jbpm.cfg.xml in jbpm-3.2.2.jar.

    My configuration:

    jbpm-context.xml
    HTML Code:
    <bean id="jbpmConfig" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
           <property name="sessionFactory" ref="jbpmSessionFactory"/>
           <property name="configuration" value="classpath:/jbpm.cfg.xml"/>
           <property name="processDefinitions">
               <list>
                   <ref local="holidayProcessDefinition"/>
               </list>
           </property>
           <property name="createSchema" value="false"/>
       </bean>
    jbpm.cfg.xml is properly placed in the classes folder.

    Any help is appreciated.

    Thanks,
    Chris

  • #2
    well... The problem is still present. I searched the whole web and tried everything and I really can't believe that you have no idea what might causing this problem.

    The weird thing is that JBPM tells me
    "[JbpmConfiguration] using jbpm configuration resource 'jbpm.cfg.xml'"
    and
    "[LocalJbpmConfigurationFactoryBean] creating JbpmConfiguration from resource class path resource [../jbpm.cfg.xml]".


    The problem is severe because I can't use any custom configuration (tried to extend jbpm.varmapping.xml. Always uses default one. Bummer.)

    Please, does any of you have an idea what might causing this? I'm really stranded here.

    Thanks and Regards,
    Christian
    Last edited by Christian St.; Sep 12th, 2008, 09:38 AM.

    Comment


    • #3
      I'm currently trying to get a hold of a valid jbpmConfiguration in order to cancel a process from inside Spring which isn't working either and results in error messages like "Couldn't find hibernate.cfg.xml" or "cannot parse empty xml stream".

      Code:
          
      public void cancelProcessInstance(Long instanceId) {
              ProcessInstance pi = jbpmTemplate.findProcessInstance(instanceId);
              
              //doesn't work either
              //JbpmConfiguration config = JbpmConfiguration.getInstance("jbpm.cfg.xml");
             
              CancelProcessInstanceCommand cpic = new CancelProcessInstanceCommand(pi.getId());
              JbpmConfiguration jbpmConfig = jbpmTemplate.getJbpmConfiguration();
              cpic.setCancelSubProcesses(true);
              CommandServiceImpl csi = new CommandServiceImpl(jbpmConfig);
              csi.execute(cpic);
              
              jbpmTemplate.saveProcessInstance(pi);
      }
      ERROR [] (master) [[Spring MVC Dispatcher Servlet]] Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
      org.hibernate.HibernateException: hibernate.cfg.xml not found
      at org.hibernate.util.ConfigHelper.getResourceAsStrea m(ConfigHelper.java:147)
      at org.hibernate.cfg.Configuration.getConfigurationIn putStream(Configuration.java:1405)
      at org.hibernate.cfg.Configuration.configure(Configur ation.java:1427)
      at org.jbpm.db.hibernate.HibernateHelper.createConfig uration(HibernateHelper.java:91)
      at org.jbpm.persistence.db.DbPersistenceServiceFactor y.getConfiguration(DbPersistenceServiceFactory.jav a:69)
      at org.jbpm.persistence.db.DbPersistenceServiceFactor y.getSessionFactory(DbPersistenceServiceFactory.ja va:91)
      at org.jbpm.persistence.db.DbPersistenceService.getSe ssionFactory(DbPersistenceService.java:95)
      at org.jbpm.persistence.db.DbPersistenceService.getSe ssion(DbPersistenceService.java:99)
      at org.jbpm.persistence.db.DbPersistenceService.getGr aphSession(DbPersistenceService.java:341)
      at org.jbpm.JbpmContext.getGraphSession(JbpmContext.j ava:571)
      at org.jbpm.command.CancelProcessInstanceCommand.canc elProcess(CancelProcessInstanceCommand.java:48)
      at org.jbpm.command.CancelProcessInstanceCommand.exec ute(CancelProcessInstanceCommand.java:42)
      at org.jbpm.command.impl.CommandServiceImpl.execute(C ommandServiceImpl.java:71)
      at com.namics.axpo.poc.jbpm.dao.ProcessFormDAO.cancel ProcessInstance(ProcessFormDAO.java:130)
      at com.namics.axpo.poc.jbpm.dao.ProcessFormDAO$$FastC lassByCGLIB$$e48d1454.invoke(<generated>)
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy. java:191)
      at org.springframework.aop.framework.Cglib2AopProxy$C glibMethodInvocation.invokeJoinpoint(Cglib2AopProx y.java:700)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :149)
      at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:106)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
      at org.springframework.aop.framework.Cglib2AopProxy$D ynamicAdvisedInterceptor.intercept(Cglib2AopProxy. java:635)
      at com.namics.axpo.poc.jbpm.dao.ProcessFormDAO$$Enhan cerByCGLIB$$1e80146c.cancelProcessInstance(<genera ted>)
      at com.namics.axpo.poc.jbpm.HolidayController.signalP rocess(HolidayController.java:204)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.web.bind.annotation.support.Ha ndlerMethodInvoker.doInvokeMethod(HandlerMethodInv oker.java:409)
      at org.springframework.web.bind.annotation.support.Ha ndlerMethodInvoker.invokeHandlerMethod(HandlerMeth odInvoker.java:132)
      at org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.invokeHandlerMethod(An notationMethodHandlerAdapter.java:310)
      at org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.handle(AnnotationMetho dHandlerAdapter.java:297)
      at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
      at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809)
      at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
      at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      at org.springframework.orm.hibernate3.support.OpenSes sionInViewFilter.doFilterInternal(OpenSessionInVie wFilter.java:198)
      at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
      at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:568)
      at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:613)

      Comment


      • #4
        Use hibernate session factory instead of JbpmSessionFactory...
        Code:
        <property name="sessionFactory" ref="hibernateSessionFactory"/>
        Code:
           <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
                <property name="dataSource"><ref bean="dataSource"/></property>
                <property name="mappingLocations">
                    <value>classpath:/org/jbpm/**/*.hbm.xml</value>
                </property>
                <property name="hibernateProperties">
                    <props>
                        <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
                        <prop key="hibernate.show_sql">false</prop>
                        <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop>                
                    </props>
                </property>
            </bean>

        Comment

        Working...
        X