Ich habe exakt das gleiche Problem wie initial von NilsH beschrieben. Ich versuche in einem Service Modul den Spring Context zu laden. Dies geschieht in der überladenen init(...) Methode des de.espirit.firstspirit.module.Service:
Ich bekomme die folgende Fehlermeldung:
INFO 08.11.2011 11:19:13.649 (org.springframework.beans.factory.xml.XmlBeanDefinitionReader): Loading XML bean definitions from class path resource [applicationContext-pimImport.xml]
ERROR 08.11.2011 11:19:13.651 (de.espirit.firstspirit.server.module.ServiceManagerImpl): cannot start service 'Modul PIM Import'.'PimImportService'
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-pimImport.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-pimImport.xml] cannot be opened because it does not exist
| @Override |
| public void init(ServiceDescriptor arg0, ServerEnvironment arg1) { |
| Logging.logInfo("Initialized PIM import module.", LOGGER); |
| //initialize Spring |
| ApplicationContext ctx = new ClassPathXmlApplicationContext( |
| "classpath:applicationContext-pimImport.xml"); |
| //get the beans we need here |
| this.pimImportHandler = ctx.getBean("pimImportHandler", PimImportHandler.class); |
| if (this.pimImportHandler == null) { |
| this.isRunning = false; |
| this.isInitialized = false; |
| Logging.logError("Could not instantiate PIM import service.", LOGGER); |
| } else { |
| this.isInitialized = true; |
| Logging.logInfo("PIM import service initialized.", LOGGER); |
| } |
I
Leider verstehe ich den von Peter Jodeleit vorgeschlagenen Hinweis auf den workaround nicht. Dort scheint es ein Classloader Problem zu geben nachdem ein eigener Thread aufgemacht wurde. Bei dem Eingangs geschilderten Problem und meinem sieht es aber so aus als ob die application.xml gar nicht gefunden wird obwohl sie im classpath liegt.
Kann hier noch jemand helfen? Vielleicht elaborieren?