I have tried by several ways (Google, Stack Overflow...) and by several days resolve the following error without success. This error only happens if I run the application. Compilation is not affected.
org.databene.commons.ConfigurationError: Class not found: 'org.databene.benerator.engine.DefaultBeneratorFactory' at org.databene.commons.ExceptionMapper.configurationException(ExceptionMapper.java:121) at org.databene.commons.BeanUtil.forName(BeanUtil.java:358) at org.databene.commons.BeanUtil.newInstance(BeanUtil.java:423) at org.databene.benerator.BeneratorFactory.getInstance(BeneratorFactory.java:56) at org.databene.benerator.util.GeneratorUtil.init(GeneratorUtil.java:54) at testGeneration.TestCaseGenerator.generateTests(TestCaseGenerator.java:326)
That is, if I try to instantiate an object of DefaultBeneratorFactory class, no problem appears. The error manifests when I call a method to initiate a generator:
GeneratorUtil.init(stringGenerator);
The application I have developed is a plugin for Intellij Idea Community Edition (version 2016.2.4) in OS X El Capitan. The Java environment is Oracle JDK 8u102. My plugin uses Databene Benerator framework that can be downloaded as a set of Jars. I included the corresponding jars as Libraries in the project:
The libraries in Project Settings
See the Dependencies:
The dependencies in Project Settings
I followed some suggestions:
1) Mark the export option for each Jar. Link
2) Change the Output Path and Set Global Libraries. Link
3) Use previous versions of IDEA, try an earlier JDK, Invalidate Cache of IDEA.
Another important information, an Eclipse version of my plugin is fully functional in the same environment, with the same version of Benerator framework. So, I think there is some particularity of IDEA here.
Any help is greatly appreciated!!
I think the problem is how Intellij Idea deals with the classes inside the jar. The DefaultBeneratorFactory.class is in the jar in the correct path: org/databene/benerator/engine. Anyone can explain this?