0

I am trying to load a Spring Application Context (xml) in a HiveMQ plugin. I seem unable to load the context because it cannot find the xml configuration. The spring-context.xml is located in "src\main\resources" and i try to load the context using:

ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring-context.xml")

The error i get is the following:

java.io.FileNotFoundException: class path resource [spring-context.xml] cannot be opened because it does not exist

Marco
  • 15,101
  • 33
  • 107
  • 174
  • It seems the spring-context.xml is not copied to the HiveMQ plugin jar file. Did you modify the Maven Shade configuration so the xml is included in the plugin jar? – Dominik Obermaier Dec 17 '15 at 18:29
  • The reason why it cannot find the spring-context is because the plugin uses a different classloader. Providing the correct classloader solves this issue. – Marco Dec 18 '15 at 07:25

0 Answers0