You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Nathan Bubna (JIRA)" <de...@velocity.apache.org> on 2010/09/24 23:42:33 UTC
[jira] Resolved: (VELOCITY-778)
VelocityServlet.loadConfiguration(...) can not resolve propsFile, returns
empty Properties
[ https://issues.apache.org/jira/browse/VELOCITY-778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna resolved VELOCITY-778.
-----------------------------------
Resolution: Won't Fix
Sorry, but the VelocityServlet has been officially deprecated for about 4 years now (since 1.5-beta1). It has been inferior to VelocityTools' VelocityViewServlet (it's replacement) for much longer than that. It has numerous shortcomings and none of them will be fixed. In fact, nothing will be done to support new development with it, and issues like this make me want to yank it out of the upcoming 1.7 too. Or at least add some large and annoying documentation and log warnings to make sure people don't miss that it is deprecated.
Please do pull down VelocityViewServlet (preferrably from VelocityTools 2.0) and use that. It has no issues with /WEB-INF paths, as it gets the InputStream directly from the ServletContext. And next time, post questions on the user list before creating JIRA issues, otherwise i'm liable to continue earning a reputation as a grumpy developer. :)
> 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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org