[
https://issues.apache.org/jira/browse/VELOCITY-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henning Schmiedehausen closed VELOCITY-131.
-------------------------------------------
> calling Velocity.setProperty() is not immutable
> -----------------------------------------------
>
> Key: VELOCITY-131
> URL: https://issues.apache.org/jira/browse/VELOCITY-131
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.3-rc1
> Environment: Operating System: other
> Platform: Other
> Reporter: David Geise
> Assigned To: Velocity-Dev List
>
> Calling Velocity.setProperty() does not appear to work after the call to
> Velocity.init(), but it does work before. Example:
> public void ejbCreate() {
> mLogger.info("Creating Velocity Template Engine");
> // initialize velocity template engine (currently using singleton model)
> try {
> Properties p = new Properties();
> p.setProperty("file.resource.loader.cache", "true");
> // cache resources
> p.setProperty("file.resource.loader.modificationCheckInterval","0");
> // don't poll for changes
> p.setProperty("file.resource.loader.path",
> LCFConfig.getApplicationContext().getRealPath("/") + "templates/");
> // load files from templates folder
> // hook Velocity into custom log4j wrapper to reduce spamming the
> logs
> at the INFO level
> // (wrapper demotes log INFO messages to DEBUG)
> p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
> VelocityLogger.class.getName());
> p.setProperty("runtime.log.logsystem.log4j.category",
> ContentGeneratorBean.class.toString());
> // configure and initialize velocity
> Velocity.init(p);
> // reset velocity logger to it's log4j default to allow post init
> messages (parse errors, etc through)
> // NOTE: THIS DOES NOT APPEAR TO HAVE ANY EFFECT.
> Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
> "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
> }
> catch (Exception e) {
> mLogger.error("Velocity initialization: general exception: " + e);
> return;
> }
> }
--
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]