cancel
Showing results for 
Search instead for 
Did you mean: 

Error while creating tables of ActivitiBPM in Postgresql

hari
Star Contributor
Star Contributor
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="jdbcSmiley Tongueostgresql://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
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Which version of Postgres and Activiti are you using? Are you using a driver version compatible with your db version?

Best regards,

hari
Star Contributor
Star Contributor
Thanks Tijs for your quick reply.
I found a different way to create the activiti tables. or may be I found the actual way to do it.

I found all the DDL statements for the tables under activiti-5.14\database folder.
I executed the db scripts and the tables got created.

Regards,
Hari.