NoSuchBeanDefinitionException CamundaBpmProperties

Hi, maybe I have a rather strange question: We’ve decided to use the same database for Camunda and for our business tables. We use Spring Boot. Now, I wanted to program a test for my Repository. There’s an annotation in SpringBoot called @DataJpaTest with which one can do that. But when I started the test, I caught an exception “NoSuchBeanDefinitionException” for “CamundaBpmProperties”. Does anybody have a clue what went wrong?

Many thanks in advance,
Christian

This thread shows a few folks using it successfully. Can you provide a sample project with the failing case? It may be easier to spot the problem with a handy reproduction.

Hi @jgigliotti, your tip sounded very promising, but my test still fails. I’ve created a small sample project which demonstrates the error. I’m not allowed to use public Git repositories, so I can not provide it tou you that way. I tried to upload the sample project as a zip file to this thread, but that’s not possible either. Any idea how to get the sample to you?

main class:

@SpringBootApplication
@EnableProcessApplication
@EnableScheduling
public class DemoApplication
{
	public static void main(String[] args)
	{
		SpringApplication.run(DemoApplication.class, args);
	}
}

Test class:

@RunWith(SpringRunner.class)
@DataJpaTest
@TestPropertySource(properties = { "camunda.bpm.enabled=false" })
public class JpaTest
{
	@Autowired
	private EntityManager entityManager;

	@Test
	public void allSetUp()
	{
		assertThat(entityManager).as("entity manager").isNotNull();
		assertThat(entityManager.isOpen()).as("entity manager is opened").isTrue();
	}
}

Exceptions are thrown. However, if I commented out @EnableProcessApplication, the test works fine.

Thanks for the code, that helped… I was able to reproduce the issue you’re seeing.

I would first decide if you need the @EnableProcessApplication annotation. More here. If you do, this post from the thread I linked is applicable. Adding the config class and removing @EnableProcessApplication from your DemoApplication should do the trick (keeping your test class as written).

If you don’t need the annotation, I would just remove it. We already know your @DataJpaTest test works fine with it removed.

Hi @jgigliotti, thanks for your help. I finally ended up with removing the @EnableProcessApplication annotation. But I must admit now that I did not really understand its purpose. But as long as my software is working, this doesn’t bother me too much…

Kind regards, Christian