Message Tomcat qu'un fichier .properties est manquant
Bonjour à tous,
J'essaie de remettre en marche un vieux et complexe projet en J2EE sous Eclipse. J'ai configuré un serveur Tomcat, mais lorsque je cherche à démarrer ce projet sur le serveur configuré, j'ai ceci dans la console:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| Oct 25, 2013 6:44:55 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/Joe/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Oct 25, 2013 6:44:56 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8090"]
Oct 25, 2013 6:44:56 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Oct 25, 2013 6:44:56 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 521 ms
Oct 25, 2013 6:44:56 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 25, 2013 6:44:56 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
2013-10-25 18:44:56,958 ERROR [localhost-startStop-1] config.ApplicationContext (<init>:31) - This file does not exist : ideliance.properties
java.io.FileNotFoundException: ideliance.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at java.io.FileReader.<init>(FileReader.java:58)
at ideliance.core.config.ApplicationContext.<init>(ApplicationContext.java:23)
at ideliance.core.config.ApplicationContext.getInstance(ApplicationContext.java:39)
at ideliance.servlet.right.ViewFilter.init(ViewFilter.java:39)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Oct 25, 2013 6:44:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8090"]
Oct 25, 2013 6:44:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Oct 25, 2013 6:44:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 795 ms
Oct 25, 2013 6:45:17 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [connection] in context with path [] threw exception
java.lang.NullPointerException
at ideliance.servlet.connection.ConnectionFilter.doFilter(ConnectionFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744) |
Le problème, c'est que n'ayant jamais rencontré ce problème lorsque je travaillais sur ce projet, je ne sais pas où mon projet va chercher ce fichier!
J'ai essayé de le copier à plusieurs endroits de mon arbo Eclipse (WEB-INF, WEB-INF/src, dans le dossier TOMCAT_HOME/webapps/MonProjet/WEB-INF/src/), mais le résultat est le même!
Voici le contenu de la classe ApplicationContext.java:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| package ideliance.core.config;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import org.apache.log4j.Logger;
@SuppressWarnings("serial")
public class ApplicationContext extends Properties {
private static final Logger log = Logger.getLogger(ApplicationContext.class);
private static final String PROPERTIES_FILE = "ideliance.properties";
private static ApplicationContext _instance = null;
private ApplicationContext() {
try {
FileReader fileReader = new FileReader(PROPERTIES_FILE);
try {
load(fileReader);
} finally {
fileReader.close();
}
} catch (FileNotFoundException e) {
log.error("This file does not exist : " + PROPERTIES_FILE, e);
} catch (IOException e) {
log.error("An error occurs during the context initialization", e);
}
}
public static ApplicationContext getInstance() {
if (_instance == null) {
_instance = new ApplicationContext();
}
return _instance;
}
public int getIntProperty(String key, int defaultValue) {
int nb;
String property = getProperty(key);
try {
nb = Integer.parseInt(property);
} catch (NumberFormatException e) {
nb = defaultValue;
}
return nb;
}
} |
Pourriez-vous me donner une piste?
Autre question: dois-je inclure les JAR contenus dans le dossier WEB-INF/lib de mon projet Tomcat sous l'onglet Classpath/User Entries de mon serveur?
Quoi qu'il en soit, le résultat reste le même.
Merci d'avance.