Joern Hartmann wrote:
Ernest Micklei wrote:
Ernest Micklei wrote:
Hi Nick
Nick S. wrote:
The only workaround for now that I can suggest is to use a different
servlet container – Glassfish or Tomcat don’t appear to have this
problem. If you can research on the weblogic side why they don’t
perform the path translation, that would be good to know as well.
I am in the process of deploying my app on Tomcat and got the same
exception thrown at me. I use the Context fragment method of
configuration so there is a ROOT.xml. Maybe it is related. I hope to
find out more today…
(tomcat 5.5.25,warbler 0.9.9)
^ Ernest
Just an update to my reply earlier today.
From the docs:
“The real path returned will be in a form appropriate to the computer
and operating system on which the servlet container is running,
including the proper path separators. This method returns null if the
servlet container cannot translate the virtual path to a real path for
any reason (such as when the content is being made available from a .war
archive).”
This applies to my situation. I was running the application from an
unpacked WAR file in Tomcat. Appearantly, the Jetty engine had no
problems with this setup.
I wrote a jRuby rack patch for the weblogic related issue when deploying
an application from a WAR-File. The patch contains a fallback mechanism
if getRealPath returns null and is not specifically bound to Weblogic.
So if other web containers have the same issue, the patch might help
here too.
See my bug report for the patch and more details:
http://jira.codehaus.org/browse/JRUBY-2908
Best
Joern
I tried building the patch in
http://jira.codehaus.org/browse/JRUBY-2908, and used
c a l d e r s p h e r e . n e t to package the
jar file. I got the error below (Error 1). Then I used my jruby
installation and got error below (Error 2). Please help. Thanks.
Error 1:
$ /cygdrive/d/jruby-buildr/bin/jruby.bat -S buildr package --trace
D:/jruby-buildr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require ': no such file to load -- dl/import (LoadError) from D:/jruby-buildr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 7:in
require’
from
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1/lib/net/ssh/au
thentication/pageant.rb:1:in
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0 .1/lib/net/ssh/authentication/pageant.rb' from D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1/lib/net/ssh/au thentication/pageant.rb:27:in
require’
from
D:/jruby-buildr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2
7:in require' from D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1/lib/net/ssh/au thentication/agent.rb:6:in
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1
/lib/net/ssh/authentication/agent.rb’
from
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1/lib/net/ssh/au
thentication/agent.rb:27:in require' from D:/jruby-buildr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2 7:in
require’
from
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh-2.0.1/lib/net/ssh/au
thentication/key_manager.rb:4:in
D:/jruby-buildr/lib/ruby/gems/1.8/gems/net-ssh -2.0.1/lib/net/ssh/authentication/key_manager.rb' ... 11 levels... from D:/jruby-buildr/lib/ruby/gems/1.8/gems/buildr-1.3.1.1-java/bin/buil dr:19:in
D:/jruby-buildr/lib/ruby/gems/1.8/gems/buildr-1.3.1.1-java/bin/buildr’
from
D:/jruby-buildr/lib/ruby/gems/1.8/gems/buildr-1.3.1.1-java/bin/buil
dr:19:in `load’
from D:/jruby-buildr/bin/buildr:19
Error 2:
$ jruby -S buildr package --trace
(in d:/workspace/rack_weblogic_workaround, development)
** Invoke buildr:initialize (first_time)
** Execute buildr:initialize
** Invoke jruby-rack (first_time)
** Execute jruby-rack
** Invoke
C:/cygwin/home/rd/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.ja
r (first_time, not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant
-launcher-1.7.1.jar (first_time, not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/apache/ant/ant-trax/1.7.1/ant-tra
x-1.7.1.jar (first_time, not_needed)
** Invoke
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/jav
a (first_time, not_needed)
** Invoke jruby-rack
** Invoke package (first_time)
** Invoke build (first_time)
** Execute build
Building jruby-rack
** Invoke jruby-rack:build (first_time)
** Invoke d:/workspace/rack_weblogic_workaround/target/classes
(first_time, not_
needed)
** Invoke jruby-rack:compile (first_time, not_needed)
** Invoke jruby-rack:resources (first_time)
** Invoke jruby-rack:unpack_gems (first_time)
** Invoke d:/workspace/rack_weblogic_workaround/target (first_time,
not_needed)
** Execute jruby-rack:unpack_gems
** Execute jruby-rack:resources
** Invoke
C:/cygwin/home/rd/.m2/repository/javax/servlet/servlet-api/2.3/servlet
-api-2.3.jar (first_time, not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/jruby/jruby-complete/1.1.3/jruby-
complete-1.1.3.jar (first_time, not_needed)
** Invoke d:/workspace/rack_weblogic_workaround/src/main/java
(first_time, not_n
eeded)
Testing needed. Latest prerequisite change: Tue Oct 21 12:54:08 +0800
2008 (d:/w
orkspace/rack_weblogic_workaround/buildfile). Last successful test run:
.
** Invoke jruby-rack:test (first_time)
** Invoke d:/workspace/rack_weblogic_workaround/buildfile (first_time,
not_neede
d)
** Invoke jruby-rack:test:compile (first_time, not_needed)
** Invoke jruby-rack:compile (not_needed)
** Invoke jruby-rack:test:resources (first_time)
** Execute jruby-rack:test:resources
** Invoke d:/workspace/rack_weblogic_workaround/target/classes
(not_needed)
** Invoke d:/workspace/rack_weblogic_workaround/target/resources
(first_time, no
t_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/javax/servlet/servlet-api/2.3/servlet
-api-2.3.jar (not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/jruby/jruby-complete/1.1.3/jruby-
complete-1.1.3.jar (not_needed)
** Invoke d:/workspace/rack_weblogic_workaround/target/classes
(not_needed)
** Invoke d:/workspace/rack_weblogic_workaround/target/resources
(not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/javax/servlet/servlet-api/2.3/servlet
-api-2.3.jar (not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/jruby/jruby-complete/1.1.3/jruby-
complete-1.1.3.jar (not_needed)
Testing needed. Latest prerequisite change: Wed Oct 22 00:19:27 +0800
2008 (d:/w
orkspace/rack_weblogic_workaround/target/classes). Last successful test
run: .
** Invoke jruby-rack:test:setup (first_time)
** Execute jruby-rack:test:setup
** Execute jruby-rack:test
Running tests in jruby-rack
** Invoke d:/workspace/rack_weblogic_workaround/target/classes
(not_needed)
** Invoke d:/workspace/rack_weblogic_workaround/target/resources
(not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/javax/servlet/servlet-api/2.3/servlet
-api-2.3.jar (not_needed)
** Invoke
C:/cygwin/home/rd/.m2/repository/org/jruby/jruby-complete/1.1.3/jruby-
complete-1.1.3.jar (not_needed)
** Invoke d:/workspace/rack_weblogic_workaround (first_time, not_needed)
** Invoke D:/jruby-1.1.4/lib/bsf.jar (first_time)
** Execute D:/jruby-1.1.4/lib/bsf.jar
** Invoke D:/jruby-1.1.4/lib/jruby.jar (first_time)
** Execute D:/jruby-1.1.4/lib/jruby.jar
** Invoke D:/jruby-1.1.4/lib/profile.jar (first_time)
** Execute D:/jruby-1.1.4/lib/profile.jar
Running java org.jruby.Main
d:/cygdrive/d/jdk1.6.0_10/bin/java -classpath
d:/workspace/rack_weblogic_workaro
und/target/classes;d:/workspace/rack_weblogic_workaround/target/resources;C:/cyg
win/home/rd/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar;C:/
cygwin/home/rd/.m2/repository/org/jruby/jruby-complete/1.1.3/jruby-complete-1.1.
3.jar;d:/workspace/rack_weblogic_workaround;D:/jruby-1.1.4/lib/bsf.jar;D:/jruby-
1.1.4/lib/jruby.jar;D:/jruby-1.1.4/lib/profile.jar
-Djruby.home=D:/jruby-1.1.4 -
Xmx512m org.jruby.Main
d:/workspace/rack_weblogic_workaround/target/spec/runner.
rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/cgi/session/java_servlet_
store_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/jruby/rack/mer
b_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/jruby/rack/rails_s
pec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/jruby/rack/servlet_ex
t_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/jruby/rack/servlet
helper_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/adapter
/rails_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/applicat
ion_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/dispatcher
spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/filter_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/handler/servlet_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/rails/rails_applicatio
n_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/servlet_conte
xt_listener_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/ser
vlet_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/rack/tag_spec.r
b
Error opening script file: d:/cygdrive/d/jdk1.6.0_10/bin/java -classpath
d:/work
space/rack_weblogic_workaround/target/classes;d:/workspace/rack_weblogic_workaro
und/target/resources;C:/cygwin/home/rd/.m2/repository/javax/servlet/servlet-api/
2.3/servlet-api-2.3.jar;C:/cygwin/home/rd/.m2/repository/org/jruby/jruby-complet
e/1.1.3/jruby-complete-1.1.3.jar;d:/workspace/rack_weblogic_workaround;D:/jruby-
1.1.4/lib/bsf.jar;D:/jruby-1.1.4/lib/jruby.jar;D:/jruby-1.1.4/lib/profile.jar
-D
jruby.home=D:/jruby-1.1.4 -Xmx512m org.jruby.Main
d:/workspace/rack_weblogic_wor
karound/target/spec/runner.rb
d:/workspace/rack_weblogic_workaround/src/spec/rub
y/cgi/session/java_servlet_store_spec.rb
d:/workspace/rack_weblogic_workaround/s
rc/spec/ruby/jruby/rack/merb_spec.rb
d:/workspace/rack_weblogic_workaround/src/s
pec/ruby/jruby/rack/rails_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec
/ruby/jruby/rack/servlet_ext_spec.rb
d:/workspace/rack_weblogic_workaround/src/s
pec/ruby/jruby/rack/servlet_helper_spec.rb
d:/workspace/rack_weblogic_workaround
/src/spec/ruby/rack/adapter/rails_spec.rb
d:/workspace/rack_weblogic_workaround/
src/spec/ruby/rack/application_spec.rb
d:/workspace/rack_weblogic_workaround/src
/spec/ruby/rack/dispatcher_spec.rb
d:/workspace/rack_weblogic_workaround/src/spe
c/ruby/rack/filter_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/r
ack/handler/servlet_spec.rb
d:/workspace/rack_weblogic_workaround/src/spec/ruby/
rack/rails/rails_application_spec.rb
d:/workspace/rack_weblogic_workaround/src/s
pec/ruby/rack/servlet_context_listener_spec.rb
d:/workspace/rack_weblogic_workar
ound/src/spec/ruby/rack/servlet_spec.rb
d:/workspace/rack_weblogic_workaround/sr
c/spec/ruby/rack/tag_spec.rb (The filename, directory name, or volume
label synt
ax is incorrect)
** Invoke jruby-rack:test:teardown (first_time)
** Execute jruby-rack:test:teardown
Exception while invoking prerequisites of task <Rake::Task
jruby-rack:build => [
d:/workspace/rack_weblogic_workaround/target/classes, jruby-rack:test]>
Exception while invoking prerequisites of task <Rake::Task package =>
[build]>
[Failed] Your build failed with an error:
d:/workspace/rack_weblogic_workaround:
Failed to execute java org.jruby.Main, see errors above
buildr aborted!
â†[31mFailed to execute java org.jruby.Main, see errors aboveâ†[0m
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:478:in `invoke_with_call_chain’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:468:in `invoke_with_call_chain’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:463:in `invoke’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in
`invoke_tas
k’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
`top_level’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
each' D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
top_level’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:321:in standard_exception_handling' D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in
top_level’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:170:in run' D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat ion.rb:321:in
standard_exception_handling’
D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/lib/buildr/core/applicat
ion.rb:161:in run' D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/bin/buildr:20 D:/jruby-1.1.4/lib/ruby/gems/1.8/gems/buildr-1.3.3-java/bin/buildr:19:in
load’
D:/jruby-1.1.4/bin/buildr:19