You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "lefebvre (JIRA)" <ji...@apache.org> on 2013/02/15 18:21:13 UTC

[jira] [Commented] (WW-3981) Struts.xml not found

    [ https://issues.apache.org/jira/browse/WW-3981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579336#comment-13579336 ] 

lefebvre commented on WW-3981:
------------------------------

Can you please re-open the defect, i found the bug.
The bug is into com.opensymphony.xwork2.config.providers.XmlConfigurationProvider beetween line 997 and 1026 :
URL url = null;
            while (urls.hasNext()) {
                try {
                    url = urls.next();
                    is = fileManager.loadFile(url);

                    InputSource in = new InputSource(is); <--------- Here

                    in.setSystemId(url.toString());

                    docs.add(DomHelper.parse(in, dtdMappings));
                } catch (XWorkException e) {
                    if (includeElement != null) {
                        throw new ConfigurationException("Unable to load " + url, e, includeElement);
                    } else {
                        throw new ConfigurationException("Unable to load " + url, e);
                    }
                } catch (Exception e) {
                    final String s = "Caught exception while loading file " + fileName;
                    throw new ConfigurationException(s, e, includeElement);
                } finally {
                    if (is != null) {
                        try {
                            is.close();
                        } catch (IOException e) {
                            LOG.error("Unable to close input stream", e);
                        }
                    }
                }
            }

If urls contains two URLs, the first bad and the second valid (like attachement : UR1 bad ans URL2 OK), the algorithm break this this line :  InputSource in = new InputSource(is); and never try the second URL.
                
> Struts.xml not found
> --------------------
>
>                 Key: WW-3981
>                 URL: https://issues.apache.org/jira/browse/WW-3981
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.8
>         Environment: Struts 2.3.8
> Eclipse + wtp + m2ewtp
> Tomcat
>            Reporter: lefebvre
>
> On tomcat startup, if serve without publishing is checked
> If struts.xml is into src/main/webapp/web-inf/classes tomcat start correctly
> If struts.xml is into src/main/ressources an exception is throwed : struts.xml not found
> Any idea ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira