DMI issue with struts 2.3.29 in tomcat
My web app uses struts 2.3.15 and deployed in tomcat 7.0.47 (and in tomcat 8.0.15 too). I have used most of the calls using DMI (Dynamic Method Invocation) using urls like /testapp/userspace/user!getRole.action Now I have updated the application to struts version 2.3.29 and any of the DMI methods are not working and return 404 error. I do understand that struts has made default configuration for DMI to false (struts.enable.DynamicMethodInvocation) after version 2.3.xx (where xx above 15) but using struts configuration file I made that enabled, still its not working. I checked using config-browser plugin and seems its not getting enabled, although I have made the configuration to enable it. My struts-config.xml http://struts.apache.org/dtds/struts-2.3.dtd";> web.xml struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter config struts-default.xml, struts-plugin.xml, /WEB-INF/struts-config.xml actionPackages com.isa.maxaero.web.action I have also learned that this issue is not with jboss server since we have done the same change to another app that runs on jboss and it works as expected. Any suggestions on how to made struts.enable.DynamicMethodInvocation to *true*. Tomcat - 7.0.47, Struts - 2.3.29 Regards, Vidula.
Re: DMI issue with struts 2.3.29 in tomcat
(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.isa.maxaero.web.filter.AuthRedirectFilter.doFilter(AuthRedirectFilter.java:69) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Regards, Vidula Hasaranga Consultant Technology [image: ACCELaero] <http://www.accelaero.com> <http://www.worldtravelawards.com/award-travel-technologys-leading-pss-provider-2015> Information Systems Associates (Pvt) Ltd, Colombo 3, Sri Lanka Tel *+94112058886* - Mob *+94773799694* - Fax *+971 65528857* *accelaero.com* <http://accelaero.com> ⸰ *LinkedIn* <https://www.linkedin.com/company/information-systems-associates-fze> ⸰ *Twitter* <https://twitter.com/isafeeds> On Wed, Jul 6, 2016 at 4:15 PM, Lukasz Lenart wrote: > 2016-07-06 12:25 GMT+02:00 Vidula Hasaranga : > > My web app uses struts 2.3.15 and deployed in tomcat 7.0.47 (and in > tomcat > > 8.0.15 too). I have used most of the calls using DMI (Dynamic Method > > Invocation) using urls like /testapp/userspace/user!getRole.action > > Probably because you are using getters instead of simple methods. Can > you enable logging? You should see errors or in devMode errors should > be reported directly. > > > 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 > >
DMI issue with struts 2.3.29 in tomcat
My web app uses struts 2.3.15 and deployed in tomcat 7.0.47 (and in tomcat 8.0.15 too). I have used most of the calls using DMI (Dynamic Method Invocation) using urls like /testapp/userspace/user!getRole.action Now I have updated the application to struts version 2.3.29 and any of the DMI methods are not working and return 404 error. I do understand that struts has made default configuration for DMI to false (struts.enable.DynamicMethodInvocation) after version 2.3.xx (where xx above 15) but using struts configuration file I made that enabled, still its not working. I checked using config-browser plugin and seems its not getting enabled, although I have made the configuration to enable it. My struts-config.xml http://struts.apache.org/dtds/struts-2.3.dtd";> web.xml struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter config struts-default.xml, struts-plugin.xml, /WEB-INF/struts-config.xml actionPackages com.isa.maxaero.web.action I have also learned that this issue is not with jboss server since we have done the same change to another app that runs on jboss and it works as expected. Any suggestions on how to made struts.enable.DynamicMethodInvocation to *true*. Tomcat - 7.0.47, Struts - 2.3.29 Regards, Vidula.
Re: DMI issue with struts 2.3.29 in tomcat
I changed my struts-config to below, but still no luck. ** *http://struts.apache.org/dtds/struts-2.3.dtd <http://struts.apache.org/dtds/struts-2.3.dtd>">* ** * * * * * * ** Anyway thanks for the help. Regards, Vidula Hasaranga Consultant Technology [image: ACCELaero] <http://www.accelaero.com> <http://www.worldtravelawards.com/award-travel-technologys-leading-pss-provider-2015> Information Systems Associates (Pvt) Ltd, Colombo 3, Sri Lanka Tel *+94112058886* - Mob *+94773799694* - Fax *+971 65528857* *accelaero.com* <http://accelaero.com> ⸰ *LinkedIn* <https://www.linkedin.com/company/information-systems-associates-fze> ⸰ *Twitter* <https://twitter.com/isafeeds> On Wed, Jul 6, 2016 at 5:32 PM, Lukasz Lenart wrote: > 2016-07-06 13:22 GMT+02:00 Vidula Hasaranga : > > No, I am not using getters, but some simple methods like searchUser(), > > searchUserForUsername(), etc. Even the getRole() given as an example is > not > > a getter method, but it query the DB as per the logged in user to get > roles. > > By convention it is a getter - it doesn't matter how did you implement it. > > > Can it be an incompatibility with struts version and tomcat > > since struts.enable.DynamicMethodInvocation is not set to true even > though > > it set in the struts configurations by me as I found by config-browser > > plugin. > > > > Just as a note that I am using codebehind still, not the convention > plugin. > > > > > > Error I am getting in console :: > > > > 06-Jul-2016 16:50:12.629 WARNING [http-nio-7070-exec-7] > > com.opensymphony.xwork2.util.logging.commons.CommonsLogger.warn Could not > > find action or result: > > /test-app/aa/bb/ui/reports!searchInitialActualReportRegionsYears.action > > There is no Action mapped for namespace [/aa/bb/ui] and action name > > [reports!searchInitialActualReportRegionsYears] associated with context > > This means that `struts.enable.DynamicMethodInvocation` is false and > it's because you are using old DTD, instead of this > > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > "http://struts.apache.org/dtds/struts-2.3.dtd";> > > you must set 2.3, like this > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" > "http://struts.apache.org/dtds/struts-2.3.dtd";> > > > 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: DMI issue with struts 2.3.29 in tomcat
s in my classpath with freemarker-2.3.22.jar. (I have build using maven so all the dependencies load as per configurations) In Action class, I have put following configurations and the calling method return 'json' as return value: @Namespace(S2Constants.Namespace.PRIVATE_DASHBOARD) @Results({ @Result(name = "success", value = "/private/user/ui/manageUser.jsp"), @Result(name = "json", value = "", type = JSONResult.class) }) Any idea on this... Regards, Vidula Hasaranga Consultant Technology [image: ACCELaero] <http://www.accelaero.com> <http://www.worldtravelawards.com/award-travel-technologys-leading-pss-provider-2015> Information Systems Associates (Pvt) Ltd, Colombo 3, Sri Lanka Tel *+94112058886* - Mob *+94773799694* - Fax *+971 65528857* *accelaero.com* <http://accelaero.com> ⸰ *LinkedIn* <https://www.linkedin.com/company/information-systems-associates-fze> ⸰ *Twitter* <https://twitter.com/isafeeds> On Thu, Jul 7, 2016 at 10:47 AM, Lukasz Lenart wrote: > 2016-07-06 9:19 GMT+02:00 Vidula Hasaranga : > > web.xml > > > > > > struts2 > > > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter > > > > config > > struts-default.xml, > > struts-plugin.xml, > > /WEB-INF/struts-config.xml > > This is the issue and it never worked - Struts doesn't lookup for > resources in /WEB-INF folder. The best option is to drop this > configuration and rename "struts-config.xml" into "struts.xml" and put > it under "classes" folder (or if you are using Maven put it under > "resources") > > > 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: DMI issue with struts 2.3.29 in tomcat
Yes, That fixed my issue. I am going to convert the Codebehind to Convention now. But app is working well now with suggested changes. Thank you very much for the support. Regards, Vidula. Vidula Hasaranga Consultant Technology [image: ACCELaero] <http://www.accelaero.com> <http://www.worldtravelawards.com/award-travel-technologys-leading-pss-provider-2015> Information Systems Associates (Pvt) Ltd, Colombo 3, Sri Lanka Tel *+94112058886* - Mob *+94773799694* - Fax *+971 65528857* *accelaero.com* <http://accelaero.com> ⸰ *LinkedIn* <https://www.linkedin.com/company/information-systems-associates-fze> ⸰ *Twitter* <https://twitter.com/isafeeds> On Thu, Jul 7, 2016 at 5:04 PM, Lukasz Lenart wrote: > It's a bug related to this change [1] and this commit [2] and the > problem is here [3] & [4]. The best option is to migrate to the > Convention plugin instead of using deprecated Codebehind or define you > own JSONResult as follow: > > public class MyJSONResult extends JSONResult { > > public static final String DEFAULT_PARAM = "root"; > > } > > [1] https://issues.apache.org/jira/browse/WW-4163 > [2] > https://github.com/apache/struts/commit/6cfc28b359949c4e87e8e75316b11dbf19a33419 > [3] > https://github.com/apache/struts/blob/support-2-3/plugins/codebehind/src/main/java/org/apache/struts2/config/ClasspathPackageProvider.java#L655 > [4] > https://github.com/apache/struts/blob/support-2-3/plugins/codebehind/src/main/java/org/apache/struts2/config/ClasspathPackageProvider.java#L666 > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > 2016-07-07 11:33 GMT+02:00 Vidula Hasaranga : > > Yes, making the file rename to struts.xml and putting that in > > WEB-INF/classes folder resolved the 404 issue that I had. But now it > gives > > a different error with code 500. > > > > Console log is as follows: > > > > 07-Jul-2016 14:48:33.430 SEVERE [http-nio-7070-exec-4] > > com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error There > was > > an exception while instantiating the result of type > > org.apache.struts2.json.JSONResult > > java.lang.NullPointerException > > at > java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333) > > at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988) > > at > > > com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:373) > > at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:288) > > at > > > com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:617) > > at com.opensymphony.xwork2.ognl.OgnlUtil.setProperty(OgnlUtil.java:239) > > at > > > com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperty(OgnlReflectionProvider.java:90) > > at > > > org.apache.struts2.factory.StrutsResultFactory.setParameter(StrutsResultFactory.java:67) > > at > > > org.apache.struts2.factory.StrutsResultFactory.setParameters(StrutsResultFactory.java:52) > > at > > > org.apache.struts2.factory.StrutsResultFactory.buildResult(StrutsResultFactory.java:41) > > at > com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:219) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:276) > > at > > > org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) > > at > > > org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) > > at > > > com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168) > > at > > > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) > > at > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245) > > at > > > com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) > > at > > > org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) > > at > &g