7 Replies Latest reply on Mar 3, 2012 10:21 AM by raj_at_cq

    NPE for currentDesign

    raj_at_cq

      All of a sudden we are seeing NPE on our pages with currentDesign which is set by <ca:defineObjects> taglib.

       

      currentDesign.getDoctype(currentStyle).toRequest(request);

       

      Any info as to why this would happen and better ways to avoid these kinds of issues for all objects the tablig defines.

       

      Thanks

      Rajesh

        • 1. Re: NPE for currentDesign
          Sham HC Level 7

          Hi Rajesh,

           

            Is it happening randomly ?  Restart the server and see if it helps.   Please file a daycare ticket with all the logs to investigate further.

           

          Thanks,

          Sham

          • 2. Re: NPE for currentDesign
            reusr1 Level 2

            I would venture a guess and say you are missing the

            /etc/designs/yourdesign/jcr:content node

             

            Ruben

            • 3. Re: NPE for currentDesign
              raj_at_cq Level 1

              I see the my node exists in this case

              /etc/designs/yourdesign/jcr:content node, but still getting NPE.

               

              Will raise a daycare ticktet if there is no quick solution by the way restart didnt help either and this is the first time it happened.

              • 4. Re: NPE for currentDesign
                Davide G Adobe Employee

                What is giving you NPE? currentDesign or getDoctype()?

                 

                Davide

                • 5. Re: NPE for currentDesign
                  raj_at_cq Level 1

                  I see npe thrown at currentDesign.getDoctype(currentStyle).ToRequest(request);

                  From my compiled jsp class, which I believe is design is null.

                  • 6. Re: NPE for currentDesign
                    Davide G Adobe Employee

                    Post the full stacktrace.

                    • 7. Re: NPE for currentDesign
                      raj_at_cq Level 1

                      Here is the logs

                       

                      (500)

                      The requested URL /content/homepage/en/index.html resulted in an error in /apps/common/components/page/globalbase/globalbase.jsp.

                      Exception:

                       

                      org.apache.sling.api.SlingException: 

                              at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInterna l(JspServletWrapper.java:563)

                              at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspSer vletWrapper.java:499)

                              at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:451)

                              at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter. java:59)

                              at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :233)

                              at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:85)

                              at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:453)

                              at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)

                      <SNIP>

                              at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProces sorImpl.java:320)

                              at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatch er.java:208)

                              at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatche r.java:102)

                              at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponent Filter.java:381)

                              at org.apache.jsp.libs.foundation.components.primary.cq.Page.Page_jsp._jspService(Page_jsp.j ava:106)

                              at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                              at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

                              at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:420)

                              ... 154 more

                      Caused by: java.lang.NullPointerException

                              at org.apache.jsp.apps.common.components.page.globalbase.globalbase_jsp._jspService(globalba se_jsp.java:180)

                              at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                              at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

                              at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:420)

                              ... 180 more

                      Request Progress:

                       

                            0 (2012-03-02 14:55:45) TIMER_START{Request Processing}

                            0 (2012-03-02 14:55:45) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message>

                            1 (2012-03-02 14:55:45) LOG Method=GET, PathInfo=/content/homepage/en/index.html

                            1 (2012-03-02 14:55:45) TIMER_START{ResourceResolution}

                            6 (2012-03-02 14:55:45) TIMER_END{5,ResourceResolution} URI=/content/homepage/en/index.html resolves to Resource=JcrNodeResource, type=cq:Page, superType=null, path=/content/homepage/en/index

                            6 (2012-03-02 14:55:45) LOG Resource Path Info: SlingRequestPathInfo: path='/content//homepage/en/index', selectorString='null', extension='html', suffix='null'

                            6 (2012-03-02 14:55:45) TIMER_START{ServletResolution}

                            6 (2012-03-02 14:55:45) TIMER_START{resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/homepage/en/index)}

                           38 (2012-03-02 14:55:45) TIMER_END{32,resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/homepage/en/index)} Using servlet /libs/foundation/components/primary/cq/Page/Page.jsp

                           38 (2012-03-02 14:55:45) TIMER_END{32,ServletResolution} URI=/content//homepage/en/index.html handled by Servlet=/libs/foundation/components/primary/cq/Page/Page.jsp

                           38 (2012-03-02 14:55:45) LOG Applying Requestfilters

                           38 (2012-03-02 14:55:45) LOG Calling filter: org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: org.apache.sling.portal.container.internal.request.PortalFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.theme.impl.ThemeResolverFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet

                           39 (2012-03-02 14:55:45) LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter

                           39 (2012-03-02 14:55:45) LOG Calling filter: com..ecom.cq.bundle.helpers.internal.ParagraphsServletFilter

                           40 (2012-03-02 14:55:45) LOG Calling filter: com..ecom.cq.bundle.helpers.internal.CampaignsOverviewFilter

                           40 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter

                           41 (2012-03-02 14:55:45) LOG RedirectFilter did not redirect (MobileUtil.isMobileResource() returns false)

                           41 (2012-03-02 14:55:45) LOG Applying Componentfilters

                           41 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter

                           46 (2012-03-02 14:55:45) LOG Calling filter: com..ecom.cq.bundle.reporting.impl.ComponentPathWrappingFilter

                           70 (2012-03-02 14:55:45) LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html],order=5, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config=org.apache.sling.jcr.resource.JcrPropertyMap@5a431ae9), transformers=(Config(type=-reporting-links, config=org.apache.sling.jcr.resource.JcrPropertyMap@6b9be54a), Config(type=linkchecker, config={}), Config(type=mobile, config=org.apache.sling.jcr.resource.JcrPropertyMap@47ea9477), Config(type=mobiledebug, config=org.apache.sling.jcr.resource.JcrPropertyMap@79b93583), Config(type=client-library-script-rewriter, config=org.apache.sling.jcr.resource.JcrPropertyMap@6e6869e3), serializer=Config(type=htmlwriter, config={}))}

                           72 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter

                           72 (2012-03-02 14:55:45) TIMER_START{/libs/foundation/components/primary/cq/Page/Page.jsp#0}

                           96 (2012-03-02 14:55:45) LOG Including resource JcrNodeResource, type=/mktg/components/page/homepage, superType=null, path=/content/homepage/en/index/jcr:content (SlingRequestPathInfo: path='/content//homepage/en/index/jcr:content', selectorString='null', extension='html', suffix='null')

                           96 (2012-03-02 14:55:45) TIMER_START{resolveServlet(JcrNodeResource, type=/mktg/components/page/homepage, superType=null, path=/content/homepage/en/index/jcr:content)}

                          161 (2012-03-02 14:55:45) TIMER_END{65,resolveServlet(JcrNodeResource, type=/mktg/components/page/homepage, superType=null, path=/content/homepage/en/index/jcr:content)} Using servlet /apps//common/components/page/globalbase/globalbase.jsp

                          161 (2012-03-02 14:55:45) LOG Applying Includefilters

                          162 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter

                          165 (2012-03-02 14:55:45) LOG Calling filter: com..ecom.cq.bundle.reporting.impl.ComponentPathWrappingFilter

                          167 (2012-03-02 14:55:45) LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter

                          167 (2012-03-02 14:55:45) TIMER_START{/apps//common/components/page/globalbase/globalbase.jsp#1}

                        10698 (2012-03-02 14:55:56) LOG SCRIPT ERROR: An exception occurred processing JSP page /apps//common/components/page/globalbase/globalbase.jsp at line 47

                        10698 (2012-03-02 14:55:56) TIMER_END{10531,/apps/common/components/page/globalbase/globalbase.jsp#1}

                        10717 (2012-03-02 14:55:56) LOG SCRIPT ERROR: 

                        10717 (2012-03-02 14:55:56) TIMER_END{10645,/libs/foundation/components/primary/cq/Page/Page.jsp#0}

                        10739 (2012-03-02 14:55:56) TIMER_START{handleError:throwable=org.apache.sling.api.SlingException}

                        10889 (2012-03-02 14:55:56) TIMER_END{150,handleError:throwable=org.apache.sling.api.SlingException} Using handler org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet

                        10928 (2012-03-02 14:55:56) TIMER_END{10928,Request Processing} Dumping SlingRequestProgressTracker Entries