FileNotFoundException when jetty-jboss is deployed with blanks in path .. + Patch

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FileNotFoundException when jetty-jboss is deployed with blanks in path .. + Patch

Paul Palaszewski
Hi everybody!

I'm using jboss-3.2.6 with jetty-5.1.3/5.1.5rc1 on jdk1.5.0 win xp sp2.
When the directory where jboss is deployed, contains space, the web-app
deployment fails:
Caused by: java.io.FileNotFoundException:
C:\BDM\jboss%203.2.6\server\bdm_single_node\tmp\deploy\tmp3860BDM.war\WEB-INF\
web.xml
        at
org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:71)
        at
org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:80)
        at java.net.URL.openStream(URL.java:1007)
        at org.mortbay.xml.XmlParser.parse(XmlParser.java:231)
        at
org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp(XMLConfiguration.java:187)
        at
org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp(WebApplicationContext.java:425)
        at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:480)
        at
org.mortbay.j2ee.J2EEWebApplicationContext.doStart(J2EEWebApplicationContext.java:78)
        at
org.jboss.jetty.JBossWebApplicationContext.doStart(JBossWebApplicationContext.java:79)
        at org.mortbay.util.Container.start(Container.java:72)
        at org.jboss.jetty.Jetty.deploy(Jetty.java:322)

It's reproduceable with different paths and it does not happen, when the
path does not contain blanks.

I've had a look at the code - nothing suspicious, but then I've tried
around with the debugger and changing
org.mortbay.jetty.servlet.XMLConfiguration line 187 from
(orig)
186:                XmlParser.Node config=null;
187:                config=xmlParser.parse(web.getURL());
188:                initialize(config);

(patched)
186:                XmlParser.Node config=null;
187:                config=xmlParser.parse(web.getInputStream());
188:                initialize(config);

Fixed the issue. Now the only difference is, that the file is retrieved
by FileResource/new FileInputStream instead of
XmlParser/url.getInputSream() so it should be perfectly safe.

Hope, I could contribute a little fix ;-)

Best Regards
Paul


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support