Starting a web application in OSGi web container fails due to wrongly created file path string ----------------------------------------------------------------------------------------------
Key: JRUBY-5050 URL: http://jira.codehaus.org/browse/JRUBY-5050 Project: JRuby Issue Type: Bug Affects Versions: JRuby 1.5.1 Environment: Microsoft Windows XP SP 2, Sun JDK 1.6.0_20 Reporter: Krum Bakalsky Assignee: Thomas E Enebo We are experimenting with a simple Sinatra/Rails application, that we deploy and run over an OSGi web container. We use JRuby 1.5.1 and JRuby-Rack 0.9.7 (tested also with JRuby-Rack 1.0.1). The application runs fine on plain Tomcat, because the resource for jruby.home is with the following URL: jar:file:/D:/apache-tomcat-6.0.18/apache-tomcat-6.0.18/webapps/<web_app_name>/WEB-INF/lib/jruby-complete-1.5.1.jar!/META-INF/jruby.home and the application is working correctly. However, when we use the same Tomcat as an OSGi web container (RFC 66), the URL is: jar:file:/D:/tmp/<osgi_web_container>/webapps/<web_app_name>/WEB-INF/lib/jruby-complete-1.5.1.jar!/META-INF/jruby.home/ The difference with Tomcat is in the "/" at the end, and this is because of the ZipBundleEntry spec. In org.jruby.runtime.load.LoadService.init(List additionalDirectories) when creating jrubyDir there is no check for "/"(sep) at the end of the string: if (jrubyHome != null) { char sep = '/'; String rubyDir = jrubyHome + sep + "lib" + sep + "ruby" + sep; and this leads to a resource that has two consecutive slashes (seps). Such resources fail to be loaded and the application start fails. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email