FileNotFoundException for carnot.properties during server startup on Tomcat [message #757512] |
Fri, 18 November 2011 17:31 |
|
Hi,
I've created a Dynamic Web Project in Eclipse for Stardust (Rapid Application Development, RAD). When I deploy this project onto a local Tomcat instance (also in Eclipse) I get the following error message during server start in the console output:
Nov 18, 2011 6:01:36 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [carnot.properties] cannot be opened because it does not exist
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:553)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:527)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:362)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.io.FileNotFoundException: class path resource [carnot.properties] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:182)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)
... 21 more
Nov 18, 2011 6:01:36 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 18, 2011 6:01:36 AM org.apache.catalina.core.StandardContext start
Any ideas?
|
|
|
Re: FileNotFoundException for carnot.properties during server startup on Tomcat [message #757513 is a reply to message #757512] |
Fri, 18 November 2011 17:40 |
|
By default, the Stardust engine searches for the file "carnot.properties" on the classpath and the error message tells you that it could not be found.
This file can be put on the server's classpath outside of your web application or packaged within the WAR/EAR, for example in WEB-INF/classes.
In this case, since a RAD project in Eclipse is being used, this file is normally located in <project-root>/ipp-resources/carnot.properties and should be published to the server as part of the Eclipse WTP deployment mechanism.
Please check in the Eclipse menu under Project > Build Automatically whether this options is enabled.
Another cause for this problem could be that you have build errors in your project. Check the Problems View in Eclipse!
Both of the above scenarios would prevent the files from the source folder "ipp-resources" to be copied to the project's output folder (typically <project-root>/build/classes) and therefore they are missed as part of the deployment to the server.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02819 seconds