You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "lichunlei (JIRA)" <ji...@apache.org> on 2008/11/28 10:34:37 UTC

[jira] Commented: (WW-2897) org.apache.struts2.tiles.StrutsTilesListener do not work

    [ https://issues.apache.org/struts/browse/WW-2897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45039#action_45039 ] 

lichunlei commented on WW-2897:
-------------------------------

I have meet the same issue.

I must use struts2 + tiles in jdk1.4.2.(struts2.0.14 + tiles2.0.6)

But tiles can't work.
struts2-tiles-plugin and tiles jars were transfered for jdk1.4 by using RetroTranslator.
Below is my exception:
[11/28/08 14:45:40:546 CST] 4c844c84 WebGroup      E SRVE0026E: [Servlet
Error]-[]: java.lang.NullPointerException
	at java.lang.Throwable.<init>(Throwable.java)
	at java.lang.Throwable.<init>(Throwable.java)
	at
java.lang.NullPointerException.<init>(NullPointerException.java:60)
	at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java)
	at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor
t.java:178)
	at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI
nvocation.java:348)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:253)
	at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(D
efaultWorkflowInterceptor.java:221)

Below is org.apache.struts2.views.tiles.TilesResult.doExecute java code:
    public void doExecute(String location, ActionInvocation invocation) throws Exception {
        setLocation(location);

        ServletContext servletContext =
ServletActionContext.getServletContext();
        TilesContainer container = TilesAccess.getContainer(servletContext);

        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();

        container.render(location, request, response);
    }
I debugged and fund that "container" is null, a exception will be thrown when launch this code: 
container.render(location, request, response);

I found that "org.apache.struts2.tiles.StrutsTilesListener" is not run when web application start!

My application can run smoothly in jdk1.5, but tiles can't work in jdk1.4.2

I promise it's a bug.


> org.apache.struts2.tiles.StrutsTilesListener do not work
> --------------------------------------------------------
>
>                 Key: WW-2897
>                 URL: https://issues.apache.org/struts/browse/WW-2897
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tiles
>    Affects Versions: 2.0.11.2
>         Environment: websphere6.0 (jdk1.42),all the referenced jar is in the struts-2.0.11.2-all.zip downloaded from the official site. 
>            Reporter: careprad
>            Priority: Blocker
>
> first of all,the reason is the exception on ServletDispatcherResult.doExecute:
> 		setLocation(location);
> 		javax.servlet.ServletContext servletContext = ServletActionContext.getServletContext();
> 		TilesContainer container = TilesAccess.getContainer(servletContext);               //here get null container
> 		javax.servlet.http.HttpServletRequest request = ServletActionContext.getRequest();
> 		javax.servlet.http.HttpServletResponse response = ServletActionContext.getResponse();
> 		container.render(location, new Object[] {request, response});                             //here will throw the null pointer exception
> I traced the exception in the StrutsTilesListener ,it do not work at all,I suppose it  is the static initialize method work in error:
> 		INIT.put(
> 			"org.apache.tiles.factory.TilesContainerFactory",
> 			(class$org$apache$struts2$tiles$StrutsTilesContainerFactory == null
> 				&& (class$org$apache$struts2$tiles$StrutsTilesContainerFactory =
> 					(new StrutsTilesContainerFactory[0]).getClass().getComponentType())
> 					== null
> 					? class$org$apache$struts2$tiles$StrutsTilesContainerFactory
> 					: class$org$apache$struts2$tiles$StrutsTilesContainerFactory)
> 				.getName());
> this code is what I can't understand!and How can I get the source code of the pluggin?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.