cancel
Showing results for 
Search instead for 
Did you mean: 

org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key 'BusinessApproval'

kishore_mutchar
Champ in-the-making
Champ in-the-making
org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key 'BusinessApproval'

I am Using Spring MVC + Activiti,

  Spring Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   id="voiceBank" version="3.0">
      
      <session-config>
      <session-timeout>60</session-timeout>
     </session-config>
    
       <servlet>
          <servlet-name>Spring_Activiti</servlet-name>
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
       </servlet>

       <servlet-mapping>
          <servlet-name>Spring_Activiti</servlet-name>
          <url-pattern>/</url-pattern>
       </servlet-mapping>
      
        <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
             
       <context-param>
          <!– Specifies the list of Spring Configuration files in comma separated format.–>
          <param-name>contextConfigLocation</param-name>
          <param-value> /WEB-INF/Spring_Activiti-servlet.xml</param-value>
       </context-param>
          <listener>
          <!– Loads your Configuration Files–>
          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
       </listener>
  
</web-app>


And My Spring + Activiti Configuration File(Spring_Activiti-servlet.xml) File


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlnsSmiley Tongue="http://www.springframework.org/schema/p"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:security="http://www.springframework.org/schema/security"
   xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
   xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
      http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

   <context:component-scan base-package="org.gambia" />
   <context:annotation-config />
   <mvc:annotation-driven />

   <!– Handles GET requests for /resources/** by efficiently serving static
      content in the ${webappRoot}/resources dir –>
   <mvc:resources mapping="/resources/**" location="/resources/" />
   <!– Forwards requests to the "/" resource to the "welcome" view –>
   <mvc:view-controller path="/" view-name="enter" />

   <!– TILES Configuration –>
   <bean id="viewResolver"
      class="org.springframework.web.servlet.view.UrlBasedViewResolver">
      <property name="viewClass">
         <value>
            org.springframework.web.servlet.view.tiles2.TilesView
         </value>
      </property>
   </bean>
   <bean id="tilesConfigurer"
      class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
      <property name="definitions">
         <list>
            <value>/WEB-INF/tiles/main-tiles.xml</value>

         </list>
      </property>
   </bean>


   


   <bean id="internalViewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/views/" />
      <property name="suffix" value=".jsp" />
      <property name="order" value="1" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="false" />
      <property name="transactionManager" ref="transactionManager"></property>
      <!– <propety name="beans"> <map> <entry key="printer" value-ref="printer"/>
         </map> </property> –>
      <property name="deploymentResources" value="classpath*:/processes.*.bpmn20.xml" />
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

   <bean id="dataSource"
      class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
      <property name="driverClass" value="com.mysql.jdbc.Driver" />
      <property name="url" value="jdbc:mysql://localhost:3333/activiti" />
      <property name="username" value="root" />
      <property name="password" value="" />
   </bean>

   <bean id="transactionManager"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource" />
   </bean>

   <bean id="repositoryService" factory-bean="processEngine"
      factory-method="getRepositoryService" />
   <bean id="runtimeService" factory-bean="processEngine"
      factory-method="getRuntimeService" />
   <bean id="taskService" factory-bean="processEngine"
      factory-method="getTaskService" />
   <bean id="historyService" factory-bean="processEngine"
      factory-method="getHistoryService" />
   <bean id="managementService" factory-bean="processEngine"
      factory-method="getManagementService" />
</beans>

  Here's My Spring Controller's Method….
@RequestMapping("/BusinessInfo")
       public String Registration(@ModelAttribute(value="reg") Registration reg,HttpServletRequest request) {
              
               Map<String, Object> variables = new HashMap<String, Object>();
               variables.put("nameOfBusiness", reg.getNameOfBusiness());
               variables.put("address",reg.getAddress());
               variables.put("mangingDirector", reg.getMangingDirector());
               variables.put("telephone",reg.getTelephone());
               variables.put("fax", reg.getFax());
               variables.put("email",reg.getEmail());
               variables.put("wwwAddress", reg.getWwwAddress());
               variables.put("parentCompanyOrOtherBusinessNames", reg.getParentCompanyOrOtherBusinessNames());
               variables.put("subsidiaries",reg.getSubsidiaries());
               variables.put("mangingDirector", reg.getMangingDirector());
               variables.put("typeOfBusiness",reg.getTypeOfBusiness());
               variables.put("natureOfBusiness", reg.getNatureOfBusiness());
               variables.put("email",reg.getEmail());
               variables.put("nameOfCustomer1", reg.getNameOfCustomer1());
               variables.put("address1",reg.getAddress1());
               variables.put("nameOfCustomer2", reg.getNameOfCustomer2());
               variables.put("address2",reg.getAddress2());
               variables.put("yearBusinessEstablished", reg.getYearBusinessEstablished());
               variables.put("numberOfFullTimeEmployees",reg.getNumberOfFullTimeEmployees());
               variables.put("businessRegistrationNumber", reg.getBusinessRegistrationNumber());
                             
               ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
               logger.debug("Data Inserted into Map Data Structures " + variables);
           
               RuntimeService runtimeService = processEngine.getRuntimeService();
            
               logger.debug("After Run Time " + variables);
            
               ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("BusinessApproval", variables);
               logger.debug("Data Inserted into Map Data Structures " + variables);
            
               System.out.println("KKKK"+processInstance);
             return "";   
       }





Query 1)   First Query Whether its work's or not ?(       *****Taking the Form Data and adding to Activiti BPM…….  Process Definition "Business Approval"**********)

Query 2)  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("BusinessApproval", variables);

      Second Query is  org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key 'BusinessApproval'…………
Am already configured in Spring Configuration file(Spring_Activiti-servlet.xml) as

  <property name="deploymentResources" value="classpath*:/processes.*.bpmn20.xml" />

  is it correct to set the path for activiti *.bpmn.xml to access, or is their any alternatives to access the bpmn.xml……… whether it would be in code or xml format ?          

To overcome that exception ???

Pls Reply it fast……….

            
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
Please do not post the same question multiple times!

kishore_mutchar
Champ in-the-making
Champ in-the-making
K tans for u reply…….