[jira] [Commented] (WW-4408) NPE with ActionContext.getContext().getSession() / RequestWrapper

2014-10-13 Thread Christoph Nenning (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169099#comment-14169099
 ] 

Christoph Nenning commented on WW-4408:
---

It happens in a ConfigProvider. I created a small demo app:

https://github.com/wolpi/struts2-samples/tree/master/ww4408

When this app is run in jetty, all the exceptions are thrown at startup. (The 
original app is run in websphere, there it happens on first request.)

The interesting class is FileUploadLocaleConfigProvider. It has two workarounds 
outcommented:
- null check
- catch RuntimeException

Neither of those were necessary with 2.3.16.3.


 NPE with ActionContext.getContext().getSession() / RequestWrapper
 -

 Key: WW-4408
 URL: https://issues.apache.org/jira/browse/WW-4408
 Project: Struts 2
  Issue Type: Bug
  Components: Core Actions
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: session
 Fix For: 2.3.18


 Since 2.3.18 it happens that I get an NPE when accessing 
 ActionContext.getContext().getSession().
 When i log the Session Map it is printed as {} but when calling get() on 
 it, an NPE is thrown. So it is kind of null but not really null ?
 Seems to happen only when no HttpSession is present. The NPE is wrapped in a 
 lot of RuntimeExceptions:
 {noformat}
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.RuntimeException: java.lang.RuntimeException: 
 java.lang.NullPointerException
   at 
 com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
   at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
   at 
 com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514)
   at 
 com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524)
   at 
 com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555)
   at 
 com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584)
   at 
 com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553)
   at 
 com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:257)
   at 
 com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
   at 
 org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
   at 
 org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
   at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
   at 
 org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
   at 
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
   at 
 com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:145)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:600)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:507)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:312)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:385)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:924)
   at 
 com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
   at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3837)
   at 
 com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
   at 
 com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
   at 
 com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
   at 
 com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
   at 
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
   at 
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
   at 
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
   at 
 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
 

[jira] [Commented] (WW-4407) LocalizedTextUtil reports WARNings when app uses more than one resource bundle

2014-10-13 Thread Christoph Nenning (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169140#comment-14169140
 ] 

Christoph Nenning commented on WW-4407:
---

What do you think of doing something simple like this ?
{noformat}
public static String findDefaultText(String aTextName, Locale locale) {
ListString localList = 
classLoaderMap.get(Thread.currentThread().getContextClassLoader().hashCode());

for (String bundleName : localList) {
ResourceBundle bundle = findResourceBundle(bundleName, locale);
if (bundle != null) {
reloadBundles();
try {
return bundle.getString(aTextName);
} catch (MissingResourceException e) {
// will be logged when not found in any bundle
}
}
}

if (devMode) {
LOG.warn(Missing key [#0] in bundles [#1]!, aTextName, localList);
} else if (LOG.isDebugEnabled()) {
LOG.debug(Missing key [#0] in bundles [#1]!, aTextName, 
localList);
}

return null;
}

{noformat}

 LocalizedTextUtil reports WARNings when app uses more than one resource bundle
 --

 Key: WW-4407
 URL: https://issues.apache.org/jira/browse/WW-4407
 Project: Struts 2
  Issue Type: Bug
  Components: Other
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: i18n
 Fix For: 2.3.x


 In my app I use 3 resource bundles. One of them is located direclty in the 
 app and contains most text keys. The other two are located in JARs that are 
 reused in several apps and bring a few own text keys.
 Each Key is defined in exactly one bundle.
 Since Version 2.3.18 LocalizedTextUtil searches each key in all bundles and 
 reports WARN messages for those bundles the key is not located in:
 WARN  opensymphony.xwork2.util.LocalizedTextUtil - Missing key [...] in 
 bundle [...]!
 Is is probably caused by WW-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4407) LocalizedTextUtil reports WARNings when app uses more than one resource bundle

2014-10-13 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4407:
--
Fix Version/s: (was: 2.3.x)
   2.3.18

 LocalizedTextUtil reports WARNings when app uses more than one resource bundle
 --

 Key: WW-4407
 URL: https://issues.apache.org/jira/browse/WW-4407
 Project: Struts 2
  Issue Type: Bug
  Components: Other
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: i18n
 Fix For: 2.3.18


 In my app I use 3 resource bundles. One of them is located direclty in the 
 app and contains most text keys. The other two are located in JARs that are 
 reused in several apps and bring a few own text keys.
 Each Key is defined in exactly one bundle.
 Since Version 2.3.18 LocalizedTextUtil searches each key in all bundles and 
 reports WARN messages for those bundles the key is not located in:
 WARN  opensymphony.xwork2.util.LocalizedTextUtil - Missing key [...] in 
 bundle [...]!
 Is is probably caused by WW-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4407) LocalizedTextUtil reports WARNings when app uses more than one resource bundle

2014-10-13 Thread Lukasz Lenart (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169152#comment-14169152
 ] 

Lukasz Lenart commented on WW-4407:
---

Looks good to me :-)

 LocalizedTextUtil reports WARNings when app uses more than one resource bundle
 --

 Key: WW-4407
 URL: https://issues.apache.org/jira/browse/WW-4407
 Project: Struts 2
  Issue Type: Bug
  Components: Other
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: i18n
 Fix For: 2.3.18


 In my app I use 3 resource bundles. One of them is located direclty in the 
 app and contains most text keys. The other two are located in JARs that are 
 reused in several apps and bring a few own text keys.
 Each Key is defined in exactly one bundle.
 Since Version 2.3.18 LocalizedTextUtil searches each key in all bundles and 
 reports WARN messages for those bundles the key is not located in:
 WARN  opensymphony.xwork2.util.LocalizedTextUtil - Missing key [...] in 
 bundle [...]!
 Is is probably caused by WW-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4407) LocalizedTextUtil reports WARNings when app uses more than one resource bundle

2014-10-13 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169191#comment-14169191
 ] 

ASF subversion and git services commented on WW-4407:
-

Commit 381e92757520af833c6cd94dc383a1206296f52d in struts's branch 
refs/heads/develop from cnenning
[ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=381e927 ]

logging missing text keys only after all resource bundles have been
searched, see WW-4407


 LocalizedTextUtil reports WARNings when app uses more than one resource bundle
 --

 Key: WW-4407
 URL: https://issues.apache.org/jira/browse/WW-4407
 Project: Struts 2
  Issue Type: Bug
  Components: Other
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: i18n
 Fix For: 2.3.18


 In my app I use 3 resource bundles. One of them is located direclty in the 
 app and contains most text keys. The other two are located in JARs that are 
 reused in several apps and bring a few own text keys.
 Each Key is defined in exactly one bundle.
 Since Version 2.3.18 LocalizedTextUtil searches each key in all bundles and 
 reports WARN messages for those bundles the key is not located in:
 WARN  opensymphony.xwork2.util.LocalizedTextUtil - Missing key [...] in 
 bundle [...]!
 Is is probably caused by WW-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4407) LocalizedTextUtil reports WARNings when app uses more than one resource bundle

2014-10-13 Thread Christoph Nenning (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christoph Nenning resolved WW-4407.
---
Resolution: Fixed

Pushed it to git-wip-us.apache.org.

My first commit, yay !


 LocalizedTextUtil reports WARNings when app uses more than one resource bundle
 --

 Key: WW-4407
 URL: https://issues.apache.org/jira/browse/WW-4407
 Project: Struts 2
  Issue Type: Bug
  Components: Other
Affects Versions: 2.3.18
Reporter: Christoph Nenning
Priority: Minor
  Labels: i18n
 Fix For: 2.3.18


 In my app I use 3 resource bundles. One of them is located direclty in the 
 app and contains most text keys. The other two are located in JARs that are 
 reused in several apps and bring a few own text keys.
 Each Key is defined in exactly one bundle.
 Since Version 2.3.18 LocalizedTextUtil searches each key in all bundles and 
 reports WARN messages for those bundles the key is not located in:
 WARN  opensymphony.xwork2.util.LocalizedTextUtil - Missing key [...] in 
 bundle [...]!
 Is is probably caused by WW-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4412) Context started without being closed

2014-10-13 Thread Hazem Taji (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hazem Taji updated WW-4412:
---
Attachment: tiles-test.zip

Test project demonstrating the issue

 Context started without being closed
 

 Key: WW-4412
 URL: https://issues.apache.org/jira/browse/WW-4412
 Project: Struts 2
  Issue Type: Bug
  Components: Plugin - Tiles
Affects Versions: 2.3.16.3
Reporter: Hazem Taji
 Fix For: 2.3.x

 Attachments: tiles-test.zip


 In the TilesResult class, in doExecute, a context is started but not ended. 
 This causes the context stack later to have extra irrelevant contexts.
 The problem prevents the use of s:action tags where actions have tile 
 results and results in the tile attributes being unrecognized.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4412) Context started without being closed

2014-10-13 Thread Hazem Taji (JIRA)

[ 
https://issues.apache.org/jira/browse/WW-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14169202#comment-14169202
 ] 

Hazem Taji commented on WW-4412:


The s:action tag in BaseLayout.jsp causes the tiles to add 2 elements to the 
context stack, only popping one after it finishes. When trying to load the 
footer attribute, it will complain as it will not find the correct definition 
made in the resources/tiles/tiles-index.xml file.

My analysis is that in TilesResult class the context is started, but is not 
closed after rendering. If closed, the example works correctly.

 Context started without being closed
 

 Key: WW-4412
 URL: https://issues.apache.org/jira/browse/WW-4412
 Project: Struts 2
  Issue Type: Bug
  Components: Plugin - Tiles
Affects Versions: 2.3.16.3
Reporter: Hazem Taji
 Fix For: 2.3.x

 Attachments: tiles-test.zip


 In the TilesResult class, in doExecute, a context is started but not ended. 
 This causes the context stack later to have extra irrelevant contexts.
 The problem prevents the use of s:action tags where actions have tile 
 results and results in the tile attributes being unrecognized.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (WW-4413) Improve JSON interceptor to handle JSON arrays

2014-10-13 Thread Aleksandr Mashchenko (JIRA)
Aleksandr Mashchenko created WW-4413:


 Summary: Improve JSON interceptor to handle JSON arrays
 Key: WW-4413
 URL: https://issues.apache.org/jira/browse/WW-4413
 Project: Struts 2
  Issue Type: Improvement
  Components: Plugin - JSON
Affects Versions: 2.3.16.3
Reporter: Aleksandr Mashchenko


Currently JSON interceptor fails if request holds a JSON array. This PR adds 
the ability to handle JSON arrays.
NOTE: {root} attribute must be set on the JSONInterceptor when dealing with 
JSON array.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4413) Improve JSON interceptor to handle JSON arrays

2014-10-13 Thread Aleksandr Mashchenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandr Mashchenko updated WW-4413:
-
Description: 
Currently JSON interceptor fails if request holds a JSON array. This PR adds 
the ability to handle JSON arrays.
NOTE: root attribute must be set on the JSONInterceptor when dealing with JSON 
array.

  was:
Currently JSON interceptor fails if request holds a JSON array. This PR adds 
the ability to handle JSON arrays.
NOTE: {root} attribute must be set on the JSONInterceptor when dealing with 
JSON array.


 Improve JSON interceptor to handle JSON arrays
 --

 Key: WW-4413
 URL: https://issues.apache.org/jira/browse/WW-4413
 Project: Struts 2
  Issue Type: Improvement
  Components: Plugin - JSON
Affects Versions: 2.3.16.3
Reporter: Aleksandr Mashchenko

 Currently JSON interceptor fails if request holds a JSON array. This PR adds 
 the ability to handle JSON arrays.
 NOTE: root attribute must be set on the JSONInterceptor when dealing with 
 JSON array.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)