You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Greg Huber <gr...@gmail.com> on 2018/10/21 11:20:26 UTC

war ## version naming

Is there a reason why we don't support the ROOT##version.war naming.

 For ROOT##238.war I get a tiles error when I try and login?

org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
definition named '.Login' at
org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.java:123)
at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
at
org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:206)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:101)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:101)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
...

Looks like tiles cannot find the files?

deployed folder:

apache-tomcat-9.0.12/webapps/ROOT##238

rather than apache-tomcat-9.0.12/webapps/ROOT

Re: war ## version naming

Posted by Greg Huber <gr...@gmail.com>.
If I deploy the war named ROOT##version-number.war I get this error.
ROOT.war works OK.

...Using ROOT##version-number.war makes it easier to version jars, rather
than just ROOT.war.  Tomcat deploys them the same.

I did have a go at remote debugging a while back, but as it was something
to do with a tiles class rather than struts, I gave up.  Think tiles is
going to move to attic?

I will try the logging option.

Cheers Greg

On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org> wrote:

> Did you mean it starts working when you rename to what doesn't contain  #?
> Could you please enable and set logging to debug and see what
> TilesResult.class logs?
>
> Regards.
>
> >-----Original Message-----
> >From: Greg Huber <gr...@gmail.com>
> >Sent: Sunday, October 21, 2018 2:50 PM
> >To: Struts <de...@struts.apache.org>
> >Subject: war ## version naming
> >
> >Is there a reason why we don't support the ROOT##version.war naming.
> >
> > For ROOT##238.war I get a tiles error when I try and login?
> >
> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> definition
> >named '.Login' at
>
> >org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.
> >java:123)
> >at
> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
> >at
>
> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:2
> >06)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActio
> >nInvocation.java:375)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:279)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >...
> >
> >Looks like tiles cannot find the files?
> >
> >deployed folder:
> >
> >apache-tomcat-9.0.12/webapps/ROOT##238
> >
> >rather than apache-tomcat-9.0.12/webapps/ROOT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: war ## version naming

Posted by Greg Huber <gr...@gmail.com>.
..Some more,

Could possibly be in StrutsWildcardServletApplicationContext?

Looks like it's found the config file OK

2018-10-22 11:40:59,699 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:findResources - Found resources
[Resource /opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT at
file:/opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT##239/WEB-INF/tiles.xml]
for path tiles*.xml

But then fails to find them using
StrutsWildcardServletApplicationContext.getResource(..)

org.apache.tiles.request.ApplicationResource :  base.getLocalePath(locale)

I added some debug statements:

public ApplicationResource getResource(ApplicationResource base, Locale
locale) {
        LOG.debug("Debug localePath locale {}", locale);
        String localePath = base.getLocalePath(locale);
        LOG.debug("Debug localePath {}", localePath);
        File localFile = new File(localePath);
        if (localFile.exists()) {
            try {
                return new
StrutsApplicationResource(localFile.toURI().toURL());
            } catch (MalformedURLException e) {
                LOG.debug("Cannot access [{}]", localePath, e);
                return null;
            }
        } else {
            LOG.debug("Debug localePath file not found {}", localePath);
        }
        return null;
    }
..
2018-10-22 11:51:50,344 DEBUG org.apache.struts2.views.tiles.TilesResult
TilesResult:doExecute - checking if tiles definition exists '.Login'
2018-10-22 11:51:50,347 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
locale
2018-10-22 11:51:50,347 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
/opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT
2018-10-22 11:51:50,348 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath file
not found /opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT
2018-10-22 11:51:50,348 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
locale en
2018-10-22 11:51:50,348 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
/opt/apache-tomcat/apache-tomcat-9.0_en.12/webapps/ROOT
2018-10-22 11:51:50,349 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath file
not found /opt/apache-tomcat/apache-tomcat-9.0_en.12/webapps/ROOT
2018-10-22 11:51:50,349 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
locale en_GB
2018-10-22 11:51:50,349 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath
/opt/apache-tomcat/apache-tomcat-9.0_en_GB.12/webapps/ROOT
2018-10-22 11:51:50,349 DEBUG
org.apache.struts2.tiles.StrutsWildcardServletApplicationContext
StrutsWildcardServletApplicationContext:getResource - Debug localePath file
not found /opt/apache-tomcat/apache-tomcat-9.0_en_GB.12/webapps/ROOT
2018-10-22 11:51:50,351 WARN  org.apache.struts2.views.tiles.TilesResult
TilesResult:doExecute - could not find @TilesDefinition for action: login
2018-10-22 11:51:50,358 ERROR
org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler
DefaultDispatcherErrorHandler:sendErrorResponse - Exception occurred during
processing request: Cannot find definition named '.Login'
org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
definition named '.Login'
    at
org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.java:123)
~[tiles-core-3.0.7.jar:3.0.7]
    at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
~[struts2-tiles-plugin-2.5.18.jar:2.5.18]
    at
org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:206)
~[struts2-core-2.5.18.jar:2.5.18]




On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org> wrote:

> Did you mean it starts working when you rename to what doesn't contain  #?
> Could you please enable and set logging to debug and see what
> TilesResult.class logs?
>
> Regards.
>
> >-----Original Message-----
> >From: Greg Huber <gr...@gmail.com>
> >Sent: Sunday, October 21, 2018 2:50 PM
> >To: Struts <de...@struts.apache.org>
> >Subject: war ## version naming
> >
> >Is there a reason why we don't support the ROOT##version.war naming.
> >
> > For ROOT##238.war I get a tiles error when I try and login?
> >
> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> definition
> >named '.Login' at
>
> >org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.
> >java:123)
> >at
> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
> >at
>
> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:2
> >06)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActio
> >nInvocation.java:375)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:279)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >...
> >
> >Looks like tiles cannot find the files?
> >
> >deployed folder:
> >
> >apache-tomcat-9.0.12/webapps/ROOT##238
> >
> >rather than apache-tomcat-9.0.12/webapps/ROOT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: war ## version naming

Posted by Greg Huber <gr...@gmail.com>.
It's something to do with the URL in
StrutsWildcardServletApplicationContext and StrutsApplicationResource.

from the debug:
base Resource /opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT at
file:/opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT##239/WEB-INF/tiles.xml

url.getPath()
returns:
/opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT

Should be:
/opt/apache-tomcat/apache-tomcat-9.0.12/webapps/ROOT##239/WEB-INF/tiles.xml

Maybe a URL it is the wrong way to get the real path?

https://docs.oracle.com/javase/8/docs/api/java/net/URL.html

A URL may have appended to it a "fragment", also known as a "ref" or a
"reference". The fragment is indicated by the sharp sign character "#"
followed by more characters. For example,

     http://java.sun.com/index.html#chapter1


On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org> wrote:

> Did you mean it starts working when you rename to what doesn't contain  #?
> Could you please enable and set logging to debug and see what
> TilesResult.class logs?
>
> Regards.
>
> >-----Original Message-----
> >From: Greg Huber <gr...@gmail.com>
> >Sent: Sunday, October 21, 2018 2:50 PM
> >To: Struts <de...@struts.apache.org>
> >Subject: war ## version naming
> >
> >Is there a reason why we don't support the ROOT##version.war naming.
> >
> > For ROOT##238.war I get a tiles error when I try and login?
> >
> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> definition
> >named '.Login' at
>
> >org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.
> >java:123)
> >at
> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
> >at
>
> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:2
> >06)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActio
> >nInvocation.java:375)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:279)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >...
> >
> >Looks like tiles cannot find the files?
> >
> >deployed folder:
> >
> >apache-tomcat-9.0.12/webapps/ROOT##238
> >
> >rather than apache-tomcat-9.0.12/webapps/ROOT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: war ## version naming

Posted by Lukasz Lenart <lu...@apache.org>.
Done :)

pon., 22 paź 2018 o 16:26 Greg Huber <gr...@gmail.com> napisał(a):
>
> Just loading the tiles.xml as a context param was the trick.
>
> Also, the null session was down to ff.  So not to waste the entire day and
> give up, I retested it, the login and app works normally :-)
>
> (https://struts.apache.org/plugins/tiles/ docs. For the ## to work might be
> worth a mention to load the tiles.xml files in the web.xml rather than the
> default which is to search and use the URL.)
>
> Cheers Greg
>
>
> On Mon, 22 Oct 2018 at 14:44, Yasser Zamani <ya...@apache.org> wrote:
>
> > You're welcome :)
> >
> > As far as I could see, when the war file name contains #, in following
> > Struts code line (TilesResult.java#136)
> >
> > definitionValid = container.isValidDefinition(location, request);
> >
> > definitionValid changes to false. As `container` comes from Tiles itself,
> > then it seems this is a Tiles itself issue. Try explicitly defining
> > @TilesDefinitions on `login` action to workaround this issue.
> >
> > Regards.
> >
> > >-----Original Message-----
> > >From: Greg Huber <gr...@gmail.com>
> > >Sent: Monday, October 22, 2018 4:56 PM
> > >To: Struts <de...@struts.apache.org>
> > >Subject: Re: war ## version naming
> > >
> > >Giving up with the StrutsWildcardServletApplicationContext and load it
> > via the
> > >web.xml
> > >
> > ><context-param>
> > >
> > ><param-
> >
> > >name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</par
> > >am-name>
> > >        <param-value>
> > >            /WEB-INF/tiles.xml
> > >        </param-value>
> > >    </context-param>
> > >
> > >Unfortunately now the tiles loads, I cannot login to the app.  The http
> > session is
> > >always null after I log on.  Possibly other elements don't work.  It's
> > becoming too
> > >painful, so I must give up on this.
> > >
> > >At least Struts looks like it works OK.
> > >
> > >Thanks for your help.
> > >
> > >Cheers Greg
> > >
> > >On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org>
> > >wrote:
> > >
> > >> Did you mean it starts working when you rename to what doesn't contain
> > #?
> > >> Could you please enable and set logging to debug and see what
> > >> TilesResult.class logs?
> > >>
> > >> Regards.
> > >>
> > >> >-----Original Message-----
> > >> >From: Greg Huber <gr...@gmail.com>
> > >> >Sent: Sunday, October 21, 2018 2:50 PM
> > >> >To: Struts <de...@struts.apache.org>
> > >> >Subject: war ## version naming
> > >> >
> > >> >Is there a reason why we don't support the ROOT##version.war naming.
> > >> >
> > >> > For ROOT##238.war I get a tiles error when I try and login?
> > >> >
> > >> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> > >> definition
> > >> >named '.Login' at
> > >>
> > >>
> >
> > >>org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContaine
> > >r.
> > >> >java:123)
> > >> >at
> > >> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java
> > >> >:158)
> > >> >at
> > >>
> > >> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSup
> > >> >port.java:2
> > >> >06)
> > >> >at
> > >> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(Default
> > >> >Actio
> > >> >nInvocation.java:375)
> > >> >at
> > >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> > >> >nvoc
> > >> >ation.java:279)
> > >> >at
> > >> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> > >> >(Meth
> > >> >odFilterInterceptor.java:101)
> > >> >at
> > >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> > >> >nvoc
> > >> >ation.java:249)
> > >> >at
> > >> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> > >> >(Meth
> > >> >odFilterInterceptor.java:101)
> > >> >at
> > >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> > >> >nvoc
> > >> >ation.java:249)
> > >> >...
> > >> >
> > >> >Looks like tiles cannot find the files?
> > >> >
> > >> >deployed folder:
> > >> >
> > >> >apache-tomcat-9.0.12/webapps/ROOT##238
> > >> >
> > >> >rather than apache-tomcat-9.0.12/webapps/ROOT
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For
> > >> additional commands, e-mail: dev-help@struts.apache.org
> > >>
> > >>
> >

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


Re: war ## version naming

Posted by Greg Huber <gr...@gmail.com>.
Just loading the tiles.xml as a context param was the trick.

Also, the null session was down to ff.  So not to waste the entire day and
give up, I retested it, the login and app works normally :-)

(https://struts.apache.org/plugins/tiles/ docs. For the ## to work might be
worth a mention to load the tiles.xml files in the web.xml rather than the
default which is to search and use the URL.)

Cheers Greg


On Mon, 22 Oct 2018 at 14:44, Yasser Zamani <ya...@apache.org> wrote:

> You're welcome :)
>
> As far as I could see, when the war file name contains #, in following
> Struts code line (TilesResult.java#136)
>
> definitionValid = container.isValidDefinition(location, request);
>
> definitionValid changes to false. As `container` comes from Tiles itself,
> then it seems this is a Tiles itself issue. Try explicitly defining
> @TilesDefinitions on `login` action to workaround this issue.
>
> Regards.
>
> >-----Original Message-----
> >From: Greg Huber <gr...@gmail.com>
> >Sent: Monday, October 22, 2018 4:56 PM
> >To: Struts <de...@struts.apache.org>
> >Subject: Re: war ## version naming
> >
> >Giving up with the StrutsWildcardServletApplicationContext and load it
> via the
> >web.xml
> >
> ><context-param>
> >
> ><param-
>
> >name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</par
> >am-name>
> >        <param-value>
> >            /WEB-INF/tiles.xml
> >        </param-value>
> >    </context-param>
> >
> >Unfortunately now the tiles loads, I cannot login to the app.  The http
> session is
> >always null after I log on.  Possibly other elements don't work.  It's
> becoming too
> >painful, so I must give up on this.
> >
> >At least Struts looks like it works OK.
> >
> >Thanks for your help.
> >
> >Cheers Greg
> >
> >On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org>
> >wrote:
> >
> >> Did you mean it starts working when you rename to what doesn't contain
> #?
> >> Could you please enable and set logging to debug and see what
> >> TilesResult.class logs?
> >>
> >> Regards.
> >>
> >> >-----Original Message-----
> >> >From: Greg Huber <gr...@gmail.com>
> >> >Sent: Sunday, October 21, 2018 2:50 PM
> >> >To: Struts <de...@struts.apache.org>
> >> >Subject: war ## version naming
> >> >
> >> >Is there a reason why we don't support the ROOT##version.war naming.
> >> >
> >> > For ROOT##238.war I get a tiles error when I try and login?
> >> >
> >> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> >> definition
> >> >named '.Login' at
> >>
> >>
>
> >>org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContaine
> >r.
> >> >java:123)
> >> >at
> >> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java
> >> >:158)
> >> >at
> >>
> >> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSup
> >> >port.java:2
> >> >06)
> >> >at
> >> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(Default
> >> >Actio
> >> >nInvocation.java:375)
> >> >at
> >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> >> >nvoc
> >> >ation.java:279)
> >> >at
> >> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> >> >(Meth
> >> >odFilterInterceptor.java:101)
> >> >at
> >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> >> >nvoc
> >> >ation.java:249)
> >> >at
> >> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> >> >(Meth
> >> >odFilterInterceptor.java:101)
> >> >at
> >> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
> >> >nvoc
> >> >ation.java:249)
> >> >...
> >> >
> >> >Looks like tiles cannot find the files?
> >> >
> >> >deployed folder:
> >> >
> >> >apache-tomcat-9.0.12/webapps/ROOT##238
> >> >
> >> >rather than apache-tomcat-9.0.12/webapps/ROOT
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For
> >> additional commands, e-mail: dev-help@struts.apache.org
> >>
> >>
>

RE: war ## version naming

Posted by Yasser Zamani <ya...@apache.org>.
You're welcome :)

As far as I could see, when the war file name contains #, in following Struts code line (TilesResult.java#136)

definitionValid = container.isValidDefinition(location, request);

definitionValid changes to false. As `container` comes from Tiles itself, then it seems this is a Tiles itself issue. Try explicitly defining @TilesDefinitions on `login` action to workaround this issue.

Regards.

>-----Original Message-----
>From: Greg Huber <gr...@gmail.com>
>Sent: Monday, October 22, 2018 4:56 PM
>To: Struts <de...@struts.apache.org>
>Subject: Re: war ## version naming
>
>Giving up with the StrutsWildcardServletApplicationContext and load it via the
>web.xml
>
><context-param>
>
><param-
>name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</par
>am-name>
>        <param-value>
>            /WEB-INF/tiles.xml
>        </param-value>
>    </context-param>
>
>Unfortunately now the tiles loads, I cannot login to the app.  The http session is
>always null after I log on.  Possibly other elements don't work.  It's becoming too
>painful, so I must give up on this.
>
>At least Struts looks like it works OK.
>
>Thanks for your help.
>
>Cheers Greg
>
>On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org>
>wrote:
>
>> Did you mean it starts working when you rename to what doesn't contain  #?
>> Could you please enable and set logging to debug and see what
>> TilesResult.class logs?
>>
>> Regards.
>>
>> >-----Original Message-----
>> >From: Greg Huber <gr...@gmail.com>
>> >Sent: Sunday, October 21, 2018 2:50 PM
>> >To: Struts <de...@struts.apache.org>
>> >Subject: war ## version naming
>> >
>> >Is there a reason why we don't support the ROOT##version.war naming.
>> >
>> > For ROOT##238.war I get a tiles error when I try and login?
>> >
>> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
>> definition
>> >named '.Login' at
>>
>>
>>org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContaine
>r.
>> >java:123)
>> >at
>> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java
>> >:158)
>> >at
>>
>> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSup
>> >port.java:2
>> >06)
>> >at
>> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(Default
>> >Actio
>> >nInvocation.java:375)
>> >at
>> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
>> >nvoc
>> >ation.java:279)
>> >at
>> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
>> >(Meth
>> >odFilterInterceptor.java:101)
>> >at
>> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
>> >nvoc
>> >ation.java:249)
>> >at
>> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
>> >(Meth
>> >odFilterInterceptor.java:101)
>> >at
>> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionI
>> >nvoc
>> >ation.java:249)
>> >...
>> >
>> >Looks like tiles cannot find the files?
>> >
>> >deployed folder:
>> >
>> >apache-tomcat-9.0.12/webapps/ROOT##238
>> >
>> >rather than apache-tomcat-9.0.12/webapps/ROOT
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For
>> additional commands, e-mail: dev-help@struts.apache.org
>>
>>

Re: war ## version naming

Posted by Greg Huber <gr...@gmail.com>.
Giving up with the StrutsWildcardServletApplicationContext and load it via
the web.xml

<context-param>

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

Unfortunately now the tiles loads, I cannot login to the app.  The http
session is always null after I log on.  Possibly other elements don't
work.  It's becoming too painful, so I must give up on this.

At least Struts looks like it works OK.

Thanks for your help.

Cheers Greg

On Mon, 22 Oct 2018 at 09:23, Yasser Zamani <ya...@apache.org> wrote:

> Did you mean it starts working when you rename to what doesn't contain  #?
> Could you please enable and set logging to debug and see what
> TilesResult.class logs?
>
> Regards.
>
> >-----Original Message-----
> >From: Greg Huber <gr...@gmail.com>
> >Sent: Sunday, October 21, 2018 2:50 PM
> >To: Struts <de...@struts.apache.org>
> >Subject: war ## version naming
> >
> >Is there a reason why we don't support the ROOT##version.war naming.
> >
> > For ROOT##238.war I get a tiles error when I try and login?
> >
> >org.apache.tiles.definition.NoSuchDefinitionException: Cannot find
> definition
> >named '.Login' at
>
> >org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.
> >java:123)
> >at
> >org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
> >at
>
> >org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:2
> >06)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActio
> >nInvocation.java:375)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:279)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >at
> >com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
> >odFilterInterceptor.java:101)
> >at
> >com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
> >ation.java:249)
> >...
> >
> >Looks like tiles cannot find the files?
> >
> >deployed folder:
> >
> >apache-tomcat-9.0.12/webapps/ROOT##238
> >
> >rather than apache-tomcat-9.0.12/webapps/ROOT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

RE: war ## version naming

Posted by Yasser Zamani <ya...@apache.org>.
Did you mean it starts working when you rename to what doesn't contain  #? Could you please enable and set logging to debug and see what TilesResult.class logs?

Regards.

>-----Original Message-----
>From: Greg Huber <gr...@gmail.com>
>Sent: Sunday, October 21, 2018 2:50 PM
>To: Struts <de...@struts.apache.org>
>Subject: war ## version naming
>
>Is there a reason why we don't support the ROOT##version.war naming.
>
> For ROOT##238.war I get a tiles error when I try and login?
>
>org.apache.tiles.definition.NoSuchDefinitionException: Cannot find definition
>named '.Login' at
>org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.
>java:123)
>at
>org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:158)
>at
>org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:2
>06)
>at
>com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActio
>nInvocation.java:375)
>at
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
>ation.java:279)
>at
>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
>odFilterInterceptor.java:101)
>at
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
>ation.java:249)
>at
>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Meth
>odFilterInterceptor.java:101)
>at
>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvoc
>ation.java:249)
>...
>
>Looks like tiles cannot find the files?
>
>deployed folder:
>
>apache-tomcat-9.0.12/webapps/ROOT##238
>
>rather than apache-tomcat-9.0.12/webapps/ROOT

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