VelocityServlet.loadConfiguration(...) can not resolve propsFile, returns empty
Properties
------------------------------------------------------------------------------------------
Key: VELOCITY-778
URL: https://issues.apache.org/jira/browse/VELOCITY-778
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.6.4
Reporter: Rafał Miłecki
My web.xml contains following code:
<context-param>
<param-name>properties</param-name>
<param-value>WEB-INF/conf/velocity.properties</param-value>
</context-param>
I get following exception and backtrace:
javax.servlet.ServletException: Error configuring the loader:
java.io.FileNotFoundException: WEB-INF/conf/velocity.properties (No such file
or directory)
org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:213)
pl.put.platon.common.PlatonServlet.init(PlatonServlet.java:173)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:636)
There is following comment in VelocityServlet code:
/*
* This will attempt to find the location of the properties
* file from the relative path to the WAR archive (ie:
* docroot). Since JServ returns null for getRealPath()
* because it was never implemented correctly, then we know we
* will not have an issue with using it this way. I don't know
* if this will break other servlet engines, but it probably
* shouldn't since WAR files are the future anyways.
*/
So the problem is that config.getInitParameter(INIT_PROPS_KEY) returns:
WEB-INF/conf/velocity.properties
which (path) doesn't work for Properties.load(...)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]