cancel
Showing results for 
Search instead for 
Did you mean: 

Error with StandaloneProcessEngineConfiguration while migration 5.11 -> 5.13

mokematt
Champ in-the-making
Champ in-the-making
I have implemented a bit customization to activiti for a better benefit in my use case.
My ProcessEngine is starting as follows:


public final class CustomProcessEngine {
..
   private CustomProcessEngine(){
      try {
         //Config laden
         Config config = new Config();
         config.load("/data/pucco/etc", "activiti", "cfg", "sec");
                        …         

         this.processEngine=new CustomProcessEngineConfiguration()
               .setDatabaseType(config.gets(this.getClass(), "databaseType"))
               .setDatabaseSchemaUpdate(config.gets(this.getClass(), "databaseShemaUpdate"))
               .setJdbcDriver(config.gets(this.getClass(), "jdbcDriver"))
               .setJdbcUrl(config.gets(this.getClass(), "jdbcUrl"))
               .setJdbcUsername(config.gets(this.getClass(), "jdbcUsername"))
               .setJdbcPassword(config.gets(this.getClass(), "jdbcPassword"))
               .setJobExecutorActivate(Boolean.getBoolean(config.gets(this.getClass(), "jobExecutorActivate")))
               .setHistory(config.gets(this.getClass(), "history")).buildProcessEngine();
      } catch (FileNotFoundException e) {
         logger.log(LogLevel.ERR, e.getMessage());
         throw new ActivitiException("Config file not found!!");
      } catch (IOException e) {
         logger.log(LogLevel.ERR, e.getMessage());
         throw new ActivitiException("Config file corrupt!!");
      }
   }

   public synchronized static CustomProcessEngine getInstance() {
      if (instance == null) {
         instance = new CustomProcessEngine();
      }
      return instance;
   }
   
   public ProcessEngine getProcessEngine(){
      return this.processEngine;
   }
}



public class CustomProcessEngineConfiguration extends StandaloneProcessEngineConfiguration {
   
   private Config config;
   
   @Override
   public ProcessEngine buildProcessEngine() {
      configure();
      init();
      Map<Class< ? >, SessionFactory> sessionFactories = this.getSessionFactories();
      sessionFactories.put(GroupEntityManager.class, new LDAPGroupManagerFactory(this.config));
      sessionFactories.put(UserEntityManager.class, new LDAPUserManagerFactory(this.config));
      this.setSessionFactories(sessionFactories);
      this.setFailedJobCommandFactory(new CustomFailedJobCommandFactory());
      return new ProcessEngineImpl(this);
     }
   
   private void configure(){
      this.config = new Config();
      try {
         this.config.load("/data/pucco/etc", "ldap", "cfg", "sec");
      } catch (FileNotFoundException e) {
         throw new ActivitiException("Config file not found!!");
      } catch (IOException e) {
         throw new ActivitiException("Config file corrupt!!");
      }
   }



//Starting the process engine
processEngine = CustomProcessEngine.getInstance().getProcessEngine();


It runs very fine with activiti 5.11. I want to migrate my code to version 5.13 and made some changes:
UserManager = UserEntityManager
GroupManager = GroupEntityManager

But i got an error:

java.lang.NoSuchMethodError: pucco.activiti.custom.CustomProcessEngineConfiguration.setDatabaseType(Ljava/lang/String;)Lorg/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl;
        at pucco.activiti.custom.CustomProcessEngine.<init>(CustomProcessEngine.java:46)
        at pucco.activiti.custom.CustomProcessEngine.getInstance(CustomProcessEngine.java:68)



Why do i get this error?
3 REPLIES 3

mokematt
Champ in-the-making
Champ in-the-making
The error has gone. I don't know why, maybe not all jars was updated successfully. The database migration to version 5.13 was also successful. Very nice. Smiley Happy

Greets

trademak
Star Contributor
Star Contributor
That method is implemented in ProcessEngineConfiguration. Can you create a unit test project that shows this error?

Best regards,

mokematt
Champ in-the-making
Champ in-the-making
Sorry, i can't reproduce the error. Smiley Very Happy
I think i got this problem while updating the 5.11-jars to 5.13-jars. Or Maybe my classpath was not correctly set.