Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better jruby.home detection on IBM WAS #123

Closed
wants to merge 1 commit into from
Closed

Conversation

kares
Copy link
Member

@kares kares commented Feb 9, 2012

currently config.getJRubyHome() on WAS ends up being the fall-back /tmp dir (e.g. when deploying a .war)
this is probably due to a slightly non-standard getResource() IBM Java behavior - it seems to always return null for jar "dirs" but works if you ask for a jar "file" entry.

sample return values :

 getResource("/META-INF/jruby.home") returns a null

 getResource("/META-INF/jruby.home/bin/jrubyc") returns :
 wsjar:file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/debianNode01Cell/rails31_war.ear/rails31.war/WEB-INF/lib/jruby-stdlib-1.6.7.dev.jar!/META-INF/jruby.home/bin/jrubyc

 getResource("/META-INF/jruby.home/bin/jrubyc").getProtocol() would return "wsjar"

 and the location (if it passed the if) would have been :
 file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/debianNode01Cell/rails31_war.ear/rails31.war/WEB-INF/lib/jruby-stdlib-1.6.7.dev.jar!/META-INF/jruby.home/bin/jrubyc

I think it's fine that we do not pass resource.getProtocol().equals("jar") since than the location would not have been set to location = "classpath:/META-INF/jruby.home"; but end up as a file:/... path (that would need to be stripped from "/bin/jrubyc") but since we can not walk URLs as a FS anyway classpath:/META-INF/jruby.home seems fine and is working fine (with the LoadService).

we've been using a "hack" (if JRuby.runtime.instance_config.jruby_home == tmpdir) in jruby-rack to fix the $LOAD_PATH but if jruby correctly detected it's home it would not have been necessary ...

tested environment :

WebSphere Application Server 8.0.0.1
Host Operating System is Linux, version 2.6.32-5-686
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM

@kares
Copy link
Member Author

kares commented Feb 9, 2012

in case you guys decide to merge this in it would be fine to get it on 1_6 as well // cc @headius

@BanzaiMan
Copy link
Member

I merged this to the master as bec227e.

@BanzaiMan BanzaiMan closed this Mar 24, 2012
kares added a commit to kares/jruby-rack that referenced this pull request Aug 20, 2014
this should not really matter since there's a fix for WAS in 1.7.0 jruby/jruby#123 (which was the only app server that was reported doing this)
@kares kares mentioned this pull request Nov 6, 2014
eregon added a commit that referenced this pull request Sep 29, 2015
fa9e1cd Add some other cases for #super_method specs
3481f99 Add Enumerable#{min,max,min_by,max_by} specs with nil
00f2439 added spec for lambda with optional parameter
a9de138 Add version guard
f424cb0 Add block and lambda specs for MRI bug #9593
9d36115 Add spec for MRI bug #9593
14f3122 Update hash spec to include quoted symbol key syntax
8cb48a7 Spec for Method and UnboundMethod #super_method (Ruby 2.2+)
d6e3175 Fix Float#prev_float and Float#next_float specs
be46b2c More edge case specs for Float#next_float and #prev_float near zero
d7434d3 Specs for Float#next_float and #prev_float use eql? instead of ==
8fa732b Specs for Float#next_float and #prev_float on NAN
41a949b Specs for Float#next_float and #prev_float
4296712 Kernel#throw now raises an UncaughtThrowError when there is no matching catch block.
1b79214 Add version guard
3529807 birthtime can also be implemented on Windows
cd31973 Only darwin supports birthtime
e6cbae8 adapt specs for specifics platform checks
6cca077 Add File.birthtime and File#birthtime specs
ca27d37 Add a single space between after and :each
8944d0c Add version guard
8e3cfa6 File#birthtime is not be implemented on some platforms
af195cb Add File::Stat#birthtime specs
654c1ee Add version guard
933b95f Add specs for Enumerable#slice_when
8011bb5 Argument error -> ArgumentError
1a9abba Add version guard
9d9aa3e Add specs for Enumerable#max_by optional arg
fa4e34a Add version guard
18d00f6 Add specs for Binding#receiver
c1a1972 Add version guard
5f44013 Add spec for Enumerable#max optional arg
534d780 Fix typo in Enumerable#max's spec. s/minimum/maximum
78345ae We are already in the Enumerable#max block, there's no need to repeat it.
559210b Remove unused @A instance variable
c9b9cd0 Use context for readability
56639ab Add version guard
53c2397 Add specs for Enumberable#min_by optional args
553610a Fix typo in Enumerable#min_by's descriptions: Minimum, not maximum
549d3b7 Specify some edge cases for Enumerable#min optional arg
e8a21bb Remove unused instance variable @A
1469d34 Add version guard
f8a2be8 Add specs for Enumerable#min with optional arg.
bf8cd32 Add version guard and fix style
976c355 Add spec for Enumerable#slice_after
b92dde0 Add an example to Binding#local_variables
45f2788 Add version guard
41b3c09 Add specs for Binding#local_variables
9b8336e Fix Method#curry spec and add version guard
60ba4e9 Add Method#curry specs
9f0f050 Fix an example in ObjectSpace#each_object to run in 2.0.0
b68632e Specify Binding#local_variable_get
0291545 Enumerable#find_index should use #== semantics for testing equality
6e9cc19 Simplify the #=== private spec
78ed9fc Super uses given block even if arguments are passed explicitly
3f8b74b Case can call private #=== method
d0d4f14 Synchronize Fixnum#<< and #>>
fb52f65 Add a few examples to Fixnum#<<
9a888d0 Add more examples for Fixnum#>>
a1aabf0 Fixes to ObjectSpaces specs.
cf62939 Fix spec name.
b09b120 More places objects could hide from ObjectSpace - thread and fiber locals and at_exit handlers.
b91a806 ObjectSpace can reach both implicitly and explicitly captured locals
9c7123a Add specs for where ObjectSpace.each_object can find objects.
254ccdf Improve Thread#raise spec to be more precise about the backtrace
9955865 Remove trailing spaces
4ab3965 Merge pull request #136 from wied03/master
477068f Account for cases where the LHS is a nil local variable - opal/opal#1090 (comment)
5cab2a8 Improve specdocs of class specs
c9eb2f1 Remove trailing spaces
db3c823 Merge pull request #135 from wied03/master
ff28bca Test creating classes within Class.new blocks
cd78752 Merge pull request #133 from ngoto/use-CCDLFLAGS
23c373d CCDLFLAGS should be used to build Position Independent Code
b027be8 Use the output matcher in PP.pp to avoid touching $stdout directly
a01fdc4 Fix formatting and trailing spaces
9a73ed9 Merge pull request #130 from wied03/master
f02ff7d Remove stringio dependency and use IOStub
ae1aa04 Try to simplify the File#flock blocking spec
159de46 Get started with PP stdlib specs, especially the PP::pp method
0e097ec Merge pull request #131 from nobu/ftp#system-fix
de0d559 newlines do not matter
46c3fb2 Inline shared describe for Kernel#lambda with single usage.
80729a3 Merge pull request #129 from iliabylich/stop-generating-dynamic-test-names
8343600 Stop generating dynamic test names for lambda.
0dbf847 Merge pull request #128 from ngoto/atan2-revert-ac7ca51
4abb3c6 Merge pull request #126 from ngoto/File-stat-NFS
0995c96 Remove needless "platform_is :solaris" guards.
ec6ce28 Use 1 second ago from now to avoid failure due to NFS cache behavior.
1f65cb6 Merge pull request #124 from ngoto/flock-Solaris
5190db6 Merge pull request #123 from ngoto/DATA-flock-Solaris
aeeb3dd DATA (read-only opened) can not be locked by File#flock on Solaris
73857c7 Rewrite some File#flock specs using ruby_exe for supporting Solaris
a0570cc Rewrite -s flag specs to explicitly pass inline code
25cda76 Use a fixture for the autoload with frozen Object spec
6e93ec5 Merge pull request #117 from rashmirathi1729/master
2a4a08c Add Matrix#to_a specs
96b4183 Merge pull request #119 from tobiashm/master
0bc0537 String#start_with? and #end_with? for empty string
f7cf2bd Module#singleton_class? is 2.1+ only
7afc6fb toplevel visibility is already specified in language/
08088b9 There is no Kernel#type.
c695c91 Move method_missing fixture
48eff07 Move method_missing specs to the right place
4ddc433 Relax spec of send arity
511568b Organize send specs
821845d Unshare Continuation specs
329d7cc Continuations are only available as a library in 2.0+
5cebf8e Fix specdocs for Float constants
20cad95 Move Module#singleton_class? to the right file

git-subtree-dir: spec/ruby
git-subtree-split: fa9e1cdc2815fa006b89cf83344ba6041d0d566c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants