Hello Łukasz: 

Thank you very much for the workaround re context-param. That resolved it for 
me, too. 

Cheers,

Zdenek

-----Original Message-----
From: Lukasz Lenart <lukaszlen...@apache.org> 
Sent: June 9, 2022 8:25 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Getting "could not find @TilesDefinition for action" after the 
upgrade from Struts 2.5.30 to 6.0.0

Ok, we have a bug with loading definitions, it works once context-param is 
defined

<context-param>
    
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
    <param-value>
        /WEB-INF/tiles.xml
    </param-value>
</context-param>

Could you register a ticket in JIRA?


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

czw., 9 cze 2022 o 05:52 <zdnkneje...@gmail.com> napisał(a):
>
> Hello Łukasz:
>
> Thank you for prompt response. No, I was not using the DEFINITIONS_CONFIG - 
> the tiles.xml was found fine in v2.5.30. When I add it via init-param to the 
> struts filter it does not seem to make a difference however.
>
> <filter>
>         <filter-name>struts2</filter-name>
>         
> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
>         <init-param>
>             
> <param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
>             <param-value>/WEB-INF/tiles.xml</param-value>
>         </init-param>
>     </filter>
>
>
> Yes, I have deleted the work subfolder under Catalina home/base.
>
> Here is the output (for any line with tiles keyword plus the 
> StrutsPrepareAndExecuteFilter) after I enabled trace level in log4j.xml:
>
> 2022-06-08 23:26:10,749 INFO  [http-nio-8080-exec-55] 
> tiles.StrutsTilesListener (StrutsTilesListener.java:37) - Starting Struts 
> Tiles 3 integration ...
> 2022-06-08 23:26:10,805 TRACE [http-nio-8080-exec-55] 
> tiles.StrutsTilesInitializer (StrutsTilesInitializer.java:43) - Initializing 
> Tiles wildcard support ...
> 2022-06-08 23:26:10,855 TRACE [http-nio-8080-exec-55] 
> tiles.StrutsTilesInitializer (StrutsTilesInitializer.java:50) - 
> Creating dedicated Struts factory to create Tiles container
> 2022-06-08 23:26:11,086 TRACE [http-nio-8080-exec-55] 
> tiles.StrutsWildcardServletApplicationContext 
> (StrutsWildcardServletApplicationContext.java:117) - Using 
> ResourceFinder to find matches for tiles*.xml
> 2022-06-08 23:26:11,126 TRACE [http-nio-8080-exec-55] 
> tiles.StrutsWildcardServletApplicationContext 
> (StrutsWildcardServletApplicationContext.java:129) - Found resources 
> [Resource 
> file:/C:/data/Documents/NetBeansProjects13/xxx-v6/target/xxx-v6-1.0-SN
> APSHOT/WEB-INF/tiles.xml at 
> file:/C:/data/Documents/NetBeansProjects13/xxx-v6/target/xxx-v6-1.0-SN
> APSHOT/WEB-INF/tiles.xml] for path tiles*.xml [http-nio-8080-exec-55] 
> INFO org.apache.tiles.access.TilesAccess - Publishing TilesContext for 
> context: 
> org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
>
> 2022-06-08 23:28:34,062 TRACE [http-nio-8080-exec-58] 
> filter.StrutsPrepareAndExecuteFilter 
> (StrutsPrepareAndExecuteFilter.java:126) - Checking if 
> /app/account/view-summary.action is a static resource
> 2022-06-08 23:28:34,063 TRACE [http-nio-8080-exec-58] 
> filter.StrutsPrepareAndExecuteFilter 
> (StrutsPrepareAndExecuteFilter.java:129) - Assuming uri 
> /app/account/view-summary.action as a normal action
> 2022-06-08 23:28:34,082 TRACE [http-nio-8080-exec-58] 
> filter.StrutsPrepareAndExecuteFilter 
> (StrutsPrepareAndExecuteFilter.java:139) - Found mapping 
> ActionMapping{name='view-summary', namespace='/app/account', 
> method='null', extension='action', params={}, result=null} for 
> /app/account/view-summary.action
>
> 2022-06-08 23:28:34,385 DEBUG [http-nio-8080-exec-58] tiles.TilesResult 
> (TilesResult.java:135) - checking if tiles definition exists 
> 'app.myAccount.viewSummary'
> 2022-06-08 23:28:34,388 TRACE [http-nio-8080-exec-58] 
> tiles.TilesResult (TilesResult.java:142) - tilesDefinition not found 
> yet, searching in action
> 2022-06-08 23:28:34,391 WARN  [http-nio-8080-exec-58] 
> tiles.TilesResult (TilesResult.java:154) - could not find 
> @TilesDefinition for action: view-summary
> 2022-06-08 23:28:34,391 DEBUG [http-nio-8080-exec-58] 
> interceptor.I18nInterceptor (I18nInterceptor.java:143) - After action 
> invocation Locale=en_US
> 2022-06-08 23:28:34,393 DEBUG [http-nio-8080-exec-58] 
> result.ServletDispatcherResult (ServletDispatcherResult.java:127) - 
> Forwarding to location: /tiles/exception.jsp
>
>
>
>
> The trace output is the same for v6 as for v2.5.30 - except that in v2.5.30 
> the tile definition is found and the processing of the tile/jsp proceeds:
>
>
> 2022-06-08 22:31:11,779 DEBUG [http-nio-8080-exec-3] tiles.TilesResult 
> (TilesResult.java:135) - checking if tiles definition exists 
> 'app.myAccount.viewSummary'
> 2022-06-08 22:31:12,427 DEBUG [http-nio-8080-exec-3] components.UIBean 
> (UIBean.java:1005) - Cannot determine id attribute for 
> [org.apache.struts2.components.Head@64229854], consider defining id, name or 
> key attribute!
> 2022-06-08 22:31:12,427 DEBUG [http-nio-8080-exec-3] components.UIBean 
> (UIBean.java:577) - Rendering template /template/xhtml/head
> 2022-06-08 22:31:12,453 DEBUG [http-nio-8080-exec-3] 
> template.FreemarkerTemplateEngine (FreemarkerTemplateEngine.java:119) 
> - Rendering template: /template/xhtml/head.ftl
> 2022-06-08 22:31:12,508 DEBUG [http-nio-8080-exec-3] 
> template.FreemarkerTemplateEngine (FreemarkerTemplateEngine.java:151) 
> - Push tag on top of the stack
> 2022-06-08 22:31:12,782 DEBUG [http-nio-8080-exec-3] 
> template.FreemarkerTemplateEngine (FreemarkerTemplateEngine.java:156) 
> - Removes tag from top of the stack
> 2022-06-08 22:31:13,389 TRACE [http-nio-8080-exec-3] 
> tiles.StrutsFreeMarkerAttributeRenderer 
> (StrutsFreeMarkerAttributeRenderer.java:97) - Checking if path 
> [/tiles/account/viewSummary.jsp] can be rendered
> 2022-06-08 22:31:14,036 DEBUG [http-nio-8080-exec-3] components.UIBean 
> (UIBean.java:1005) - Cannot determine id attribute for 
> [org.apache.struts2.components.ActionMessage@7a766cb4], consider defining id, 
> name or key attribute!
> 2022-06-08 22:31:14,038 DEBUG [http-nio-8080-exec-3] components.UIBean 
> (UIBean.java:577) - Rendering template 
> /template/bootstrap/actionmessage
> 2022-06-08 22:31:14,059 DEBUG [http-nio-8080-exec-3] 
> template.FreemarkerTemplateEngine (FreemarkerTemplateEngine.java:119) 
> - Rendering template: /template/bootstrap/actionmessage.ftl
> ... etc ....
>
>
> Unfortunately I cannot find what the issue is so if anyone has any other tips 
> that would be great. Can someone confirm their tiles with 
> org.apache.struts2.tiles.StrutsTilesListener work in v6?
>
> Thanks again,
>
> Zdenek
>
> -----Original Message-----
> From: Lukasz Lenart <lukaszlen...@apache.org>
> Sent: June 8, 2022 1:21 AM
> To: Struts Users Mailing List <user@struts.apache.org>
> Subject: Re: Getting "could not find @TilesDefinition for action" 
> after the upgrade from Struts 2.5.30 to 6.0.0
>
> To be honest nothing has changed in Tiles support between those versions, 
> could you enable TRACE logging for package org.apache.struts2.tiles ?
> Do you use "org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG"
> servlet init-param to define the definitions?
> Also, did you clean up Tomcat's temp folder?
> https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+6.0.0+mig
> ration#Struts2.5to6.0.0migration-Temp/WorkdirectoryofApplicationServer
> /ServletContainer
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to