You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Felipe Maschio (JIRA)" <de...@velocity.apache.org> on 2011/05/28 00:03:47 UTC
[jira] [Created] (VELOCITY-804) RuntimeInstance throws exception on
init() but stay with "initializing" state
RuntimeInstance throws exception on init() but stay with "initializing" state
-----------------------------------------------------------------------------
Key: VELOCITY-804
URL: https://issues.apache.org/jira/browse/VELOCITY-804
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.7
Environment: Linux
Reporter: Felipe Maschio
Fix For: 1.7.x
init() throws an exception and below is the cause:
Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)
That's ok, I just need to change the permissions on webapps directory from my tomcat. But I needed to restart the server because the "initializing" param is true yet.
This is my sugestion to fix that (just a try{}funally{}):
public synchronized void init()
throws Exception
{
if (!initialized && !initializing)
{
try {
initializing = true;
log.trace("*******************************************************************");
log.debug("Starting Apache Velocity v@build.version@ (compiled: @build.time@)");
log.trace("RuntimeInstance initializing.");
initializeProperties();
initializeLog();
initializeResourceManager();
initializeDirectives();
initializeEventHandlers();
initializeParserPool();
initializeIntrospection();
/*
* initialize the VM Factory. It will use the properties
* accessable from Runtime, so keep this here at the end.
*/
vmFactory.initVelocimacro();
log.trace("RuntimeInstance successfully initialized.");
}
finally {
initializing = false;
}
initialized = true;
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] [Commented] (VELOCITY-804) RuntimeInstance throws exception
on init() but stay with "initializing" state
Posted by "Felipe Maschio (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112883#comment-13112883 ]
Felipe Maschio commented on VELOCITY-804:
-----------------------------------------
Really? no one will fix it? I had a lot of problems because it.
> RuntimeInstance throws exception on init() but stay with "initializing" state
> -----------------------------------------------------------------------------
>
> Key: VELOCITY-804
> URL: https://issues.apache.org/jira/browse/VELOCITY-804
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.7
> Environment: Linux
> Reporter: Felipe Maschio
> Fix For: 1.7.x
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> init() throws an exception and below is the cause:
> Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)
> That's ok, I just need to change the permissions on webapps directory from my tomcat. But I needed to restart the server because the "initializing" param is true yet.
> This is my sugestion to fix that (just a try{}funally{}):
> public synchronized void init()
> throws Exception
> {
> if (!initialized && !initializing)
> {
> try {
> initializing = true;
> log.trace("*******************************************************************");
> log.debug("Starting Apache Velocity v@build.version@ (compiled: @build.time@)");
> log.trace("RuntimeInstance initializing.");
> initializeProperties();
> initializeLog();
> initializeResourceManager();
> initializeDirectives();
> initializeEventHandlers();
> initializeParserPool();
> initializeIntrospection();
> /*
> * initialize the VM Factory. It will use the properties
> * accessable from Runtime, so keep this here at the end.
> */
> vmFactory.initVelocimacro();
> log.trace("RuntimeInstance successfully initialized.");
> }
> finally {
> initializing = false;
> }
> initialized = true;
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org