[ https://issues.apache.org/struts/browse/WW-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44047#action_44047 ]
bigmikew edited comment on WW-2653 at 6/5/08 4:05 PM: ------------------------------------------------------------ Ok so I've managed to fix this problem. By modifying com.opensymphony.xwork2.validator.DefaultValidatorFactory I was able to get to order/new, add an order and see it in the orders list. Below is the method I modified, note the check for file scheme, this lets it skip the resource bundles that were killing it previously: private void parseValidators() { if (LOG.isDebugEnabled()) { LOG.debug("Loading validator definitions."); } List<File> files = new ArrayList<File>(); try { // Get custom validator configurations via the classpath Iterator<URL> urls = ClassLoaderUtil.getResources("", DefaultValidatorFactory.class, false); while (urls.hasNext()) { URL u = urls.next(); URI uri = new URI(u.toExternalForm().replaceAll(" ", "%20")); if ((null != uri) && ("file".equalsIgnoreCase(uri.getScheme()))) { File f = new File(uri); FilenameFilter filter = new FilenameFilter() { public boolean accept(File file, String fileName) { return fileName.contains("-validators.xml"); } }; files.addAll(Arrays.asList(f.listFiles(filter))); } } } catch (URISyntaxException e) { e.printStackTrace(); // swallow } catch (IOException e) { throw new ConfigurationException("Unable to parse validators", e); } // Parse default validator configurations String resourceName = "com/opensymphony/xwork2/validator/validators/default.xml"; retrieveValidatorConfiguration(resourceName); // Overwrite and extend defaults with application specific validator configurations resourceName = "validators.xml"; retrieveValidatorConfiguration(resourceName); // Add custom (plugin) specific validator configurations for (File file : files) { retrieveValidatorConfiguration(file.getName()); } } Now how do we go about getting this fix in to xwork -> struts2 asap? I've got the ok to use a non-GA struts2 release but we've been instructed not to maintain our own version of this stuff. Since this is critical to anyone wanting to run Struts2 on Websphere 6.1 can we get the fix above included urgently? was (Author: bigmikew): Ok so I've managed to fix this problem. By modifying com.opensymphony.xwork2.validator.DefaultValidatorFactory I was able to get to order/new, add an order and see it in the orders list. Below is the method I modified, not the check for file scheme, this lets it skip the resource bundles that were killing it previously: private void parseValidators() { if (LOG.isDebugEnabled()) { LOG.debug("Loading validator definitions."); } List<File> files = new ArrayList<File>(); try { // Get custom validator configurations via the classpath Iterator<URL> urls = ClassLoaderUtil.getResources("", DefaultValidatorFactory.class, false); while (urls.hasNext()) { URL u = urls.next(); URI uri = new URI(u.toExternalForm().replaceAll(" ", "%20")); if ((null != uri) && ("file".equalsIgnoreCase(uri.getScheme()))) { File f = new File(uri); FilenameFilter filter = new FilenameFilter() { public boolean accept(File file, String fileName) { return fileName.contains("-validators.xml"); } }; files.addAll(Arrays.asList(f.listFiles(filter))); } } } catch (URISyntaxException e) { e.printStackTrace(); // swallow } catch (IOException e) { throw new ConfigurationException("Unable to parse validators", e); } // Parse default validator configurations String resourceName = "com/opensymphony/xwork2/validator/validators/default.xml"; retrieveValidatorConfiguration(resourceName); // Overwrite and extend defaults with application specific validator configurations resourceName = "validators.xml"; retrieveValidatorConfiguration(resourceName); // Add custom (plugin) specific validator configurations for (File file : files) { retrieveValidatorConfiguration(file.getName()); } } Now how do we go about getting this fix in to xwork -> struts2 asap? I've got the ok to use a non-GA struts2 release but we've been instructed not to maintain our own version of this stuff. Since this is critical to anyone wanting to run Struts2 on Websphere 6.1 can we get the fix above included urgently? > Struts 2 tag does not get invoked inside the JSP result from a REST contoller > class in Websphere 6.1.0.15 > --------------------------------------------------------------------------------------------------------- > > Key: WW-2653 > URL: https://issues.apache.org/struts/browse/WW-2653 > Project: Struts 2 > Issue Type: Bug > Components: Dispatch Filter, Example Applications, Plugin - REST > Affects Versions: 2.1.1, 2.1.2, 2.1.3 > Environment: windows, Websphere 6.1.0.15, application uses Struts 2, > Spring 2.5, JP, Hibernate, Struts2-REST plugin and Sitemesh / JSP. > Reporter: Jay > Priority: Blocker > > We have a application that uses Struts 2, Spring 2.5, JP, Hibernate, > Struts2-REST plugin and Sitemesh / JSP. We originally used Maven 2 to build > this project and everything worked fine in Jetty and Tomcat! > When we deployed to Websphere we had 2 major issues. > First one is an "Unable to load config class > org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor at > interceptor - > wsjar:file:/C:/RAD7/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/struts2-rest-showcaseEAR.ear/struts2-rest-showcase.war/WEB-INF/lib/struts2-core-2.1.3-SNAPSHOT.jar!/struts-default.xml:145:127 > probably due to a missing jar, which might be fine if you never plan to use > the validation interceptor" > error even though all other interceptors get loaded and works fine. I have > created a separate jira issue for this and it works fine if i remove this > AnnotationValidationInterceptor from the Struts-default.xml inside > Struts-core.jar and Struts-plugin.xml file inside rest-plugin.jar. I tried > using 2.1.1-SNAPSHOT and 2.1.3-SNAPSHOT. > Then I got a "404- file not found" error for accessing any of the rest > controllers that are deployed in in websphere 6.1 from the Browser. I got a > patch from IBM and that fixed this issue > (http://www-1.ibm.com/support/docview.wss?uid=swg24014758) > However, now I consistently get java.lang.reflect.InvocationTargetException > at > (com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java::118). > I can reproduce this error simply by deploying the Struts2-rest-showcase > example application in latest Websphere 6.1.0.15. > One more interesting observation is that when I remove the struts 2 tags from > the JSP, this last exception also goes away and everything works. In my > opinion just the filter chaining and Struts 2 tags in jsp result are not > working with Websphere 6.1 > I have included the full exception stack trace for your review:- > [5/21/08 10:23:30:517 EDT] 00000024 ServletWrappe I SRVE0242I: > [struts2-rest-showcaseEAR] [/struts2-rest-showcase] [/orders-editNew.jsp]: > Initialization successful. > [5/21/08 10:23:30:517 EDT] 00000024 ServletWrappe E SRVE0068E: Uncaught > exception thrown in one of the service methods of the servlet: > /orders-editNew.jsp. Exception thrown : java.lang.RuntimeException: > java.lang.RuntimeException: java.lang.RuntimeException: > java.lang.RuntimeException: java.lang.RuntimeException: > java.lang.RuntimeException: java.lang.RuntimeException: > java.lang.reflect.InvocationTargetException > at > com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:290) > at > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:470) > at > com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:508) > at > com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:507) > at > com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:558) > at > com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:506) > at > org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50) > at > com.ibm._jsp._orders_2D_editNew._jspx_meth_s_form_0(_orders_2D_editNew.java:153) > at > com.ibm._jsp._orders_2D_editNew._jspService(_orders_2D_editNew.java:73) > at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) > at > com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1074) > at > com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1009) > at > com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118) > at > com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87) > at > com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:771) > at > com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679) > at > com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:539) > at > com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) > at > com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122) > at > com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:225) > at > com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:278) > at > com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321) > at > org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:140) > at > org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) > at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:355) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259) > at > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) > at > com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) > at > com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) > at > com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:124) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.