0

I'm working on adding custom queries based on sample.

However when initializing the executor it is throwing a null pointer exception because it can't find the mapping.xml file.Any idea on how to overcome this? I have tried giving the full path like

commandExecutor = new MyBatisQueryCommandExecutor(processEngineConfiguration, "Users/a/Desktop/mappings/DeploymentMapper.xml");

Still it doesnt solve the issue. Do we have to add a mapping property in camuda-cfg.xml? If so please provide a sample property definition.

Thanks!

Raptor
  • 53,206
  • 45
  • 230
  • 366
user2894296
  • 590
  • 1
  • 10
  • 20

1 Answers1

1

You can find a full example here. The mapping has to be part of the resources of your war file.

  • Thanks Sebastian, I was actually following that sample, and i added the mapping.xml and the customMapper.xml to resources folder of my java application. but in initSqlSessionFactory() method the inputStream is still returned null. – user2894296 Feb 19 '16 at 13:29
  • I did a little bit of debugging, in the override method of protected InputStream getMyBatisXmlConfigurationSteam() { return ReflectUtil.getResourceAsStream(resourceName); } – user2894296 Feb 19 '16 at 13:57
  • it's throwing null for Context.getProcessEngineConfiguration() of below code block. private static ClassLoader getCustomClassLoader() { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if(processEngineConfiguration != null) { final ClassLoader classLoader = processEngineConfiguration.getClassLoader(); if(classLoader != null) { return classLoader; } } return null; } Any hint on that? – user2894296 Feb 19 '16 at 13:57
  • Got it sorted. :) The files weren't in the correct place. – user2894296 Feb 19 '16 at 14:12