velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PeteTh <peteli...@gmail.com>
Subject Re: Re: getTemplate() Nullpointer but Velocity is initialised - HELP
Date Tue, 21 Aug 2007 10:59:50 GMT

I have also posted on the Struts Menu mailing list but no response at there. 

I'm sure its something to do with using Velocity twice in an app, I have
also found the src code in Struts Menu where Velocity init() is called :- 

public class VelocityMenuDisplayer extends MessageResourcesMenuDisplayer {
    protected static final Log log =
LogFactory.getLog(VelocityMenuDisplayer.class);
    private static VelocityEngine velocityEngine = new VelocityEngine();
    private PageContext pageContext = null;

    public static void initialize(ServletContext context) {
       
velocityEngine.setApplicationAttribute(ServletContext.class.getName(),
context);

        // default to servletlogger, which logs to the servlet engines log
       
velocityEngine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
                             ServletLogger.class.getName());

        // by default, load resources with webapp resource loader
        velocityEngine.setProperty(RuntimeConstants.RESOURCE_LOADER,
"webapp");
        velocityEngine.setProperty("webapp.resource.loader.class",
WebappLoader.class.getName());

        // now all is ready - init Velocity
        try {
            Properties props = new Properties();
            ResourceBundle defaults =
ResourceBundle.getBundle("net.sf.navigator.displayer.velocity");
            for (Enumeration keys = defaults.getKeys();
keys.hasMoreElements();) {
                String key = (String) keys.nextElement();
                props.put(key, defaults.getString(key));
            }

            // look to see if the user has overridden velocity.properties by
            // placing velocity.properties in WEB-INF/classes
            ResourceBundle custom = null;

            try {
                custom = ResourceBundle.getBundle("velocity");
                for (Enumeration keys = custom.getKeys();
keys.hasMoreElements();) {
                    String key = (String) keys.nextElement();
                    props.put(key, custom.getString(key));
                }
            } catch (MissingResourceException mre) {
                log.debug("No velocity.properties found in classpath, using
default settings");
            }

            velocityEngine.init(props);
        } catch (Exception e) {
            log.error("Error initializing Velocity: " + e.getMessage());
            e.printStackTrace();
        }
    }

Any further thoughts ?


Nathan Bubna wrote:
> 
> I looked at line 831 of Velocity 1.4's RuntimeInstance, and
> unfortunately, the only possible way to get an NPE there is if that
> RuntimeInstance was not initialized.
> 
> Since there is some RuntimeInstance being initialized (according to
> the Tomcat logs), it appears that the problem is that the instance
> VelocityMenuDisplayer is trying to use has not been initialized.  I'm
> not familiar with StrutsMenu, so i don't know how it is getting its
> VelocityEngine.   All i can say is that the VelocityEngine it is
> trying to use has not been initialized, regardless of whether or not
> some other one has been initialized.
> 
> On 8/20/07, PeteTh <petelists@gmail.com> wrote:
>>
>> Hi,
>>
>> I would very much appreciate some help, this deployment problem has
>> driven
>> me almost mad for the last couple of days.
>>
>> I'm using Struts Menu with a Velocity Macro (Velocity 1.4) as the
>> renderer.
>> All works fine in Windows o/s with both Tomcat Version 5.5.20 or Jetty -
>> BUT
>> when I deploy to Unix running Tomcat 5.5.17 I get a NullPointerException
>> when getTemplate() is called (I think the template name is
>> menuItemCommon.vm) matching the config=  see below)
>>
>> nav.jsp :-
>>
>>                 <menu:useMenuDisplayer name="Velocity"
>> config="menuItemCommon.vm"
>> permissions="rolesAdapter">
>>                   <menu:displayMenu name="UploadFile"/>
>>                   <menu:displayMenu name="WorkInProgress"/>
>>                 </menu:useMenuDisplayer>
>>
>> Reading the mailing list it sounded like Velocity may not be initialised,
>> but the Tomcat logs show that it is. We were already using Spring's
>> org.springframework.ui.velocity.VelocityEngineFactoryBean as we use
>> Velocity
>> for email templates, so we already have :-
>>
>>     <bean id="velocityEngine"
>>          
>> class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
>>         <property name="velocityProperties">
>>             <props>
>>                 <prop key="resource.loader">class</prop>
>>                 <prop key="class.resource.loader.class">
>>
>> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
>>                 </prop>
>>                 <prop key="velocimacro.library"></prop>
>>             </props>
>>         </property>
>>     </bean>
>>
>> Stacktraces and logs are at the end of this post.
>>
>> I thought the The Velocity Macro 'menuItemCommon.vm' perhaps was not
>> being
>> found, so I now have made sure it is in WEB-INF/classes and the root of
>> WEB-INF  but I still get this error - but as I say it only goes wrong in
>> unix environment with tomcat 5.5.17.
>>
>> The Struts Menu source where it goes wrong is :-
>>
>>   protected void displayComponents(MenuComponent menu)
>>     throws JspException, IOException {
>>         HttpServletRequest request = (HttpServletRequest)
>> pageContext.getRequest();
>>         Template t;
>>
>>         try {
>>             String template = getConfig();
>>
>>             if (template == null) {
>>                 throw new JspException("You must specify a template using
>> the 'config' attribute.");
>>             } else {
>>                 log.debug("using template: " + template);
>>             }
>>
>>             t = velocityEngine.getTemplate(template);
>>         } catch (Exception e) {
>>             String msg = "Error initializing Velocity: " + e.toString();
>>             log.error(msg, e);
>>             throw new JspException(msg, e);
>>         }
>>
>>
>> Here is the log of Velocity initializing :-
>>
>> 18 Aug 2007 23:52:21 [main] DEBUG
>> org.springframework.beans.factory.support.DefaultListableBeanFactory  -
>> Eagerly caching bean 'velocityEngine' to allow for resolving potential
>> circular references - AbstractAutowireCapableBeanFactory.java:396
>> 18 Aug 2007 23:52:21 [main] TRACE
>> org.springframework.beans.factory.support.DefaultListableBeanFactory  -
>> Not
>> autowiring property 'configLocation' of bean 'velocityEngine' by name: no
>> matching bean found - AbstractAutowireCapableBeanFactory.java:893
>> 18 Aug 2007 23:52:21 [main] TRACE
>> org.springframework.beans.factory.support.DefaultListableBeanFactory  -
>> Not
>> autowiring property 'resourceLoader' of bean 'velocityEngine' by name: no
>> matching bean found - AbstractAutowireCapableBeanFactory.java:893
>> 18 Aug 2007 23:52:21 [main] TRACE
>> org.springframework.beans.factory.support.DefaultListableBeanFactory  -
>> Not
>> autowiring property 'velocityPropertiesMap' of bean 'velocityEngine' by
>> name: no matching bean found -
>> AbstractAutowireCapableBeanFactory.java:893
>> 18 Aug 2007 23:52:22 [main] TRACE
>> org.springframework.core.CollectionFactory
>> - Creating [java.util.LinkedHashMap] - CollectionFactory.java:114
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> **************************************************************  -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Starting Jakarta Velocity v1.4 - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> RuntimeInstance initializing. - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Default Properties File:
>> org/apache/velocity/runtime/defaults/velocity.properties -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Default ResourceManager initializing. (class
>> org.apache.velocity.runtime.resource.ResourceManagerImpl) -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Resource Loader Instantiated:
>> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> ClasspathResourceLoader : initialization starting. -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> ClasspathResourceLoader : initialization complete. -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> ResourceCache : initialized. (class
>> org.apache.velocity.runtime.resource.ResourceCacheImpl) -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Default ResourceManager initialization complete. -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Loaded System Directive: org.apache.velocity.runtime.directive.Literal -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Loaded System Directive: org.apache.velocity.runtime.directive.Macro -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Loaded System Directive: org.apache.velocity.runtime.directive.Parse -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Loaded System Directive: org.apache.velocity.runtime.directive.Include -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Loaded System Directive: org.apache.velocity.runtime.directive.Foreach -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Created: 20 parsers. - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : initialization starting. - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : allowInline = true : VMs can be defined inline in templates
>> -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT
>> replace previous VM definitions - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : allowInlineLocal = false : VMs defined inline will be 
>> global
>> in scope if allowed. - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : messages on  : VM system will output logging messages -
>> CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : autoload off  : VM system will not automatically reload
>> global
>> library macros - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocimacro : initialization complete. - CommonsLoggingLogSystem.java:49
>> 18 Aug 2007 23:52:22 [main] INFO  org.apache.velocity.app.VelocityEngine 
>> -
>> Velocity successfully started. - CommonsLoggingLogSystem.java:49
>>
>>
>> Stacktrace :-
>>
>> 18 Aug 2007 23:52:37 [TP-Processor1] DEBUG
>> net.sf.navigator.taglib.UseMenuDisplayerTag  - setting config to:
>> menuItemCommon.vm - UseMenuDisplayerTag.java:71
>> 18 Aug 2007 23:52:37 [TP-Processor1] DEBUG
>> net.sf.navigator.taglib.UseMenuDisplayerTag  - Looking for repository
>> named
>> 'net.sf.navigator.menu.MENU_REPOSITORY' - UseMenuDisplayerTag.java:132
>> 18 Aug 2007 23:52:37 [TP-Processor1] DEBUG
>> net.sf.navigator.taglib.UseMenuDisplayerTag  - stuffing repository into
>> pageContext... - UseMenuDisplayerTag.java:145
>> 18 Aug 2007 23:52:37 [TP-Processor1] TRACE
>> net.sf.navigator.util.PropertyMessageResources  - Initializing,
>> config='menuItemCommon.vm', returnNull=true -
>> PropertyMessageResources.java:83
>> 18 Aug 2007 23:52:37 [TP-Processor1] DEBUG
>> net.sf.navigator.displayer.VelocityMenuDisplayer  - using template:
>> menuItemCommon.vm - VelocityMenuDisplayer.java:102
>> 18 Aug 2007 23:52:37 [TP-Processor1] ERROR
>> net.sf.navigator.displayer.VelocityMenuDisplayer  - Error initializing
>> Velocity: java.lang.NullPointerException - VelocityMenuDisplayer.java:108
>> java.lang.NullPointerException
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
>>         at
>> org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:470)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.displayComponents(VelocityMenuDisplayer.java:105)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.display(VelocityMenuDisplayer.java:87)
>>         at
>> net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:100)
>>         at
>> net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_displayMenu_0(mainLayout_jsp.java:293)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_useMenuDisplayer_0(mainLayout_jsp.java:259)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspService(mainLayout_jsp.java:124)
>>         at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>>         at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>>         at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:216)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:195)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>         at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>         at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>         at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>         at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>         at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>         at
>> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
>>         at
>> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
>>         at
>> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
>>         at
>> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
>>         at
>> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
>>         at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>         at java.lang.Thread.run(Thread.java:595)
>> 18 Aug 2007 23:52:37 [TP-Processor1] ERROR
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/marj].[jsp]
>> - Servlet.service() for servlet jsp threw exception -
>> ApplicationDispatcher.java:704
>> java.lang.NullPointerException
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
>>         at
>> org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:470)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.displayComponents(VelocityMenuDisplayer.java:105)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.display(VelocityMenuDisplayer.java:87)
>>         at
>> net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:100)
>>         at
>> net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_displayMenu_0(mainLayout_jsp.java:293)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_useMenuDisplayer_0(mainLayout_jsp.java:259)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspService(mainLayout_jsp.java:124)
>>         at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>>         at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>>         at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:216)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:195)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>         at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>         at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>         at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>         at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>         at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>         at
>> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
>>         at
>> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
>>         at
>> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
>>         at
>> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
>>         at
>> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
>>         at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>         at java.lang.Thread.run(Thread.java:595)
>> 18 Aug 2007 23:52:37 [TP-Processor1] DEBUG
>> org.acegisecurity.context.HttpSessionContextIntegrationFilter  -
>> SecurityContextHolder set to new context, as request processing completed
>> -
>> HttpSessionContextIntegrationFilter.java:257
>> 18 Aug 2007 23:52:37 [TP-Processor1] ERROR
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/marj].[dispatcher]
>> - Servlet.service() for servlet dispatcher threw exception -
>> StandardWrapperValve.java:253
>> java.lang.NullPointerException
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
>>         at
>> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
>>         at
>> org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:470)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.displayComponents(VelocityMenuDisplayer.java:105)
>>         at
>> net.sf.navigator.displayer.VelocityMenuDisplayer.display(VelocityMenuDisplayer.java:87)
>>         at
>> net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:100)
>>         at
>> net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_displayMenu_0(mainLayout_jsp.java:293)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspx_meth_menu_useMenuDisplayer_0(mainLayout_jsp.java:259)
>>         at
>> org.apache.jsp.common.decorator.mainLayout_jsp._jspService(mainLayout_jsp.java:124)
>>         at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
>>         at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>>         at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
>>         at
>> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
>>         at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>>         at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:216)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:195)
>>         at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>         at
>> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>         at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>         at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>         at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>         at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>         at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>         at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>         at
>> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
>>         at
>> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
>>         at
>> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
>>         at
>> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
>>         at
>> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
>>         at
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>         at java.lang.Thread.run(Thread.java:595)
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/getTemplate%28%29-Nullpointer-but-Velocity-is-initialised---HELP-tf4299522.html#a12237939
>> Sent from the Velocity - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/getTemplate%28%29-Nullpointer-but-Velocity-is-initialised---HELP-tf4299522.html#a12252465
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message