cancel
Showing results for 
Search instead for 
Did you mean: 

REST Api with SQL Server Repository gives exception with context.xml

ysomavan
Champ in-the-making
Champ in-the-making
Prior to using SQL Server Repository I was using an in memory h2 DB which was working pretty fine.
Now I have change the db.properties file to point to my activiti db in SQL server for both activiti-explorer as well as activiti-rest.
I have executed sql server Create/Update scripts which got execute without any issues , I am able to create a process and start a process using acitviti explorer.

Using Rest api I am not able to fetch the process definition for the process deployed using activiti explorer. Do I need to deploy the same process using Activiti Rest api as well ?

Exception which get printed is :
*************************************************************************************************************************************
07:19:48,168 [http-8080-6] INFO  org.activiti.engine.ProcessEngines  - Initializing process engine using Spring configuration 'file:/D:/Program%20Files/apache-tomcat-6.0.36/webapps/activiti-rest/WEB-INF/classes/activiti-context.xml'
07:19:48,183 [http-8080-6] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from URL [file:/D:/Program%20Files/apache-tomcat-6.0.36/webapps/activiti-rest/WEB-INF/classes/activiti-context.xml]
Mar 18, 2014 7:19:48 PM org.restlet.engine.application.StatusFilter doHandle
WARNING: Exception or error caught in status serviceorg.activiti.engine.ActivitiException: couldn't initialize process engine from spring configuration resource file:/D:/Program%20Files/apache-tomcat-6.0.36/webapps/activiti-rest/WEB-INF/classes/activiti-context.xml: null       at org.activiti.engine.ProcessEngines.initProcessEngineFromSpringResource(ProcessEngines.java:130)
*************************************************************************************************************************************

My activiti-context.xml looks like this:
**************************************************************************************
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

   <!– Comment this if you don't need demo data –>
   <!–
   <bean id="demoDataGenerator" class="org.activiti.rest.service.demo.DemoDataGenerator"
      init-method="init">
      <property name="processEngine" ref="processEngine" />
      <property name="createDemoUsersAndGroups" value="true" />
        <property name="createDemoProcessDefinitions" value="true" />
        <property name="createDemoModels" value="true" />
   </bean>

   <bean id="dbProperties"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="location" value="classpath:db.properties" />
      <!– Allow other PropertyPlaceholderConfigurer to run as well –>
   <!–   <property name="ignoreUnresolvablePlaceholders" value="true" />
   </bean>
–>
   <bean id="dataSource"
      class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
      <property name="driverClass" value="${jdbc.driver}" />
      <property name="url" value="${jdbc.url}" />
      <property name="username" value="${jdbc.username}" />
      <property name="password" value="${jdbc.password}" />
   </bean>

   <bean id="transactionManager"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource" />
   </bean>
<!–
   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="mailServerHost" value="localhost" />
      <property name="mailServerPort" value="5025" />
      <property name="jobExecutorActivate" value="false" />
   </bean>
–>
   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

</beans>
***************************************************************************************************************
1 REPLY 1

trademak
Star Contributor
Star Contributor
Are you connecting it to the same DB as the Activiti Explorer? If so it should just work. Do you get back an empty array?