You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "David M. Karr" <dm...@earthlink.net> on 2003/07/23 08:01:23 UTC

Problems with exercise-taglib, link tag, or modules?

I've been working on some minor updates to Struts-EL, to match recent changes
to the base tag library, so I've been running through some tests.  I'm using
WebLogic 8.1 for these tests.

I first noticed that the strutsel-exercise-taglib application dies with the
following stack trace:

-----------------
java.lang.NullPointerException
        at org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1591)
        at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:536)
        at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:431)
        at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
        at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
        at org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:675)
-----------------

Line 1591 is the following (after I added a couple of debugging lines):

        String pagePattern = moduleConfig.getControllerConfig().getPagePattern();

I found that "moduleConfig" is null here, but I don't know why.

Before I submit a bug for this, does anyone have an idea what might be
happening here?

In addition, I also found a problem in the base "struts-exercise-taglib".  The
link for the "html:link" page dies with the following stack trace:

-----------------
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
        at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:805)
        at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513)
        at jsp_servlet.__html_45_link._jspService(__html_45_link.java:226)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
-----------------

I hope this isn't something that only happens in WebLogic.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Problems with exercise-taglib, link tag, or modules?

Posted by adam kramer <ad...@monkey.org>.
On Wed, 22 Jul 2003, David M. Karr wrote:
> I've been working on some minor updates to Struts-EL, to match recent changes
> to the base tag library, so I've been running through some tests.  I'm using
> WebLogic 8.1 for these tests.
>
> I first noticed that the strutsel-exercise-taglib application dies with the
> following stack trace:
> -----------------
> java.lang.NullPointerException
>         at org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1591)
>         at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:536)
>         at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:431)
>         at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
>         at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
>         at org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:675)
> -----------------
>
> Line 1591 is the following (after I added a couple of debugging lines):
>
>         String pagePattern = moduleConfig.getControllerConfig().getPagePattern();
>
> I found that "moduleConfig" is null here, but I don't know why.
>
> Before I submit a bug for this, does anyone have an idea what might be
> happening here?
>

  This is most likely the bug I wrote about a couple days ago at
http://www.mail-archive.com/struts-dev%40jakarta.apache.org/msg16878.html

The moduleConfig was never stored in the request scope because
RequestUtils.selectModule() was never called by the actionservlet.  This
is because the page was not accessed through the ActionServlet (e.g. via
an action mapping), it is accessed directly from the view (jsp page).
selectModule sets the the module/subapp configuration instance and default
message resource in the request scope, and actionservlet calls it when
being processed.

I will post this as a bug since my original email didnt get any responses.
It encompasses any taglib that accesses a method (most likely a
RequestUtil method) that needs to access the module config instance or
default message resource in the request scope.

-Adam K.

--

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Problems with exercise-taglib, link tag, or modules?

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "adam" == adam kramer <ad...@monkey.org> writes:

    adam> On Wed, 22 Jul 2003, David M. Karr wrote:
    >> I've been working on some minor updates to Struts-EL, to match recent changes
    >> to the base tag library, so I've been running through some tests.  I'm using
    >> WebLogic 8.1 for these tests.
    >> 
    >> I first noticed that the strutsel-exercise-taglib application dies with the
    >> following stack trace:
    >> 
    >> -----------------
    >> java.lang.NullPointerException
    >> at org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1591)
    >> -----------------
    >> 
    >> Line 1591 is the following (after I added a couple of debugging lines):
    >> 
    >> String pagePattern = moduleConfig.getControllerConfig().getPagePattern();
    >> 
    >> I found that "moduleConfig" is null here, but I don't know why.

    adam>  Actually, I noticed computeURL has a backward compatibility hack that
    adam> gets the default app module config and stores it in the request scope if
    adam> one isn't already there. If you do have a recent version of struts built,
    adam> perhaps the webapp has an older version of struts installed. Maybe
    adam> replacing it with a fresh struts.jar would work.  It looks as though this
    adam> should not be happening. It doesn't happen when requesting html-link.jsp
    adam> in struts exercise-taglib webapp, but i havent installed struts-el.

My copy of "struts.jar" is built from CVS latest.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Problems with exercise-taglib, link tag, or modules?

Posted by adam kramer <ad...@monkey.org>.
On Wed, 22 Jul 2003, David M. Karr wrote:
> I've been working on some minor updates to Struts-EL, to match recent changes
> to the base tag library, so I've been running through some tests.  I'm using
> WebLogic 8.1 for these tests.
>
> I first noticed that the strutsel-exercise-taglib application dies with the
> following stack trace:
>
> -----------------
> java.lang.NullPointerException
>         at org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1591)
>         at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:536)
>         at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:431)
>         at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
>         at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
>         at org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:675)
> -----------------
>
> Line 1591 is the following (after I added a couple of debugging lines):
>
>         String pagePattern = moduleConfig.getControllerConfig().getPagePattern();
>
> I found that "moduleConfig" is null here, but I don't know why.

 Actually, I noticed computeURL has a backward compatibility hack that
gets the default app module config and stores it in the request scope if
one isn't already there. If you do have a recent version of struts built,
perhaps the webapp has an older version of struts installed. Maybe
replacing it with a fresh struts.jar would work.  It looks as though this
should not be happening. It doesn't happen when requesting html-link.jsp
in struts exercise-taglib webapp, but i havent installed struts-el.

-adam k.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org