[ANN] Apache Struts 2.5.12 GA with Security Fixes Release

2017-07-13 Thread Lukasz Lenart
The Apache Struts group is pleased to announce that Struts 2.5.12 is
available as a “General Availability” release. The GA designation is
our highest quality grade.

Apache Struts 2 is an elegant, extensible framework for creating
enterprise-ready Java web applications. The framework is designed to
streamline the full development cycle, from building, to deploying, to
maintaining applications over time.

This release contains fixes for the following potential security
vulnerabilities:

- S2-047 Possible DoS attack when using URLValidator
  http://struts.apache.org/docs/s2-047.html
- S2-049 A DoS attack is available for Spring secured actions
  http://struts.apache.org/docs/s2-049.html

Except the above this release also contains several improvements just
to mention few of them:

- `double` and `Double` are not validated with the same decimal separator
- `ognl.MethodFailedException` when you do not enter a value for a
field mapped to an int
- `Double` Value Conversion with requestLocale=de
- The `TextProvider` injection in `ActionSupport` isn't quite
integrated into the framework's core DI
- Struts2 raise `java.lang.ClassCastException` when Result type is `chain`
- `@InputConfig` annotation is not working when integrating with spring aop
- Validators do not work for multiple values
- `BigDecimal` are not converted according context locale
- `NullPointerException` when displaying a form without action attribute
- Http Sessions forcefully created for all requests using
I18nInterceptor with default Storage value.
- `cssErrorClass` attribute has no effect on `label` tag
- Why `JSONValidationInterceptor` return Status Code `400 BAD_REQUEST`
instead of `200 SUCCESS`
- @autowired does not work since Struts 2.3.28.1
- Mixed content https to http when upgraded to 2.3.32 or 2.5.10.1
- Upgrade from struts2-tiles3-plugin to struts2-tiles-plugin gives a
NoSuchDefinitionException
- Aspects are not executed when chaining AOPed actions
- Duplicate hidden input field checkboxListHandler
- The value of checkbox getted in server-side is "false" when no any
checkbox been selected.
- refactor file upload framework
- `creditCard` validator available in Struts 1 missing in Struts 2
- No easy way to have an empty interceptor stack if have default stack
- `@TypeConversion` converter attribute to class
- Convert `LocalizedTextUtil` into a bean with default implementation
- NPE in `StrutsTilesContainerFactory` when resource isn't found
- Buffer/Flush behaviour in `FreemarkerResult`
- Struts2 should know and consider config time class of user's Actions
- getters of exclude-sets in OgnlUtil should return immutable collections
- Mark `site-graph` plugin as deprecated
- Use `TextProviderFactory` instead of `TextProvider` as bean's dependency
- Create `LocaleProviderFactory` and uses instead of `LocaleProvider`
- Improve error logging in `DefaultDispatcherErrorHandler`
- Make `jakarta-stream` multipart parser more extensible
- Make Multipart parsers more extensible
- Add proper validation if request is a multipart request
- Make `SecurityMethodAccess` excluded classes & packages definitions immutable
- Upgrade to Log4j2 2.8.2
- Allow disable file upload support via an configurable option
- Stop using `DefaultLocalizedTextProvider#localeFromString` static util method
- Don't add `JBossFileManager` as a possible FileManager when not on JBoss
- There is no `@LongRangeFieldValidator` annotation to support
`LongRangeFieldValidator`
- Upgrade to commons-lang 3.6
- Update commons-fileupload

Please read the Version Notes to find more details about performed bug
fixes and improvements.
http://struts.apache.org/docs/version-notes-2512.html

All developers are strongly advised to perform this action.

The 2.5.x series of the Apache Struts framework has a minimum
requirement of the following specification versions: Servlet API 2.4,
JSP API 2.0, and Java 7.

Should any issues arise with your use of any version of the Struts
framework, please post your comments to the user list, and, if
appropriate, file a tracking ticket.

You can download this version from our download page.
http://struts.apache.org/download.cgi#struts-ga


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: org.apache.struts2.interceptor.I18nInterceptor seems to work only once + can defaulting to accept headers (and impacting on number/date parsing) be disabled?

2017-07-13 Thread Christoph Nenning
> Hi all,
> 
> I joined a project recently that makes use of Struts 2, and was tasked
> with enabling internationalisation for it. I'm completely new to the
> framework, and the project has organically grown over the years -
> which means the project has a multitude of interceptors and chains
> configured (some interceptors even seem to be called more than once by
> the same chain), which might interfere with each other. So please bear
> with me.
> 
> After spending some time bringing the project to the latest version of
> Struts (and dealing with several breaking changes, mostly on the
> Struts tags level), I have added the I18nInterceptor, as described on
> [1] and added the following two parameters to it:
> parameterName=language
> localeStorage=session
> 
> Our resource bundle has an English default and a "de" properties file.
> 
> I also set ParametersInterceptor's excludeParams to "language" as per
> [2], to avoid getting errors about my actions not having a "language"
> setter. (For some reason, that appeared in the log, where I would have
> expected it, albeit not as an ERROR, and on the page itself, which
> prompted me to disable it.) Was that the right thing to do, or
> superfluous?
> 
> When I set my "default" browser language to German, and call the page,
> it loads the German text all right (so L10n of text works).
> When I append the page's URL by ?language=en, it switches back to
> English, which is great.
> Sadly. this only seems to work exactly once per session. When I then
> try to call ?language=de again, it stays English.
> That's problem number one.
> 
> Problem number two is that I would prefer the interceptor to not check
> the accept header, i.e. to ignore the browser.
> Part of the reason is that the project owners always want to display
> English, unless another language is explicitly chosen via URL
> parameter. But mainly, we use number and date parsing in a lot of
> places, and that depends on a British locale (i.e. en_GB, or de_GB;
> the JS front-end doesn't check the user's locale, and calendar widgets
> etc. all use British formats). A colleague of mine accessed the test
> server after we had enabled the interceptor, and his browser had en_US
> set as the first language in his accept header. Let's just say it
> didn't go well, because our app didn't know what to make of the 12th
> day of the 31st month anno 2017... (Ideally, we'd go for full g11n,
> i.e. i18n of everything, not just text messages, but we won't have
> time for it for the foreseeable future. Instead, for the immediate
> future, we'd like maybe to extend the interceptor to only accept
> locales from a predefined list (forcing the country to GB) - or only
> use the locale for getText() [3] and nothing else...) Is there a
> (fairly straightforward) way to disable the accept header fallback?
> 
> Last but not least, I have been unable to get debug output from either
> of the two interceptors mentioned [4]...
> 
> I'd really appreciate if anyone could nudge me into the right
> direction - especially regarding the "works once, but only once"
> problem.
> 
> Kind regards,
> Christian
> 
> P.S.: If all else fails, I thought I might try to use a custom-made
> language switch similar to [5]...?
> 
> 1) https://struts.apache.org/docs/i18n-interceptor.html
> 2) https://struts.apache.org/docs/parameters-interceptor.html
> 3) https://struts.apache.org/docs/localization.html
> 4) https://stackoverflow.com/questions/45065459/how-do-i-configure-
> log4j-to-log-messages-for-a-package-below-the-rootloggers-lo
> 5) https://www.mkyong.com/struts/struts-internationalizing-or-
> localization-example/
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 


Hi,


> I also set ParametersInterceptor's excludeParams to "language" as per
> [2], to avoid getting errors about my actions not having a "language"
> setter. (For some reason, that appeared in the log, where I would have
> expected it, albeit not as an ERROR, and on the page itself, which
> prompted me to disable it.) Was that the right thing to do, or
> superfluous?

Such messages appear on pages when struts devMode is enabled. Thats great 
for development but should be disabled for production.

See https://struts.apache.org/docs/devmode.html

The docs of I18nInterceptor say default value of parameterName is 
"request_locale" and that one is in ParametersInterceptor's excludeParams 
by default. As you changed I18nInterceptor's parameterName it makes sense 
to put your new value in ParametersInterceptor's excludeParams, too.



> Sadly. this only seems to work exactly once per session. When I then
> try to call ?language=de again, it stays English.
> That's problem number one.


Your obvious choices are to use the other storage mechanism (cookie) or 
not store locale at all. In that case your app must add parameter 
"request_locale" in

Struts 2.5.12

2017-07-13 Thread Tamás Barta
Hi,

I have just tried to migrate to 2.5.12 from 2.5.10.1. I got the following
error at startup:

Caused by: com.opensymphony.xwork2.inject.DependencyException: Dependency
mapping for [type=java.lang.String, name='struts.devMode'] already exists.
at
com.opensymphony.xwork2.inject.ContainerBuilder.checkKey(ContainerBuilder.java:108)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.inject.ContainerBuilder.factory(ContainerBuilder.java:83)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.inject.ContainerBuilder.constant(ContainerBuilder.java:517)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.inject.ContainerBuilder.constant(ContainerBuilder.java:398)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:284)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:159)
[struts2-core-2.5.12.jar:2.5.12]
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:63)
[struts2-core-2.5.12.jar:2.5.12]
at
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:960)
[struts2-core-2.5.12.jar:2.5.12]
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:466)
[struts2-core-2.5.12.jar:2.5.12]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
[struts2-core-2.5.12.jar:2.5.12]
... 14 more

Are there any migration step needed?

Regards, Tamás


Re: Struts 2.5.12

2017-07-13 Thread Lukasz Lenart
2017-07-13 14:24 GMT+02:00 Tamás Barta :
> Hi,
>
> I have just tried to migrate to 2.5.12 from 2.5.10.1. I got the following
> error at startup:
>
> Caused by: com.opensymphony.xwork2.inject.DependencyException: Dependency
> mapping for [type=java.lang.String, name='struts.devMode'] already exists.
> at
> com.opensymphony.xwork2.inject.ContainerBuilder.checkKey(ContainerBuilder.java:108)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.inject.ContainerBuilder.factory(ContainerBuilder.java:83)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.inject.ContainerBuilder.constant(ContainerBuilder.java:517)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.inject.ContainerBuilder.constant(ContainerBuilder.java:398)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:284)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:159)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:63)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:960)
> [struts2-core-2.5.12.jar:2.5.12]
> at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:466)
> [struts2-core-2.5.12.jar:2.5.12]
> at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
> [struts2-core-2.5.12.jar:2.5.12]
> ... 14 more
>
> Are there any migration step needed?

Looks like more than one struts2-core.jar on the classpath


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



About Apache Struts 2.5.12 GA with Security Fixes Release

2017-07-13 Thread Emi

Hello,

May I know do you release one update version for 2.3.x about this bug 
fix as well?


Thanks.



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



Re: About Apache Struts 2.5.12 GA with Security Fixes Release

2017-07-13 Thread Lukasz Lenart
2017-07-13 15:15 GMT+02:00 Emi :
> Hello,
>
> May I know do you release one update version for 2.3.x about this bug fix as
> well?

Yes, there is 2.3.33 under way to the central and mirrors, it should
be announced early today.


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: Struts 2.5.12

2017-07-13 Thread Tamás Barta
Hmm, struts jars are only once in ear's lib. I just replaced the old
versions. Interesting.

2017. júl. 13. du. 2:42 ezt írta ("Lukasz Lenart" ):

> 2017-07-13 14:24 GMT+02:00 Tamás Barta :
> > Hi,
> >
> > I have just tried to migrate to 2.5.12 from 2.5.10.1. I got the following
> > error at startup:
> >
> > Caused by: com.opensymphony.xwork2.inject.DependencyException:
> Dependency
> > mapping for [type=java.lang.String, name='struts.devMode'] already
> exists.
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.
> checkKey(ContainerBuilder.java:108)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.
> factory(ContainerBuilder.java:83)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.
> constant(ContainerBuilder.java:517)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.
> constant(ContainerBuilder.java:398)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.impl.DefaultConfiguration.
> createBootstrapContainer(DefaultConfiguration.java:284)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.impl.DefaultConfiguration.
> reloadContainer(DefaultConfiguration.java:159)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
> ConfigurationManager.java:63)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > org.apache.struts2.dispatcher.Dispatcher.getContainer(
> Dispatcher.java:960)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
> Dispatcher.java:466)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
> > [struts2-core-2.5.12.jar:2.5.12]
> > ... 14 more
> >
> > Are there any migration step needed?
>
> Looks like more than one struts2-core.jar on the classpath
>
>
> 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: Struts 2.5.12

2017-07-13 Thread Lukasz Lenart
2017-07-13 15:32 GMT+02:00 Tamás Barta :
> Hmm, struts jars are only once in ear's lib. I just replaced the old
> versions. Interesting.

but maybe in a cache folder or tmp or in a folder where the EAR got expanded


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



Issues with Localization changes in 2.5.12

2017-07-13 Thread Adam Brin
Hi,
  With the removal of the TextProviderFactory and it’s replacement with beans, 
I can’t figure out how to properly setup our test environment (when testing 
Controllers that are autowired by spring.  How do I inject a custom 
resourceBundle into the ActionContext or stack?  I used to be able to create my 
own textProvider, but this no longer works.I’ve seen code like the 
following in the struts2 tests, but localizedTextProvider is null here:

LocalizedTextProvider localizedTextProvider = 
container.getInstance(LocalizedTextProvider.class);

I think if I can get the localizedTextProvider properly installed into the 
container, I’d be fine, but I can’t see how to do that. Here’s our setup code 
that worked with Struts 2.5.10:


   T controller = applicationContext.getBean(controllerClass);
if (controller instanceof AbstractAuthenticatableAction) {
TdarActionSupport tas = (TdarActionSupport) controller;
tas.setServletRequest(getServletRequest());
tas.setServletResponse(getServletResponse());
// set the context
}
Map contextMap = new HashMap();
contextMap.put(StrutsStatics.HTTP_REQUEST, getServletRequest());
ActionContext context = new ActionContext(contextMap);
context.setLocale(Locale.getDefault());

ConfigurationManager configurationManager = new ConfigurationManager();
OgnlValueStackFactory factory = new OgnlValueStackFactory();

// FIXME: needs to be a better way to handle this
TextProviderFactory textProviderFactory = new TextProviderFactory();


factory.setTextProvider(textProviderFactory.createInstance(getResourceBundle(), 
(LocaleProvider) controller));

configurationManager.addContainerProvider(new 
XWorkConfigurationProvider());
configurationManager.getConfiguration().getContainer().inject(factory);
if (controller instanceof ActionSupport) {
((ActionSupport) 
controller).setContainer(configurationManager.getConfiguration().getContainer());
}
ValueStack stack = factory.createValueStack();

context.setValueStack(stack);
ActionContext.setContext(context);
-- 
_
Adam Brin
Director of Technology, Digital Antiquity
480.965.1278


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



Re: Issues with Localization changes in 2.5.12

2017-07-13 Thread Adam Brin
Figured this out:


Map contextMap = new HashMap();
contextMap.put(StrutsStatics.HTTP_REQUEST, getServletRequest());
ActionContext context = new ActionContext(contextMap);
context.setLocale(Locale.getDefault());
// 
http://mail-archives.apache.org/mod_mbox/struts-user/201001.mbox/%3c637b76e41001151852x119c9cd4vbbe6ff560e56e...@mail.gmail.com%3E

ConfigurationManager configurationManager = new 
ConfigurationManager(Container.DEFAULT_NAME);
OgnlValueStackFactory factory = new OgnlValueStackFactory();
configurationManager.addContainerProvider(new 
XWorkConfigurationProvider());
configurationManager.reload();
Container container = 
configurationManager.getConfiguration().getContainer();
container.inject(factory);

LocalizedTextProvider instance = 
container.getInstance(LocalizedTextProvider.class);
instance.addDefaultResourceBundle(“…");

…


-- 
_
Adam Brin
Director of Technology, Digital Antiquity
480.965.1278

> On Jul 13, 2017, at 11:08 AM, Adam Brin  wrote:
> 
> Hi,
>  With the removal of the TextProviderFactory and it’s replacement with beans, 
> I can’t figure out how to properly setup our test environment (when testing 
> Controllers that are autowired by spring.  How do I inject a custom 
> resourceBundle into the ActionContext or stack?  I used to be able to create 
> my own textProvider, but this no longer works.I’ve seen code like the 
> following in the struts2 tests, but localizedTextProvider is null here:
> 
>LocalizedTextProvider localizedTextProvider = 
> container.getInstance(LocalizedTextProvider.class);
> 
> I think if I can get the localizedTextProvider properly installed into the 
> container, I’d be fine, but I can’t see how to do that. Here’s our setup code 
> that worked with Struts 2.5.10:
> 
> 
>   T controller = applicationContext.getBean(controllerClass);
>if (controller instanceof AbstractAuthenticatableAction) {
>TdarActionSupport tas = (TdarActionSupport) controller;
>tas.setServletRequest(getServletRequest());
>tas.setServletResponse(getServletResponse());
>// set the context
>}
>Map contextMap = new HashMap();
>contextMap.put(StrutsStatics.HTTP_REQUEST, getServletRequest());
>ActionContext context = new ActionContext(contextMap);
>context.setLocale(Locale.getDefault());
> 
>ConfigurationManager configurationManager = new ConfigurationManager();
>OgnlValueStackFactory factory = new OgnlValueStackFactory();
> 
>// FIXME: needs to be a better way to handle this
>TextProviderFactory textProviderFactory = new TextProviderFactory();
> 
>
> factory.setTextProvider(textProviderFactory.createInstance(getResourceBundle(),
>  (LocaleProvider) controller));
> 
>configurationManager.addContainerProvider(new 
> XWorkConfigurationProvider());
>configurationManager.getConfiguration().getContainer().inject(factory);
>if (controller instanceof ActionSupport) {
>((ActionSupport) 
> controller).setContainer(configurationManager.getConfiguration().getContainer());
>}
>ValueStack stack = factory.createValueStack();
> 
>context.setValueStack(stack);
>ActionContext.setContext(context);
> -- 
> _
> Adam Brin
> Director of Technology, Digital Antiquity
> 480.965.1278
> 


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



JasperReports plugin - confused on a NullPointerException

2017-07-13 Thread Jon Eskin
I tried to make a sample project using code from a tutorial I found for the 
JasperReports plugin 
(https://struts.apache.org/docs/jasperreports-tutorial.html 
). 

I’m seeing a NullPointerException in my logs when I try to run the report (see 
below). It’s complaining about not closing a db connection even though no db 
connection is made. I uploaded a small project demonstrating the issue: 
https://github.com/jpe90/struts2jasper 

Am I doing something wrong or is this a bug?

Error:

2017-07-13 19:59:56,616 WARN  [http-nio-8080-exec-6] 
jasperreports.JasperReportsResult (JasperReportsResult.java:392) - Could not 
close db connection properly
java.lang.NullPointerException: null
at 
org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:390)
 [struts2-jasperreports-plugin-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
 [struts2-core-2.5.10.1.jar:2.5.10.1]
at 
org.apache.struts2.interceptor.

Re: Issues with Localization changes in 2.5.12

2017-07-13 Thread Lukasz Lenart
2017-07-13 20:08 GMT+02:00 Adam Brin :
> // FIXME: needs to be a better way to handle this
> TextProviderFactory textProviderFactory = new TextProviderFactory();

I think you can simple use StrutsTextProviderFactory instead - it
works exactly the same way.


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: JasperReports plugin - confused on a NullPointerException

2017-07-13 Thread Lukasz Lenart
Can you try to use the latest 2.5.12 version? There was some issue
related to the JasperReports fixed with this release.

2017-07-14 2:10 GMT+02:00 Jon Eskin :
> I tried to make a sample project using code from a tutorial I found for the 
> JasperReports plugin 
> (https://struts.apache.org/docs/jasperreports-tutorial.html 
> ).
>
> I’m seeing a NullPointerException in my logs when I try to run the report 
> (see below). It’s complaining about not closing a db connection even though 
> no db connection is made. I uploaded a small project demonstrating the issue: 
> https://github.com/jpe90/struts2jasper 
> 
>
> Am I doing something wrong or is this a bug?
>
> Error:
>
> 2017-07-13 19:59:56,616 WARN  [http-nio-8080-exec-6] 
> jasperreports.JasperReportsResult (JasperReportsResult.java:392) - Could not 
> close db connection properly
> java.lang.NullPointerException: null
> at 
> org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:390)
>  [struts2-jasperreports-plugin-2.5.10.1.jar:2.5.10.1]
> at 
> org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69)
>  [struts2-core-2.5.10.1.jar:2.5.10.1]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
>  [struts2-core-2.5.10

Re: Struts 2.5.12

2017-07-13 Thread Tamás Barta
Dear Lukasz, thank you very much for your very fast support all the time.

It seems that new version is not compatible with JRebel. Have you tried
starting a new version struts app with JRebel?

If I replace the 3 struts jar files I use (core, spring-plugin,
convention-plugin) to the old version, everything works fine. If I change
back to new ones, it goes wrong.




On Thu, Jul 13, 2017 at 2:42 PM, Lukasz Lenart 
wrote:

> 2017-07-13 14:24 GMT+02:00 Tamás Barta :
> > Hi,
> >
> > I have just tried to migrate to 2.5.12 from 2.5.10.1. I got the following
> > error at startup:
> >
> > Caused by: com.opensymphony.xwork2.inject.DependencyException:
> Dependency
> > mapping for [type=java.lang.String, name='struts.devMode'] already
> exists.
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.checkKey(
> ContainerBuilder.java:108)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.factory(
> ContainerBuilder.java:83)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.constant(
> ContainerBuilder.java:517)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.inject.ContainerBuilder.constant(
> ContainerBuilder.java:398)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.impl.DefaultConfiguration.cre
> ateBootstrapContainer(DefaultConfiguration.java:284)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.impl.DefaultConfiguration.rel
> oadContainer(DefaultConfiguration.java:159)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > com.opensymphony.xwork2.config.ConfigurationManager.getConfi
> guration(ConfigurationManager.java:63)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispat
> cher.java:960)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at
> > org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfigu
> ration(Dispatcher.java:466)
> > [struts2-core-2.5.12.jar:2.5.12]
> > at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
> > [struts2-core-2.5.12.jar:2.5.12]
> > ... 14 more
> >
> > Are there any migration step needed?
>
> Looks like more than one struts2-core.jar on the classpath
>
>
> 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
>
>