struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Watson (JIRA)" <>
Subject [jira] Commented: (WW-2653) Struts 2 tag does not get invoked inside the JSP result from a REST contoller class in Websphere
Date Thu, 05 Jun 2008 23:06:05 GMT


Michael Watson commented on WW-2653:

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,
            while (urls.hasNext()) {
                URL u =;
                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");
        } catch (URISyntaxException e) {
            // 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";

        // Overwrite and extend defaults with application specific validator configurations
        resourceName = "validators.xml";

        // Add custom (plugin) specific validator configurations
        for (File file : files) {

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
> ---------------------------------------------------------------------------------------------------------
>                 Key: WW-2653
>                 URL:
>             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, 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
> 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 (
> However, now I consistently get  java.lang.reflect.InvocationTargetException at (
> I can reproduce this error simply by deploying the Struts2-rest-showcase example application
in latest Websphere
> 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(
> 	at com.opensymphony.xwork2.inject.ContainerImpl.inject(
> 	at com.opensymphony.xwork2.inject.ContainerImpl$
> 	at com.opensymphony.xwork2.inject.ContainerImpl$
> 	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(
> 	at com.opensymphony.xwork2.inject.ContainerImpl.inject(
> 	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(
> 	at
> 	at
> 	at
> 	at javax.servlet.http.HttpServlet.service(
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(
> 	at org.apache.struts2.dispatcher.StrutsResultSupport.execute(
> 	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(
> 	at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(
> 	at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(
> 	at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
> 	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message