[jira] [Updated] (WW-4904) Support for cross context request processing
[ https://issues.apache.org/jira/browse/WW-4904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yasser Zamani updated WW-4904: -- Description: When a request is forwarded from one context to another (both using struts2) {code:java} ServletContext sContext = context.getContext("/context2"); RequestDispatcher rd = sContext.getRequestDispatcher(resource); rd.forward(request, response); {code} you get a {{ClassCastException}}. Both the projects has their own struts jars (in WEB-INF/lib folder). {noformat} Caused by: java.lang.ClassCastException: org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to org.apache.struts2.dispatcher.mapper.ActionMapping at org.apache.struts2.dispatcher.ng.PrepareOperations.findActionMapping(PrepareOperations.java:163) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:92) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:274) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:209) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:221) ... 128 more {noformat} To make it work you have to have a filter (before struts2 filter) in the application that is receiving the request and have the below two lines. {code:java} request.setAttribute("struts.actionMapping", new ActionMapping()); request.setAttribute("struts.valueStack", null); {code} was: When a request is forwarded from one context to another (both using struts2) you get a ClassCastException. Both the projects has their own struts jars (in WEB-INF/lib folder). To make it work you have to have a filter (before struts2 filter) in the application that is receiving the request and have the below two lines. request.setAttribute("struts.actionMapping", new ActionMapping()); request.setAttribute("struts.valueStack", null); Caused by: java.lang.ClassCastException: org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to org.apache.struts2.dispatcher.mapper.ActionMapping at org.apache.struts2.dispatcher.ng.PrepareOperations.findActionMapping(PrepareOperations.java:163) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:92) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:274) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:209) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:221) ... 128 more > Support for cross context request processing > - > > Key: WW-4904 > URL: https://issues.apache.org/jira/browse/WW-4904 > Project: Struts 2 > Issue Type: Improvement > Components: Dispatch Filter >Affects Versions: 2.3.34 > Environment: Wildlfy 10.1.0 > Struts 2.3.34 > JDK 1.8.0_151 >Reporter: Prasanth >Priority: Minor > > When a request is forwarded from one context to another (both using struts2) > {code:java} > ServletContext sContext = context.getContext("/context2"); > RequestDispatcher rd =
[jira] [Comment Edited] (WW-4742) Problem with escape when the key from getText has no value
[ https://issues.apache.org/jira/browse/WW-4742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16295501#comment-16295501 ] Augusto Souza edited comment on WW-4742 at 12/18/17 7:32 PM: - [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]. I'm using the 2.5.10.1 version. The code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My proposed solution to avoid characters problems is, first use the escapeHtml4 method and then use escapeEcmaScript method: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks was (Author: augustosouza): [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]. Its enough if change the scape order, first escapeHtml4, and after escapeEcmaScript. In the version 2.5.10.1 the code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My proposed solution to avoid special characters problems is: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks > Problem with escape when the key from getText has no value > -- > > Key: WW-4742 > URL: https://issues.apache.org/jira/browse/WW-4742 > Project: Struts 2 > Issue Type: Bug > Components: Core Tags >Affects Versions: 2.5.8, 2.5.10 >Reporter: Mateus Carvalho >Assignee: Lukasz Lenart >Priority: Minor > Fix For: 2.6 > > > When using an encoding like ISO-8859-1 and having the following situation: > {code:title=message.ftl|borderStyle=solid} > ... > <@s.text name="Obrigatório - not mapped word in any dictionary" /> > ... > {code} > We have the following output after update 2.5.8: > {code} > Obrigat\u00F3rio - not mapped word in any dictionary > {code} > After careful look at the source code and issues from the 2.5.8 I found the > problem happens just in one added line on WW-4712, the following part of the > code: > {code:title=TextProviderHelper.java|borderStyle=solid} > ... > public static String getText(String key, String defaultMessage, List > args, ValueStack stack, boolean searchStack) { > ... > //This escape causes the problem > msg = StringEscapeUtils.escapeEcmaScript(msg); > ... > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (WW-4742) Problem with escape when the key from getText has no value
[ https://issues.apache.org/jira/browse/WW-4742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16295501#comment-16295501 ] Augusto Souza edited comment on WW-4742 at 12/18/17 7:18 PM: - [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]. Its enough if change the scape order, first escapeHtml4, and after escapeEcmaScript. In the version 2.5.10.1 the code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My proposed solution to avoid special characters problems is: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks was (Author: augustosouza): [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]. Its enough if change the scape order, first escapeHtml4, and after escapeEcmaScript. In the version 2.5.10.1 the code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My purpose to avoid special characters problems is: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks > Problem with escape when the key from getText has no value > -- > > Key: WW-4742 > URL: https://issues.apache.org/jira/browse/WW-4742 > Project: Struts 2 > Issue Type: Bug > Components: Core Tags >Affects Versions: 2.5.8, 2.5.10 >Reporter: Mateus Carvalho >Assignee: Lukasz Lenart >Priority: Minor > Fix For: 2.6 > > > When using an encoding like ISO-8859-1 and having the following situation: > {code:title=message.ftl|borderStyle=solid} > ... > <@s.text name="Obrigatório - not mapped word in any dictionary" /> > ... > {code} > We have the following output after update 2.5.8: > {code} > Obrigat\u00F3rio - not mapped word in any dictionary > {code} > After careful look at the source code and issues from the 2.5.8 I found the > problem happens just in one added line on WW-4712, the following part of the > code: > {code:title=TextProviderHelper.java|borderStyle=solid} > ... > public static String getText(String key, String defaultMessage, List > args, ValueStack stack, boolean searchStack) { > ... > //This escape causes the problem > msg = StringEscapeUtils.escapeEcmaScript(msg); > ... > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (WW-4742) Problem with escape when the key from getText has no value
[ https://issues.apache.org/jira/browse/WW-4742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16295501#comment-16295501 ] Augusto Souza edited comment on WW-4742 at 12/18/17 7:16 PM: - [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]. Its enough if change the scape order, first escapeHtml4, and after escapeEcmaScript. In the version 2.5.10.1 the code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My purpose to avoid special characters problems is: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks was (Author: augustosouza): [~lukaszlenart], I'm working in the same project/problem related by [~mtsbarbosa]). Its enough if change the scape order, first escapeHtml4, and after escapeEcmaScript. In the version 2.5.10.1 the code works like this: {code:java} msg = defaultMessage; // Test xpto' and xptó msg = StringEscapeUtils.escapeEcmaScript(msg); // Test xpto\' and xpt\u00F3 msg = StringEscapeUtils.escapeHtml4(msg); // Test xpto\' and xpt\u00F3 {code} Note that in the above example escapeHtml4 doesn't even make sense. My purpose to avoid special characters problems is: {code:java} msg = defaultMessage; // Teste xpto' and xptó msg = StringEscapeUtils.escapeHtml4(msg); // Teste xpto' and xpt msg = StringEscapeUtils.escapeEcmaScript(msg); // Teste xpto\' and xpt {code} I hope you consider this solution, thanks > Problem with escape when the key from getText has no value > -- > > Key: WW-4742 > URL: https://issues.apache.org/jira/browse/WW-4742 > Project: Struts 2 > Issue Type: Bug > Components: Core Tags >Affects Versions: 2.5.8, 2.5.10 >Reporter: Mateus Carvalho >Assignee: Lukasz Lenart >Priority: Minor > Fix For: 2.6 > > > When using an encoding like ISO-8859-1 and having the following situation: > {code:title=message.ftl|borderStyle=solid} > ... > <@s.text name="Obrigatório - not mapped word in any dictionary" /> > ... > {code} > We have the following output after update 2.5.8: > {code} > Obrigat\u00F3rio - not mapped word in any dictionary > {code} > After careful look at the source code and issues from the 2.5.8 I found the > problem happens just in one added line on WW-4712, the following part of the > code: > {code:title=TextProviderHelper.java|borderStyle=solid} > ... > public static String getText(String key, String defaultMessage, List > args, ValueStack stack, boolean searchStack) { > ... > //This escape causes the problem > msg = StringEscapeUtils.escapeEcmaScript(msg); > ... > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (WW-4904) Support for cross context request processing
[ https://issues.apache.org/jira/browse/WW-4904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Prasanth updated WW-4904: -- Description: When a request is forwarded from one context to another (both using struts2) you get a ClassCastException. Both the projects has their own struts jars (in WEB-INF/lib folder). To make it work you have to have a filter (before struts2 filter) in the application that is receiving the request and have the below two lines. request.setAttribute("struts.actionMapping", new ActionMapping()); request.setAttribute("struts.valueStack", null); Caused by: java.lang.ClassCastException: org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to org.apache.struts2.dispatcher.mapper.ActionMapping at org.apache.struts2.dispatcher.ng.PrepareOperations.findActionMapping(PrepareOperations.java:163) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:92) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:274) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:209) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:221) ... 128 more was: When a request is forwarded from one context to another (both using struts2) you get a ClassCastException. Both the projects has their own struts jars (in WEB-INF/lib folder). To make it work you have to have a filter (before struts2 filter) in the application that is receiving the request and have the below two lines. request.setAttribute("struts.actionMapping", null); request.setAttribute("struts.valueStack", null); Caused by: java.lang.ClassCastException: org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to org.apache.struts2.dispatcher.mapper.ActionMapping at org.apache.struts2.dispatcher.ng.PrepareOperations.findActionMapping(PrepareOperations.java:163) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:92) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:274) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:209) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:221) ... 128 more > Support for cross context request processing > - > > Key: WW-4904 > URL: https://issues.apache.org/jira/browse/WW-4904 > Project: Struts 2 > Issue Type: Improvement > Components: Dispatch Filter >Affects Versions: 2.3.34 > Environment: Wildlfy 10.1.0 > Struts 2.3.34 > JDK 1.8.0_151 >Reporter: Prasanth >Priority: Minor > > When a request is forwarded from one context to another (both using struts2) > you get a ClassCastException. Both the projects has their own struts jars (in > WEB-INF/lib folder). > To make it work you have to have a filter (before struts2 filter) in the > application that is receiving the request and have the below two lines. > request.setAttribute("struts.actionMapping", new ActionMapping()); >
[jira] [Created] (WW-4904) Support for cross context request processing
Prasanth created WW-4904: - Summary: Support for cross context request processing Key: WW-4904 URL: https://issues.apache.org/jira/browse/WW-4904 Project: Struts 2 Issue Type: Improvement Components: Dispatch Filter Affects Versions: 2.3.34 Environment: Wildlfy 10.1.0 Struts 2.3.34 JDK 1.8.0_151 Reporter: Prasanth Priority: Minor When a request is forwarded from one context to another (both using struts2) you get a ClassCastException. Both the projects has their own struts jars (in WEB-INF/lib folder). To make it work you have to have a filter (before struts2 filter) in the application that is receiving the request and have the below two lines. request.setAttribute("struts.actionMapping", null); request.setAttribute("struts.valueStack", null); Caused by: java.lang.ClassCastException: org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to org.apache.struts2.dispatcher.mapper.ActionMapping at org.apache.struts2.dispatcher.ng.PrepareOperations.findActionMapping(PrepareOperations.java:163) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:92) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:274) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:209) at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:221) ... 128 more -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Comment Edited] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16294803#comment-16294803 ] Lukasz Lenart edited comment on WW-4903 at 12/18/17 10:56 AM: -- The simplest workaround is to use the below code to implement your own {{ActionProxyFactory}} {code:java} public class MyPrefixBasedActionProxyFactory extends DefaultActionProxyFactory { private static final Logger LOG = LogManager.getLogger(MyPrefixBasedActionProxyFactory.class); private MapactionProxyFactories = new HashMap<>(); @Inject public void setContainer(Container container) { this.container = container; } @Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION) public void setPrefixBasedActionProxyFactories(String list) { if (list != null) { String[] factories = list.split(","); for (String factory : factories) { String[] thisFactory = factory.split(":"); if (thisFactory.length == 2) { String factoryPrefix = thisFactory[0].trim(); String factoryName = thisFactory[1].trim(); ActionProxyFactory obj = container.getInstance(ActionProxyFactory.class, factoryName); if (obj != null) { actionProxyFactories.put(factoryPrefix, obj); } else { LOG.warn("Invalid PrefixBasedActionProxyFactory config entry: [{}]", factory); } } } } } public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map extraContext, boolean executeResult, boolean cleanupContext) { String uri = namespace + (namespace.endsWith("/") ? actionName : "/" + actionName); for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex - 1)) { String key = uri.substring(0, lastIndex); ActionProxyFactory actionProxyFactory = actionProxyFactories.get(key); if (actionProxyFactory != null) { LOG.debug("Using ActionProxyFactory [{}] for prefix [{}]", actionProxyFactory, key); return actionProxyFactory.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext); } else { LOG.debug("No ActionProxyFactory defined for [{}]", key); } } LOG.debug("Cannot find any matching ActionProxyFactory, falling back to [{}]", super.getClass().getName()); return super.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext); } } {code} then register it in {{struts.xml}}: {code:xml} {code} and use it in {{struts.xml}} {code:xml} {code} was (Author: lukaszlenart): The simplest workaround is to use the below code to implement your own {{ActionProxyFactory}} {code:java} public class MyPrefixBasedActionProxyFactory extends DefaultActionProxyFactory { private static final Logger LOG = LogManager.getLogger(MyPrefixBasedActionProxyFactory.class); private Map actionProxyFactories = new HashMap<>(); @Inject public void setContainer(Container container) { this.container = container; } @Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION) public void setPrefixBasedActionProxyFactories(String list) { if (list != null) { String[] factories = list.split(","); for (String factory : factories) { String[] thisFactory = factory.split(":"); if (thisFactory.length == 2) { String factoryPrefix = thisFactory[0].trim(); String factoryName = thisFactory[1].trim(); ActionProxyFactory obj = container.getInstance(ActionProxyFactory.class, factoryName); if (obj != null) { actionProxyFactories.put(factoryPrefix, obj); } else { LOG.warn("Invalid PrefixBasedActionProxyFactory config entry: [{}]", factory); } } } } } public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map extraContext, boolean executeResult, boolean cleanupContext) { String uri = namespace + (namespace.endsWith("/") ? actionName : "/" + actionName); for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex - 1)) { String key = uri.substring(0, lastIndex); ActionProxyFactory actionProxyFactory =
[jira] [Commented] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16294803#comment-16294803 ] Lukasz Lenart commented on WW-4903: --- The simplest workaround is to use the below code to implement your own {{ActionProxyFactory}} {code:java} public class MyPrefixBasedActionProxyFactory extends DefaultActionProxyFactory { private static final Logger LOG = LogManager.getLogger(MyPrefixBasedActionProxyFactory.class); private MapactionProxyFactories = new HashMap<>(); @Inject public void setContainer(Container container) { this.container = container; } @Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION) public void setPrefixBasedActionProxyFactories(String list) { if (list != null) { String[] factories = list.split(","); for (String factory : factories) { String[] thisFactory = factory.split(":"); if (thisFactory.length == 2) { String factoryPrefix = thisFactory[0].trim(); String factoryName = thisFactory[1].trim(); ActionProxyFactory obj = container.getInstance(ActionProxyFactory.class, factoryName); if (obj != null) { actionProxyFactories.put(factoryPrefix, obj); } else { LOG.warn("Invalid PrefixBasedActionProxyFactory config entry: [{}]", factory); } } } } } public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map extraContext, boolean executeResult, boolean cleanupContext) { String uri = namespace + (namespace.endsWith("/") ? actionName : "/" + actionName); for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex - 1)) { String key = uri.substring(0, lastIndex); ActionProxyFactory actionProxyFactory = actionProxyFactories.get(key); if (actionProxyFactory != null) { LOG.debug("Using ActionProxyFactory [{}] for prefix [{}]", actionProxyFactory, key); return actionProxyFactory.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext); } else { LOG.debug("No ActionProxyFactory defined for [{}]", key); } } LOG.debug("Cannot find any matching ActionProxyFactory, falling back to [{}]", super.getClass().getName()); return super.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext); } } {code} then register it in {{struts.xml}}: {code:xml} {code} and use it in {{struts.xml}} {code:xml} {code} > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava >Assignee: Lukasz Lenart > Fix For: 2.5.15 > > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > >
[jira] [Assigned] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart reassigned WW-4903: - Assignee: Lukasz Lenart > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava >Assignee: Lukasz Lenart > Fix For: 2.5.15 > > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > >
[jira] [Commented] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16294638#comment-16294638 ] aditya shrivastava commented on WW-4903: can you provide me the work around for this > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava > Fix For: 2.5.15 > > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > >
[jira] [Updated] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4903: -- Fix Version/s: 2.5.15 > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava > Fix For: 2.5.15 > > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > >
[jira] [Comment Edited] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16294624#comment-16294624 ] Lukasz Lenart edited comment on WW-4903 at 12/18/17 8:05 AM: - Error screen shot attach !attachment-name.jpg|thumbnail! was (Author: hiaditya04): Error screen shot attach > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > >
[jira] [Comment Edited] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16294624#comment-16294624 ] Lukasz Lenart edited comment on WW-4903 at 12/18/17 8:05 AM: - Error screen shot attach !error_screen_shot.png|thumbnail! was (Author: hiaditya04): Error screen shot attach !attachment-name.jpg|thumbnail! > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > >
[jira] [Updated] (WW-4903) Dependency Mapping Exception When Using PrefixBasedActionProxyFactory
[ https://issues.apache.org/jira/browse/WW-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] aditya shrivastava updated WW-4903: --- Attachment: error_screen_shot.png Error screen shot attach > Dependency Mapping Exception When Using PrefixBasedActionProxyFactory > - > > Key: WW-4903 > URL: https://issues.apache.org/jira/browse/WW-4903 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Reporter: aditya shrivastava > Attachments: error_screen_shot.png > > > I am using struts-rest plugin with REST & NON REST flow I am using STRUTS > 2.3.34 version. > To achieve this I am using following configuration. > {code:java} > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/> > value="/sm:rest,/pd:rest,:struts"/> > > {code} > When I start my tomcat & hit on url > https://localhost:8080/myapp > I always get the exception > {code:java} > HTTP Status 500 – Internal Server Error > Type Exception Report > Message java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > Description The server encountered an unexpected condition that prevented it > from fulfilling the request. > Exception > java.lang.RuntimeException: java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) > > com.elitecore.nvsmx.system.filter.PortalSecurityFilter.doFilter(PortalSecurityFilter.java:61) > Root Cause > java.lang.RuntimeException: > com.opensymphony.xwork2.inject.DependencyException: > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No > mapping found for dependency > [type=com.opensymphony.xwork2.ActionProxyFactory, > name='struts.actionProxyFactory'] in public void > org.apache.struts2.impl.PrefixBasedActionProxyFactory.setActionProxyFactory(com.opensymphony.xwork2.ActionProxyFactory). > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502) > > com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593) > > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537) > > com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) > > com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130) > com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524) > > com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555) > > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584) > > com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553) > > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:565) > > org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) > >