[jira] [Updated] (WW-4290) DefaultTypeConverter primitiveDefaults should be static
[ https://issues.apache.org/jira/browse/WW-4290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4290: -- Fix Version/s: 2.3.17 > DefaultTypeConverter primitiveDefaults should be static > --- > > Key: WW-4290 > URL: https://issues.apache.org/jira/browse/WW-4290 > Project: Struts 2 > Issue Type: Improvement > Components: Other >Reporter: Jasper Rosenberg >Priority: Minor > Fix For: 2.3.17 > > > Each type converter which extends DefaultTypeConverter ends up creating its > own copy of the private final unmodifable map primitiveDefaults. It should > just be static and be initialized statically. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (WW-4291) Can't use Spring bean name for type convertor
[ https://issues.apache.org/jira/browse/WW-4291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4291: -- Fix Version/s: 2.3.x > Can't use Spring bean name for type convertor > - > > Key: WW-4291 > URL: https://issues.apache.org/jira/browse/WW-4291 > Project: Struts 2 > Issue Type: Improvement > Components: Plugin - Spring >Reporter: Jasper Rosenberg >Priority: Minor > Fix For: 2.3.x > > > If in your xwork.conversion.properties file you try to use a Spring bean name > instead of a class name, it blows up. > This is because DefaultConfiguration.createBootstrapContainer() ends up using > DefaultTypeConverterCreator which has the generic ObjectFactory at that point > because it happens before the struts.properties file is ever loaded (where in > my case the SpringObjectFactory is defined.) > {noformat} > 10:20:06,910 ERROR [DefaultConversionPropertiesProcessor] Conversion > registration error > java.lang.ClassNotFoundException: entityObjectTypeConvertor > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) > at > com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152) > at > com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:108) > at > com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161) > at > com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151) > at > com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterCreator.createTypeConverter(DefaultTypeConverterCreator.java:23) > at > com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor.loadConversionProperties(DefaultConversionPropertiesProcessor.java:64) > at > com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor.process(DefaultConversionPropertiesProcessor.java:40) > at > com.opensymphony.xwork2.conversion.impl.XWorkConverter.setConversionPropertiesProcessor(XWorkConverter.java:179) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299) > at > com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438) > at > com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207) > ... > at > com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484) > at > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > at > com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484) > at > com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:324) > at > com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:221) > at > com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) > at > org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) > at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) > at > org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) > at > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) > at > org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:325) > at > org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235) > at > org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194) > at > org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) > at > org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) > at > org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115) > at > org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072) > at > org.apache.catalina.core.StandardContext.start(StandardContext.java:4726) > at > org.apache.catalina.core.ContainerBase.addChildInternal(Container
[jira] [Created] (WW-4291) Can't use Spring bean name for type convertor
Jasper Rosenberg created WW-4291: Summary: Can't use Spring bean name for type convertor Key: WW-4291 URL: https://issues.apache.org/jira/browse/WW-4291 Project: Struts 2 Issue Type: Improvement Components: Plugin - Spring Reporter: Jasper Rosenberg Priority: Minor If in your xwork.conversion.properties file you try to use a Spring bean name instead of a class name, it blows up. This is because DefaultConfiguration.createBootstrapContainer() ends up using DefaultTypeConverterCreator which has the generic ObjectFactory at that point because it happens before the struts.properties file is ever loaded (where in my case the SpringObjectFactory is defined.) {noformat} 10:20:06,910 ERROR [DefaultConversionPropertiesProcessor] Conversion registration error java.lang.ClassNotFoundException: entityObjectTypeConvertor at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152) at com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:108) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151) at com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterCreator.createTypeConverter(DefaultTypeConverterCreator.java:23) at com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor.loadConversionProperties(DefaultConversionPropertiesProcessor.java:64) at com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor.process(DefaultConversionPropertiesProcessor.java:40) at com.opensymphony.xwork2.conversion.impl.XWorkConverter.setConversionPropertiesProcessor(XWorkConverter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299) at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438) at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207) ... at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:324) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:221) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:325) at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235) at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.c
[jira] [Created] (WW-4290) DefaultTypeConverter primitiveDefaults should be static
Jasper Rosenberg created WW-4290: Summary: DefaultTypeConverter primitiveDefaults should be static Key: WW-4290 URL: https://issues.apache.org/jira/browse/WW-4290 Project: Struts 2 Issue Type: Improvement Components: Other Reporter: Jasper Rosenberg Priority: Minor Each type converter which extends DefaultTypeConverter ends up creating its own copy of the private final unmodifable map primitiveDefaults. It should just be static and be initialized statically. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (WW-4289) SpringObjectFactory does not obey InitializingBean interface
[ https://issues.apache.org/jira/browse/WW-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4289: -- Fix Version/s: 2.3.17 > SpringObjectFactory does not obey InitializingBean interface > > > Key: WW-4289 > URL: https://issues.apache.org/jira/browse/WW-4289 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Spring >Reporter: Jasper Rosenberg >Priority: Minor > Fix For: 2.3.17 > > > SpringObjectFactory has the comment: > // We don't need to call the init-method since one won't be registered. > Unfortunately, that isn't true since the bean may implement the Spring > interface: InitializingBean > Instead of the comment, it should call: > initializeBean(bean, bean.getClass().getName()); -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Created] (WW-4289) SpringObjectFactory does not obey InitializingBean interface
Jasper Rosenberg created WW-4289: Summary: SpringObjectFactory does not obey InitializingBean interface Key: WW-4289 URL: https://issues.apache.org/jira/browse/WW-4289 Project: Struts 2 Issue Type: Bug Components: Plugin - Spring Reporter: Jasper Rosenberg Priority: Minor SpringObjectFactory has the comment: // We don't need to call the init-method since one won't be registered. Unfortunately, that isn't true since the bean may implement the Spring interface: InitializingBean Instead of the comment, it should call: initializeBean(bean, bean.getClass().getName()); -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (WW-4288) staticParams interceptor overwrites params conversion errors
[ https://issues.apache.org/jira/browse/WW-4288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897854#comment-13897854 ] Jasper Rosenberg commented on WW-4288: -- Whoops, totally wrong :) I was trying to find the version where that change went in and missed it. (Gotta get Git setup locally so I don't have to use the web source viewer). I now see that it has been like this since xwork was brought into the struts2 project. It's weird though because I could have sworn it used to work... > staticParams interceptor overwrites params conversion errors > > > Key: WW-4288 > URL: https://issues.apache.org/jira/browse/WW-4288 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Affects Versions: 2.3.15.3 >Reporter: Jasper Rosenberg > Fix For: 2.3.x > > > Have a stack like: > ... > > > ... > > If have type conversion errors in params, they aren't seen by the > conversionError interceptor. > It looks like this in StaticParametersInterceptor: > {code:java} > if (clearableStack && (stack.getContext() != null) && > (newStack.getContext() != null)) > stack.getContext().put(ActionContext.CONVERSION_ERRORS, > newStack.getContext().get(ActionContext.CONVERSION_ERRORS)); > {code} > ends up just overwriting the old value of ActionContext.CONVERSION_ERRORS > rather than merging. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (WW-4288) staticParams interceptor overwrites params conversion errors
[ https://issues.apache.org/jira/browse/WW-4288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897834#comment-13897834 ] Lukasz Lenart commented on WW-4288: --- How WW-3760 broke this? https://fisheye6.atlassian.com/viewrep/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java?r1&r2=1292259 > staticParams interceptor overwrites params conversion errors > > > Key: WW-4288 > URL: https://issues.apache.org/jira/browse/WW-4288 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Affects Versions: 2.3.15.3 >Reporter: Jasper Rosenberg > Fix For: 2.3.x > > > Have a stack like: > ... > > > ... > > If have type conversion errors in params, they aren't seen by the > conversionError interceptor. > It looks like this in StaticParametersInterceptor: > {code:java} > if (clearableStack && (stack.getContext() != null) && > (newStack.getContext() != null)) > stack.getContext().put(ActionContext.CONVERSION_ERRORS, > newStack.getContext().get(ActionContext.CONVERSION_ERRORS)); > {code} > ends up just overwriting the old value of ActionContext.CONVERSION_ERRORS > rather than merging. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (WW-4288) staticParams interceptor overwrites params conversion errors
[ https://issues.apache.org/jira/browse/WW-4288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897818#comment-13897818 ] Jasper Rosenberg commented on WW-4288: -- A few more thoughts: 1. This could be fixed pretty easily I believe by simply changing that line in StaticParametersInterceptor (and the same in ParametersInterceptor) to merge the values of ActionContext.CONVERSION_ERRORS rather than overwrite them. (Either that or when creating newStack from stack, make sure the conversion errors are copied) 2. A workaround for the bug might be to include the conversionError interceptor after each params interceptor (I did a different temp hack which was to add a new interceptor after each params interceptor that saved and restored the value in ActionContext.CONVERSION_ERRORS) 3. It looks like this was broken on 2012-02-22 by issue WW-3760 4. I think an argument can be made that this is actually a security issue. If you were relying on type conversion errors from preventing malformed requests getting through, and had both parameter interceptors on your stack, it stopped working with the release of WW-3760. > staticParams interceptor overwrites params conversion errors > > > Key: WW-4288 > URL: https://issues.apache.org/jira/browse/WW-4288 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Affects Versions: 2.3.15.3 >Reporter: Jasper Rosenberg > Fix For: 2.3.x > > > Have a stack like: > ... > > > ... > > If have type conversion errors in params, they aren't seen by the > conversionError interceptor. > It looks like this in StaticParametersInterceptor: > {code:java} > if (clearableStack && (stack.getContext() != null) && > (newStack.getContext() != null)) > stack.getContext().put(ActionContext.CONVERSION_ERRORS, > newStack.getContext().get(ActionContext.CONVERSION_ERRORS)); > {code} > ends up just overwriting the old value of ActionContext.CONVERSION_ERRORS > rather than merging. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (WW-4288) staticParams interceptor overwrites params conversion errors
[ https://issues.apache.org/jira/browse/WW-4288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4288: -- Fix Version/s: 2.3.x > staticParams interceptor overwrites params conversion errors > > > Key: WW-4288 > URL: https://issues.apache.org/jira/browse/WW-4288 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Affects Versions: 2.3.15.3 >Reporter: Jasper Rosenberg > Fix For: 2.3.x > > > Have a stack like: > ... > > > ... > > If have type conversion errors in params, they aren't seen by the > conversionError interceptor. > It looks like this in StaticParametersInterceptor: > {code:java} > if (clearableStack && (stack.getContext() != null) && > (newStack.getContext() != null)) > stack.getContext().put(ActionContext.CONVERSION_ERRORS, > newStack.getContext().get(ActionContext.CONVERSION_ERRORS)); > {code} > ends up just overwriting the old value of ActionContext.CONVERSION_ERRORS > rather than merging. -- This message was sent by Atlassian JIRA (v6.1.5#6160)