4 Replies Latest reply on Feb 14, 2014 8:19 PM by mtuljapurkar

    Error on creating a basic widget

    santhosh

      Hi,

       

      I am trying to create a basic hello world widget, following the steps suggested by Ryan in a document 'Building widgets'. But I am facing an error- 'Freemarker template error'. Can anybody help on this?

       

      Thanks and Regards,

      Santhosh

        • Re: Error on creating a basic widget
          mtuljapurkar

          Can you post the exception from the log file?

            • Re: Error on creating a basic widget
              santhosh

              Hi,

               

              Below are the exceptions.

               

              FreeMarker template error!

               

              Method public abstract java.lang.String com.jivesoftware.community.widget.view.WidgetRenderer.render() threw an exception when invoked on com.jivesoftware.community.widget.ext.impl.DefaultExtWidgetProvider$DefaultWidgetRenderer@2b056b8d

              The problematic instruction:

              ----------

              ==> ${widget.render()} [on line 101, column 43 in template/widget/util/widget-macros.ftl]

              in user-directive renderWidgetBody [on line 80, column 13 in template/widget/util/widget-macros.ftl]

              in user-directive jive.displayWidgetFrame [on line 3, column 9 in template/global/widget-frame.ftl]

              ----------

               

               

              Java backtrace for programmers:

              ----------

              freemarker.template.TemplateModelException: Method public abstract java.lang.String com.jivesoftware.community.widget.view.WidgetRenderer.render() threw an exception when invoked on com.jivesoftware.community.widget.ext.impl.DefaultExtWidgetProvider$DefaultWidgetRenderer@2b056b8d

                at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)

                at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)

                at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)

                at freemarker.core.Expression.getStringValue(Expression.java:93)

                at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.MixedContent.accept(MixedContent.java:92)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.Macro$Context.runMacro(Macro.java:168)

                at freemarker.core.Environment.visit(Environment.java:606)

                at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.MixedContent.accept(MixedContent.java:92)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.IfBlock.accept(IfBlock.java:82)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.MixedContent.accept(MixedContent.java:92)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.MixedContent.accept(MixedContent.java:92)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.Macro$Context.runMacro(Macro.java:168)

                at freemarker.core.Environment.visit(Environment.java:606)

                at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.MixedContent.accept(MixedContent.java:92)

                at freemarker.core.Environment.visit(Environment.java:213)

                at freemarker.core.Environment.process(Environment.java:193)

                at com.jivesoftware.community.web.struts.FreemarkerResult.doExecute(FreemarkerResult.java:151)

                at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)

                at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:320)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)

                at com.jivesoftware.community.web.struts.JiveWorkflowInterceptor.doIntercept(JiveWorkflowInterceptor.java:121)

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:129)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.web.struts.JiveConversionErrorInterceptor.intercept(JiveConversionErrorInterceptor.java:40)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.action.LocaleInterceptor.intercept(LocaleInterceptor.java:80)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.web.struts.JivePrepareInterceptor.doIntercept(JivePrepareInterceptor.java:57)

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.web.struts.RequireFeatureInterceptor.intercept(RequireFeatureInterceptor.java:36)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.web.struts.ModuleCheckInterceptor.intercept(ModuleCheckInterceptor.java:47)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.action.LockoutInterceptor.intercept(LockoutInterceptor.java:44)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.aaa.authz.GuestAuthorizationInterceptor.intercept(GuestAuthorizationInterceptor.java:73)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.action.unsupportedbrowser.UnsupportedBrowserInterceptor.intercept(UnsupportedBrowserInterceptor.java:62)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at com.jivesoftware.community.web.struts.JiveRefererInterceptor.intercept(JiveRefererInterceptor.java:35)

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:211)

                at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)

                at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)

                at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)

                at com.jivesoftware.community.web.struts.JiveFilterDispatcher.doFilter(JiveFilterDispatcher.java:108)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.SetResponseCharacterEncodingFilter.doFilter(SetResponseCharacterEncodingFilter.java:63)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.RequireXHRFilter.doFilterInternal(RequireXHRFilter.java:40)

                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.ActivityRequestFilter.doFilter(ActivityRequestFilter.java:100)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.directwebremoting.servlet.DwrWebContextFilter.doFilter(DwrWebContextFilter.java:91)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.base.plugin.PluginFilter.doFilter(PluginFilter.java:73)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.robots.RobotDetectorFilter.doFilterInternal(RobotDetectorFilter.java:62)

                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)

                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.aaa.UserResponseHeaderFilter.doFilter(UserResponseHeaderFilter.java:45)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.user.registration.TermsAndConditionsAcceptanceFilter.doFilter(TermsAndConditionsAcceptanceFilter.java:68)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.lifecycle.spring.ContextOptimizationFilter.doFilter(ContextOptimizationFilter.java:46)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.PartnerUserCheckFilter.doFilter(PartnerUserCheckFilter.java:39)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.JiveBasicAuthenticationFilter.doFilter(JiveBasicAuthenticationFilter.java:37)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                at com.jivesoftware.community.aaa.sso.kerberos.JiveSpnegoAuthenticationProcessingFilter.doFilterHttp(JiveSpnegoAuthenticationProcessingFilter.java:91)

                at com.jivesoftware.community.aaa.sso.kerberos.JiveSpnegoAuthenticationProcessingFilter.doFilter(JiveSpnegoAuthenticationProcessingFilter.java:48)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                at org.springframework.security.saml.SAMLLogoutProcessingFilter.processLogout(SAMLLogoutProcessingFilter.java:171)

                at org.springframework.security.saml.SAMLLogoutProcessingFilter.doFilter(SAMLLogoutProcessingFilter.java:94)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.sso.saml.filter.JiveSAMLLogoutFilter.doFilter(JiveSAMLLogoutFilter.java:56)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.sso.saml.filter.JiveSAMLEntryPoint.doFilter(JiveSAMLEntryPoint.java:111)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.JiveRememberMeAuthenticationFilter.doFilter(JiveRememberMeAuthenticationFilter.java:79)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at com.jivesoftware.community.aaa.stateless.filter.NodeFailoverTestModeFilter.doFilter(NodeFailoverTestModeFilter.java:36)

                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.base.profiling.http.RequestProfilingFilter.doFilter(RequestProfilingFilter.java:47)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.P3PCompactPolicyFilter.doFilter(P3PCompactPolicyFilter.java:48)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.RemoveJsessionIdFilter.doFilter(RemoveJsessionIdFilter.java:40)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.ApplicationStateFilter.doFilter(ApplicationStateFilter.java:157)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:50)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.ResourceRoutingFilter.doFilter(ResourceRoutingFilter.java:44)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.base.profiling.http.ServerLatencyFilter.doFilter(ServerLatencyFilter.java:62)

                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:76)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at com.jivesoftware.community.web.filter.DispatchContextResetFilter.doFilter(DispatchContextResetFilter.java:39)

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

                at java.lang.Thread.run(Thread.java:662)

              Caused by: java.lang.NullPointerException

                at com.jivesoftware.community.widget.BaseWidget.applyFreemarkerTemplate(BaseWidget.java:243)

                at myFirstPlugin.render(myFirstPlugin.java:30)

                at com.jivesoftware.community.widget.ext.impl.DefaultExtWidgetProvider$DefaultWidgetRenderer.render(DefaultExtWidgetProvider.java:238)

                at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:842)

                at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)

                ... 238 more

              1 person found this helpful
              • Re: Error on creating a basic widget
                santhosh

                The code can be found below-

                 

                 

                 

                import com.jivesoftware.community.annotations.PropertyNames;

                import com.jivesoftware.community.widget.*;

                import java.util.Map;

                 

                 

                @WidgetTypeMarker({WidgetType.PROJECT, WidgetType.HOMEPAGE, WidgetType.COMMUNITY, WidgetType.CONTAINER, WidgetType.SOCIALGROUP})

                @PropertyNames("myProperty")

                public class myFirstPlugin extends BaseWidget {

                 

                 

                    private boolean greetUser=false;

                    private String FREEMARKER_FILE = "/plugins/myFirstPlugin/resources/templates/hello-world.ftl";

                    //private String file1= "/";

                    public String getTitle(WidgetContext widgetContext) {

                        return "My First Widget";

                    }

                 

                 

                    public String getDescription(WidgetContext widgetContext) {

                        return "Displays some message";

                    }

                 

                 

                    public boolean getGreetUser(){

                        return greetUser;

                    }

                 

                 

                    public void setGreetUser(boolean greetUser){

                        this.greetUser=greetUser;

                    }

                 

                 

                    public String render(WidgetContext widgetContext, ContainerSize containerSize) {

                        return applyFreemarkerTemplate(widgetContext,containerSize,FREEMARKER_FILE);

                    }

                 

                 

                    protected Map<String, Object> loadProperties(WidgetContext widgetContext,ContainerSize containerSize){

                        Map<String, Object> properties=super.loadProperties(widgetContext,containerSize);

                        //String communityName=((CommunityWidgetContext)widgetContext).getCommunity().getName();

                        String userName=widgetContext.getUser().getName();

                        properties.put("communityName","Test");

                        properties.put("userName", userName);

                        properties.put("greetUser", greetUser);

                        return properties;

                    }

                }

                1 person found this helpful