ResourceServlet throws "java.lang.IllegalArgumentException: URI is not hierarchical" on JB [message #892216] |
Wed, 27 June 2012 08:31  |
Eclipse User |
|
|
|
Hi,
My RAP application (1.4.2, 1.5-RC3) is deployed as war onto a JBoss AS 5.1.2.ER2. The AS ships with a custom file protocol url handler [1] that essentially performs the following operation in order to open a connection to a file url:
this.file = new File(url.toURI());
When a resource is requested, e.g the favicon, I receive the following exception on the console:
ERROR [[equinoxbridgeservlet]] Servlet.service() for servlet equinoxbridgeservlet threw exception
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:363)
at org.jboss.net.protocol.file.FileURLConnection.<init>(FileURLConnection.java:62)
at org.jboss.net.protocol.file.Handler.openConnection(Handler.java:40)
at java.net.URL.openConnection(URL.java:945)
at org.eclipse.equinox.http.servlet.internal.ResourceServlet$1.run(ResourceServlet.java:63)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.equinox.http.servlet.internal.ResourceServlet.writeResource(ResourceServlet.java:60)
at org.eclipse.equinox.http.servlet.internal.ResourceServlet.service(ResourceServlet.java:50)
... and more ...
I tracked the problem down to org.eclipse.rap.rwt.osgi.internal.HttpContextWrapper#getResource(String) which seems to generate a wrong resource URL, e.g file:C:/path/to/resource/favicon.png instead of file:/C:/path/to/resource/favicon.png.
File file = new File( name );
if( file.exists() && !file.isDirectory() ) {
result = new URL( "file", "", name );
}
Is this a bug that has to fixed in RAP?
Thanks for any advise,
Thomas
[1] repository.jboss.org/nexus/index.html#nexus-search;gav~org.jboss~jboss-common-core~2.2.18.GA~jar~
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04974 seconds