AnsweredAssumed Answered

Error while creating tables of ActivitiBPM in Postgresql

Question asked by hari on Apr 8, 2015
Latest reply on Apr 8, 2015 by hari
Hi,

I was trying to use Postgresql instead of H2 db, as the db for Activiti.
I have made the changes in activiti.cfg.xml as below.
and I was running DbSchemaCreate class. I get the below error and I have no clue how to move forward

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      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">

   <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
     <property name="jdbcDriver" value="org.postgresql.Driver" />
     <property name="jdbcUrl" value="jdbc:postgresql://172.160.110.121:5433/ActivitiDB" />
     <property name="jdbcUsername" value="postgres" />
     <property name="jdbcPassword" value="postgres" />
     <property name="databaseSchemaUpdate" value="true"/>
   </bean>
</beans>



Exception in thread "main" org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.binding.BindingException: Only interfaces can be configured by the MapperFactory.  Type class org.activiti.engine.impl.persistence.entity.AttachmentEntity is not an interface.
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:649)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:386)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:362)
   at org.activiti.designer.test.DbSchemaCreate.main(DbSchemaCreate.java:17)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.binding.BindingException: Only interfaces can be configured by the MapperFactory.  Type class org.activiti.engine.impl.persistence.entity.AttachmentEntity is not an interface.
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:68)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:53)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:644)
   … 3 more
Caused by: org.apache.ibatis.binding.BindingException: Only interfaces can be configured by the MapperFactory.  Type class org.activiti.engine.impl.persistence.entity.AttachmentEntity is not an interface.
   at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:35)
   at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:320)
   at org.apache.ibatis.builder.xml.XMLMapperBuilder.bindMapperForNamespace(XMLMapperBuilder.java:236)
   at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:40)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:226)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:66)
   … 5 more

Thanks,
Hari

Outcomes