Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-11-01 Thread Lukasz Lenart
niedz., 1 lis 2020 o 14:25 Peer Mohammad  napisał(a):
>
> I have not used Xwork, index.jsp has  name="cheetta.login" flush="true"/> and cheetta.login is given in struts.xml 
> with action class.This setup is working last 7 years on struts2.3.35 .

You are not using Xwork directly but you have xwork.jar on the
classpath, and some classes can conflict - remove the jar.

Next, you are accessing index.jsp directly and not via action - that's
why you are getting the exception. You are using Struts related Tiles
listener which expects that all the Tiles definitions (in this case
"cheetta.login") will be accessed via action. So the flow supposed to
be as follow:

browser -> action -> JSP -> Tiles definition

In your case there is no action when you're accessing index.jsp. If
you don't use any of the Struts Tile listener features you can switch
to "org.apache.tiles.listener.TilesListener" as pointed in the
documentation https://struts.apache.org/plugins/tiles/#usage

And yes, for the last 7 years we have been developing and extending
Struts that's why some things have changed.


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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-11-01 Thread James Chaplin
Hello Peer.

I am not sure if any of these suggestions will help or not, but you never know.

There is a blog post 
(http://www.programmers-code.org/2017/10/23/struts-tiles-locale-resolver-cannot-obtain-httpservletrequest/)
 that mentions receiving similar errors due to request.getAttribute("x") calls 
within the JSPs.  You can check your application's JSPs to see if you have any 
similar direct calls, and try what the blog suggests (replace request with 
requestScope), to see if it makes any difference.

There is a commented-out Tiles 1-or-2 context-param entry in the application's 
web.xml from your earlier mailing list post.  It probably will not make a 
difference, but you could try explicitly setting the Tiles 3 equivalent:



org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
/WEB-INF/tiles.xml


in the application's web.xml and see if it makes any difference in the 
application's behaviour.

The error you are getting indicates that the StrutsTilesLocaleResolver for the 
Struts 2 Tiles Plugin cannot locate the ActionContext for the request.  That 
could mean that processing is somehow ending up at one of your JSPs without 
following the normal action execution path.  You might try increasing the log 
levels to DEBUG temporarily to see if that turns up any information that might 
help.

Another suggestion is that you could try temporarily changing your 
application's configuration to use the "defaultStack" interceptor stack (and 
then add any custom interceptors you need), to see if that makes any 
difference.  There maybe something subtle with the interceptors (or ordering) 
that is impacting processing, and the struts.xml from your earlier post has 
custom interceptor stacks, so going back to the basic defaults might help you 
debug further.

Regards,

James.


On 2020/11/01 11:05:43, Peer Mohammad  wrote: 
> I have not used Xwork, index.jsp has  name="cheetta.login" flush="true"/> and cheetta.login is given in struts.xml 
> with action class.This setup is working last 7 years on struts2.3.35 .
> Note sure why its failing on upgraded version.I debugged and saw that 
> Valustack returning null for the request.
> 
> Thanks & Regards,
> Peer M Ansari
> 
> On 2020/10/29 12:57:57, Lukasz Lenart  wrote: 
> > czw., 29 paź 2020 o 11:24 Peer Mohammad  napisał(a):
> > > list of jars for Strust2.5.22
> > >
> > > struts2-core 2.5.22
> > > freemarker -2.3.30
> > > xwork-core -2.3.37
> > 
> > As I said, this is not needed, XWork was merged into Struts Core, you
> > are duplicating classes now
> > 
> > > Caused by: There is no ActionContext for current request! - [unknown 
> > > location]
> > >
> > > at 
> > > org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:151)
> > 
> > You are accessing index.jsp directly by
> > 
> > index.jsp
> > 
> > 
> > 
> > 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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-11-01 Thread Peer Mohammad
I have not used Xwork, index.jsp has  and cheetta.login is given in struts.xml 
with action class.This setup is working last 7 years on struts2.3.35 .
Note sure why its failing on upgraded version.I debugged and saw that Valustack 
returning null for the request.

Thanks & Regards,
Peer M Ansari

On 2020/10/29 12:57:57, Lukasz Lenart  wrote: 
> czw., 29 paź 2020 o 11:24 Peer Mohammad  napisał(a):
> > list of jars for Strust2.5.22
> >
> > struts2-core 2.5.22
> > freemarker -2.3.30
> > xwork-core -2.3.37
> 
> As I said, this is not needed, XWork was merged into Struts Core, you
> are duplicating classes now
> 
> > Caused by: There is no ActionContext for current request! - [unknown 
> > location]
> >
> > at 
> > org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:151)
> 
> You are accessing index.jsp directly by
> 
> index.jsp
> 
> 
> 
> 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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-29 Thread Lukasz Lenart
czw., 29 paź 2020 o 11:24 Peer Mohammad  napisał(a):
> list of jars for Strust2.5.22
>
> struts2-core 2.5.22
> freemarker -2.3.30
> xwork-core -2.3.37

As I said, this is not needed, XWork was merged into Struts Core, you
are duplicating classes now

> Caused by: There is no ActionContext for current request! - [unknown location]
>
> at 
> org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:151)

You are accessing index.jsp directly by

index.jsp



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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-29 Thread Peer Mohammad
Hi,

I am using maven to control dependencies and i have doubt on 
struts2-tiles-plugin jar which has many new library class,not sure if something 
need to implement. I am using version in dtd in tiles.xml.

Please find the list of dependencies for struts2.3.35 (working fine) and 
struts2.5.22(upgrading)

The list of jars version for strust2.3.55:
struts2-core 2.3.35
freemarker -2.3.28
xwork-core -2.3.35
struts2-tiles-plugin 2.3.35
tiles-api 2.2.2
tiles-compat 3.0.8
tiles-core 2.2.2
tiles-jsp 2.2.2
tiles-servlet 2.2.2
ognl 3.0.21
commons-validator 1.3.1
commons-beanutils 1.8.0
taglibs-standard-1.2.5
asm-5.0.2
bsf-2.3.0
commons-fileupload-1.3.2
commons-lang3-3.1
commons-logging-1.1.3
commons-io-2.2
commons-chain-1.2
commons-digester-1.8

--
list of jars for Strust2.5.22 

struts2-core 2.5.22
freemarker -2.3.30
xwork-core -2.3.37
struts2-tiles-plugin 2.5.22
tiles-api 3.0.8
tiles-compat 3.0.8
tiles-core 3.0.8
tiles-jsp 3.0.8
tiles-servlet 3.0.8
ognl 3.1.26
commons-validator 1.3.1
commons-beanutils 1.9.4
taglibs-standard-1.2.5
asm-7.2
bsf-2.4
commons-fileupload-1.4
commons-lang3-3.8.1
commons-logging-1.2
commons-io-2.6
commons-chain-1.2
commons-digester-2.1

error:

Caused by: There is no ActionContext for current request! - [unknown location]

at 
org.apache.struts2.tiles.StrutsTilesLocaleResolver.resolveLocale(StrutsTilesLocaleResolver.java:45)

at 
org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:86)

at 
org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:286)

at 
org.apache.tiles.TilesContainerWrapper.getDefinition(TilesContainerWrapper.java:83)

at 
org.apache.tiles.impl.mgmt.CachingTilesContainer.getDefinition(CachingTilesContainer.java:89)

at 
org.apache.tiles.impl.mgmt.CachingTilesContainer.render(CachingTilesContainer.java:121)

at 
org.apache.tiles.template.InsertDefinitionModel.renderDefinition(InsertDefinitionModel.java:132)

at 
org.apache.tiles.template.InsertDefinitionModel.execute(InsertDefinitionModel.java:99)

at 
org.apache.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java:254)

at 
org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:151)

at org.apache.jsp.index_jsp._jspService(index_jsp.java:115)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)

at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

... 57 more

On 2020/10/28 14:28:45, Lukasz Lenart  wrote: 
> śr., 28 paź 2020 o 11:55 Peer Mohammad  napisał(a):
> > Please find the web.xml and struts.xml file. I have observed that many 
> > library classes are not available in strut2-tiles-plugin file and xwork 
> > some package in struts-core-2.5.22 compare to struts2.3.35.
> 
> Not sure what do you mean by that? Which classes are missing? XWork
> was merged into Struts Core and there is no additional jar anymore.
> Maybe you are mixing different jars in your app, do you use Maven to
> control dependencies? Could you list jars from the lib folder?
> 
> Also did you use a proper DTD in your tiles.xml files as mentioned
> here 
> https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles
> 
> "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
>"http://tiles.apache.org/dtds/tiles-config_3_0.dtd;>
> 
> > Web.xml
> >
> > 
> > http://xmlns.jcp.org/xml/ns/javaee;
> >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> >  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
> >  http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
> >  version="3.1">
> > CHEETTA_online
> > 
> > 
> > 
> > org.apache.struts2.tiles.StrutsTilesListener
> > 
> >
> > 
> > 
> > 
> > CSRFTokenFilter
> > 
> > com.sbc.cheetta.common.framework.filter.GenerateCSRFTokenFilter
> > 
> > 
> > CSRFTokenFilter
> > /*
> > 
> >  
> > CSRFTokenFilter
> > *.action
> > 
> > 
> > CSRFTokenFilter
> > *.do
> > 
> 
> This is duplication, just /* is enough, remove other patterns
> 
> > 
> > 
> > CSRFValidationFilter
> > 
> > com.sbc.cheetta.common.framework.filter.CSRFValidationFilter
> >  
> > excludedUrls
> > 
> > 
> > /index.jsp,/Welcome.do,/Logoff.do,/LogonSubmit.do,/networkEditProfileLinker.do,/images/swmainmenubutton.gif,/images/att_logo.gif,/images/mwmainmenubutton.gif,/images/admin.gif,/theme/Master.css,/images/wmainmenubutton.gif,/images/atmainmenubutton.gif,/images/bg_header1024.gif,/images/bg_footer1024.gif,/images/bg_header1024.gif
> >  
> > 
> > 
> >

Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-28 Thread Lukasz Lenart
śr., 28 paź 2020 o 11:55 Peer Mohammad  napisał(a):
> Please find the web.xml and struts.xml file. I have observed that many 
> library classes are not available in strut2-tiles-plugin file and xwork some 
> package in struts-core-2.5.22 compare to struts2.3.35.

Not sure what do you mean by that? Which classes are missing? XWork
was merged into Struts Core and there is no additional jar anymore.
Maybe you are mixing different jars in your app, do you use Maven to
control dependencies? Could you list jars from the lib folder?

Also did you use a proper DTD in your tiles.xml files as mentioned
here 
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles

http://tiles.apache.org/dtds/tiles-config_3_0.dtd;>

> Web.xml
>
> 
> http://xmlns.jcp.org/xml/ns/javaee;
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
>  http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
>  version="3.1">
> CHEETTA_online
> 
> 
> 
> org.apache.struts2.tiles.StrutsTilesListener
> 
>
> 
> 
> 
> CSRFTokenFilter
> 
> com.sbc.cheetta.common.framework.filter.GenerateCSRFTokenFilter
> 
> 
> CSRFTokenFilter
> /*
> 
>  
> CSRFTokenFilter
> *.action
> 
> 
> CSRFTokenFilter
> *.do
> 

This is duplication, just /* is enough, remove other patterns

> 
> 
> CSRFValidationFilter
> 
> com.sbc.cheetta.common.framework.filter.CSRFValidationFilter
>  
> excludedUrls
> 
> 
> /index.jsp,/Welcome.do,/Logoff.do,/LogonSubmit.do,/networkEditProfileLinker.do,/images/swmainmenubutton.gif,/images/att_logo.gif,/images/mwmainmenubutton.gif,/images/admin.gif,/theme/Master.css,/images/wmainmenubutton.gif,/images/atmainmenubutton.gif,/images/bg_header1024.gif,/images/bg_footer1024.gif,/images/bg_header1024.gif
>  
> 
> 
> CSRFValidationFilter
> /*
> 
> 
>
> 
> xFrameOptionsFilter
> 
> com.sbc.cheetta.common.framework.filter.XFrameOptionsFilter
> 
> 
> xFrameOptionsFilter
> *.action
> 
> 
> xFrameOptionsFilter
> *.do
> 
> 
> struts2
> 
> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
> 
> actionPackages
> com.sbc.cheetta.actions
> 
> 
> 
> struts2
> /*
> 
> 
> struts2
> *.action
> 
> 
> struts2
> *.do
> 

Same here, just left /* pattern


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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-28 Thread Peer Mohammad
Hi,

Please find the web.xml and struts.xml file. I have observed that many library 
classes are not available in strut2-tiles-plugin file and xwork some package in 
struts-core-2.5.22 compare to struts2.3.35.
I am not accessing jsp file directly.
Kindly check and the web.xml and struts.xml and guide me 
Web.xml

 
http://xmlns.jcp.org/xml/ns/javaee;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
 version="3.1">
CHEETTA_online



org.apache.struts2.tiles.StrutsTilesListener





CSRFTokenFilter

com.sbc.cheetta.common.framework.filter.GenerateCSRFTokenFilter


CSRFTokenFilter
/*

 
CSRFTokenFilter
*.action


CSRFTokenFilter
*.do


   

CSRFValidationFilter

com.sbc.cheetta.common.framework.filter.CSRFValidationFilter
 
excludedUrls


/index.jsp,/Welcome.do,/Logoff.do,/LogonSubmit.do,/networkEditProfileLinker.do,/images/swmainmenubutton.gif,/images/att_logo.gif,/images/mwmainmenubutton.gif,/images/admin.gif,/theme/Master.css,/images/wmainmenubutton.gif,/images/atmainmenubutton.gif,/images/bg_header1024.gif,/images/bg_footer1024.gif,/images/bg_header1024.gif
  
 


CSRFValidationFilter
/*
   



xFrameOptionsFilter

com.sbc.cheetta.common.framework.filter.XFrameOptionsFilter


xFrameOptionsFilter
*.action
 

xFrameOptionsFilter
*.do
 

struts2

org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

actionPackages
com.sbc.cheetta.actions



struts2
/*


struts2
*.action


struts2
*.do



MetaDataServlet

com.sbc.cheetta.util.MetaDataServlet
2


InvalidLogoutServlet

com.sbc.cheetta.java.InvalidLogoutServlet


InvalidLogoutServlet
/InvalidLogoutServlet



480



index.jsp



CHEETTADataSource
javax.sql.DataSource
Container
Shareable




Struts.xml:


http://struts.apache.org/dtds/struts-2.5.dtd;>

  



 



















 
 
 
 
 










dojo\..*



input,back,cancel,browse


  
  







dojo\..*,^struts\..*



input,back,cancel,browse
 
   
 



Logoff.do
InvalidLogout.do
/Logon.jsp
/Logon.jsp
/Welcome.jsp
/WelcomeAdmin.jsp
cheetta.logicError
cheetta.logicError
cheetta.login
RegionDispatch.do
cheetta.login
cheetta.underdevelopment
cheetta.customError
cheetta.token


  




   

Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-01 Thread Lukasz Lenart
czw., 1 paź 2020 o 22:00 Peer Mohammad  napisał(a):
> I have followed the above mentioned guide and i had removed the XWork as 
> well,But error remains the same. I am trying last 45 days to resolve this 
> issue but able to resolve yet. Any suggestion/guidance will be appreciable.

Can you share your web.xml and struts.xml? Also do you access a JSP
file directly through the browser?


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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-01 Thread Peer Mohammad



On 2020/09/28 11:17:50, Lukasz Lenart  wrote: 
> pon., 28 wrz 2020 o 12:35 Peer Mohammad  napisał(a):
> >
> > Hi Team,
> >
> > I am getting error while migrating Struts2.3.35 to Struts2.5.22 as "There 
> > is no ActionContext for current request! - [unknown location]"
> > console log: ERROR StrutsTilesLocaleResolver cannot obtain 
> > HttpServletRequest from [org.apache.tiles.request.jsp.JspRequest].
> 
> Did you follow the upgrade procedure?
> https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles
> 
> > list of jars for Strust2.5.22
> >
> > struts2-core 2.5.22
> > freemarker -2.3.30
> > xwork-core -2.3.37
> 
> You do not need XWork anymore, please remove the jar
> 
> 
> 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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-10-01 Thread Peer Mohammad



On 2020/09/28 11:17:50, Lukasz Lenart  wrote: 
> pon., 28 wrz 2020 o 12:35 Peer Mohammad  napisał(a):
> >
> > Hi Team,
> >
> > I am getting error while migrating Struts2.3.35 to Struts2.5.22 as "There 
> > is no ActionContext for current request! - [unknown location]"
> > console log: ERROR StrutsTilesLocaleResolver cannot obtain 
> > HttpServletRequest from [org.apache.tiles.request.jsp.JspRequest].
> 
> Did you follow the upgrade procedure?
> https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles
> 
> > list of jars for Strust2.5.22
> >
> > struts2-core 2.5.22
> > freemarker -2.3.30
> > xwork-core -2.3.37
> 
> You do not need XWork anymore, please remove the jar
> 
> 
> 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
> 
> I have followed the above mentioned guide and i had removed the XWork as 
> well,But error remains the same. I am trying last 45 days to resolve this 
> issue but able to resolve yet. Any suggestion/guidance will be appreciable.
Thanks,
Peer M Ansari 

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



Re: Issue in migration from struts2.3.35 to struts2.5.22

2020-09-28 Thread Lukasz Lenart
pon., 28 wrz 2020 o 12:35 Peer Mohammad  napisał(a):
>
> Hi Team,
>
> I am getting error while migrating Struts2.3.35 to Struts2.5.22 as "There is 
> no ActionContext for current request! - [unknown location]"
> console log: ERROR StrutsTilesLocaleResolver cannot obtain HttpServletRequest 
> from [org.apache.tiles.request.jsp.JspRequest].

Did you follow the upgrade procedure?
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-Tiles

> list of jars for Strust2.5.22
>
> struts2-core 2.5.22
> freemarker -2.3.30
> xwork-core -2.3.37

You do not need XWork anymore, please remove the jar


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