We are occassionally having some trouble, with major impact, starting up the application in the browser. The issue vanishes after restarting the server (IBM WSphere). Is this a known issue? Feedback would be much appreciated.
SmartClient Version: v9.0p_2013-09-22/PowerEdition Deployment (built 2013-09-22)
2. IE 9, Version: 9.0.8112.16421
Have by now tried to configure the log settings, but the com.isomorphic.velocity.Velocity class seems to be looking for the SimpleLog4JLogSystem class!
UPDATE:
Looking at the source of com.isomorphic.datasource.DataSourceDMI.java and com.isomorphic.velocity.Velocity.java, it seems like the properties used to initialise the apache VelocityEngine is hardcoded and the engine is retrieved via static definitions, preventing us to overwrite the definition. Any possible workarounds?
SmartClient Version: v9.0p_2013-09-22/PowerEdition Deployment (built 2013-09-22)
2. IE 9, Version: 9.0.8112.16421
Code:
[1/10/14 15:01:52:690 CET] 00000057 SystemOut O - dsRequest.execute() failed: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.SimpleLog4JLogSystem with the current runtime configuration. at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:875) at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262) at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:646) at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116) at com.isomorphic.velocity.Velocity.getEngine(Velocity.java:84) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:321) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2427) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:215) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:172) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:137) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73) at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1225) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:246) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3763) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:166) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1691) Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.SimpleLog4JLogSystem with the current runtime configuration. at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:220) at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269) at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871) ... 43 more Caused by: java.lang.ClassCastException: java.util.Vector incompatible with java.lang.String at org.apache.velocity.runtime.log.SimpleLog4JLogSystem.init(SimpleLog4JLogSystem.java:70) at org.apache.velocity.runtime.log.LogChuteSystem.init(LogChuteSystem.java:53) at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:166) ... 45 more
Have by now tried to configure the log settings, but the com.isomorphic.velocity.Velocity class seems to be looking for the SimpleLog4JLogSystem class!
Code:
final VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, Log4JLogChute.class.getName()); ve.setProperty("runtime.log.logsystem.log4j.category", "velocity"); ve.init();
Looking at the source of com.isomorphic.datasource.DataSourceDMI.java and com.isomorphic.velocity.Velocity.java, it seems like the properties used to initialise the apache VelocityEngine is hardcoded and the engine is retrieved via static definitions, preventing us to overwrite the definition. Any possible workarounds?
Code:
public class DataSourceDMI implements IScriptSource, FreeResourcesHandler { ... public DSResponse execute() throws Exception { ... VelocityEngine vEngine = Velocity.getEngine(); ... } protected VelocityEngine getVelocityEngine() throws Exception { VelocityEngine vEngine = new VelocityEngine(); Properties properties = new Properties(); properties.put("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem"); properties.put("runtime.log.logsystem.log4j.category", "org.apache.Velocity"); vEngine.init(properties); return vEngine; } ... }
Code:
public class Velocity extends Base { public Velocity() { } public static VelocityEngine getEngine() throws Exception { if(vEngine != null) { return vEngine; } else { vEngine = new VelocityEngine(); Properties properties = new Properties(); properties.put("file.resource.loader.path", ""); properties.put("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem"); properties.put("runtime.log.logsystem.log4j.category", "org.apache.Velocity"); vEngine.init(properties); return vEngine; } } .... }
Comment