Re: Unable to load configuration: /struts2-core-6.4.0.jar!/struts-beans.xml:39:72
Greg Huber <[email protected]>
| Newsgroups | gmane.comp.jakarta.struts.devel |
|---|---|
| Message-ID | <[email protected]> |
Debugging StrutsWildcardServletApplicationContext
and what gets loaded :
context.getResourcePaths("/")
folders only and files (ie index.jsp, robots.txt etc)
webapp/
and
getClass().getClassLoader().getResources("/")
webapp/WEB-INF/classes
webapp/WEB-INF/lib/*jars
Not sure the pattern is going to work as there are no files to compare,
than from webapp/
Just the filter TILES_DEFAULT_PATTERNS
tiles*.xml
Will load from webapp/WEB-INF/tiles1.xml
On 18/04/2024 10:17, [email protected] wrote:
> This resolves the issue, as Greg points out:
>
> <listener>
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>
> </listener>
>
> <context-param>
> <param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
>
> <param-value>/WEB-INF/tiles.xml</param-value>
> </context-param>
>
> However, this still seems to be a breaking change, which at least
> should be documented. Maybe is was wong by not specifying tiles.xml
> specifically in the first place...
>
> Thanks!
> Markus
>
>
> Am 18.04.24 um 11:08 schrieb [email protected]:
>> I simply use
>>
>> <listener>
>> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>>
>> </listener>
>>
>> without any further params. Is this incomplete?
>>
>> Markus
>>
>>
>>
>> Am 18.04.24 um 10:29 schrieb Greg Huber:
>>> How do you load your tiles from web.xml?
>>>
>>> ..For my setup this works.
>>>
>>>
>>> <listener>
>>> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
>>>
>>> </listener>
>>>
>>> <context-param>
>>> <param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
>>>
>>> <param-value>
>>> /WEB-INF/tiles.xml
>>> </param-value>
>>> </context-param>
>>>
>>>
>>> On 18/04/2024 08:47, [email protected] wrote:
>>>> Am 18.04.24 um 09:27 schrieb Lukasz Lenart:
>>>>> czw., 18 kwi 2024 o 09:05 [email protected]
>>>>> <[email protected]> napisał(a):
>>>>>> My tiles definition remains unchanged under
>>>>>>
>>>>>> /WEB-INF/tiles.xml
>>>>>>
>>>>>> If I see this correctly, these changes do not include this
>>>>>> situation?
>>>>>>
>>>>>> https://github.com/apache/struts/pull/896/commits/c7ae614824b4c158b9998575294d94fe9a746c41
>>>>>>
>>>>>>
>>>>>> @Deprecated
>>>>>> String TILES_DEFAULT_PATTERN =
>>>>>> "/WEB-INF/**/tiles*.xml,classpath*:META-INF/**/tiles*.xml";
>>>>>>
>>>>>>
>>>>>> public static final Set<String> TILES_DEFAULT_PATTERNS =
>>>>>> Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
>>>>>> "/WEB-INF/**/tiles*.xml",
>>>>>> "classpath*:META-INF/**/tiles*.xml"
>>>>>> )));
>>>>>>
>>>>>>
>>>>>> This seems to be a breaking change?
>>>>> Looks like, I assumed that ** should match any folder and even
>>>>> no-folder, could you move your tiles.xml into the "config" subfolder
>>>>> to see if this will fix the problem?
>>>>
>>>>
>>>> hmm, I now tried the following versions, without success, moving
>>>> /WEB-INF/tiles.xml to
>>>>
>>>>
>>>> /WEB-INF/tiles2.xml
>>>>
>>>> /WEB-INF/conf/tiles.xml
>>>>
>>>> /WEB-INF/conf/tiles2.xml
>>>>
>>>>
>>>> reverting back to struts-6.3.0 does not show the issue.
>>>>
>>>>
>>>>>
>>>>> There is option to use <init-params> but I assume you do not use
>>>>> servlet config
>>>>>
>>>>> <servlet>
>>>>> <servlet-name>tiles</servlet-name>
>>>>> <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
>>>>>
>>>>> <init-param>
>>>>> <param-name>
>>>>> org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
>>>>> </param-name>
>>>>> <param-value>
>>>>> /WEB-INF/tiles.xml
>>>>> </param-value>
>>>>> </init-param>
>>>>> <load-on-startup>2</load-on-startup>
>>>>> </servlet>
>>>>
>>>> No, I do not use this option.
>>>>
>>>>
>>>>>
>>>>> Thanks in advance
>>>>> Lukasz
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>