
| Key: |
JRUBY-3286
|
| Type: |
Bug
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Alex Coles
|
| Votes: |
0
|
| Watchers: |
3
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
1.
JRUBY-3286.patch (4 kB)
|
|
Environment:
|
Mac OS X 10.5.5; SoyLatte 1.0.3 i386:
java version "1.6.0_03-p3"
Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00)
Java HotSpot(TM) Server VM (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed mode)
Mac OS X 10.5.5; SoyLatte 1.0.3 i386:
java version "1.6.0_03-p3"
Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00)
Java HotSpot(TM) Server VM (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed mode)
|
|
To reproduce:
- create a Java extension, with a class name of MyAppExtService, implementing org.jruby.runtime.load.BasicLibraryService.
- compile and JAR the extension as my_app_ext.jar.
- copy the JAR into the same directory (such as "lib") as the my_app.rb file that require it
- create a my_app.rb file with the line:
require 'my_app_ext'
- the extension should be required
- now change the line in my_app.rb to:
require File.expand_path(File.join(File.dirname(_FILE_), 'my_app_ext'))
Expected behavior:
- the extension should load
Actual behavior:
- the extension does not load
Example of this behavior:
This commit broke the loading of the Java extensions in the DataObjects project:
http://github.com/sam/do/commit/2b86f4a5d55205192175fe06eb93706fc876146a
This commit then returns to using relative paths so that the Java extension will load:
http://github.com/sam/do/commit/f8f2083d652821ee39f06f63ab37c9b870da506
|
|
Description
|
To reproduce:
- create a Java extension, with a class name of MyAppExtService, implementing org.jruby.runtime.load.BasicLibraryService.
- compile and JAR the extension as my_app_ext.jar.
- copy the JAR into the same directory (such as "lib") as the my_app.rb file that require it
- create a my_app.rb file with the line:
require 'my_app_ext'
- the extension should be required
- now change the line in my_app.rb to:
require File.expand_path(File.join(File.dirname(_FILE_), 'my_app_ext'))
Expected behavior:
- the extension should load
Actual behavior:
- the extension does not load
Example of this behavior:
This commit broke the loading of the Java extensions in the DataObjects project:
http://github.com/sam/do/commit/2b86f4a5d55205192175fe06eb93706fc876146a
This commit then returns to using relative paths so that the Java extension will load:
http://github.com/sam/do/commit/f8f2083d652821ee39f06f63ab37c9b870da506 |
Show » |
Sort Order:
|
Wow, this is goofy. Confirmed in 1.4dev that it still works like this:
~/projects/jruby ➔ javac -cp lib/jruby.jar MyAppExtService.java ~/projects/jruby ➔ jar cf my_app_ext.jar MyAppExtService.class ~/projects/jruby ➔ mkdir foo ~/projects/jruby ➔ mv my_app_ext.jar foo ~/projects/jruby ➔ jruby -e "require 'foo/my_app_ext'" ~/projects/jruby ➔ jruby -e "require 'foo/my_app_ext.jar'" ~/projects/jruby ➔ mv foo/my_app_ext.jar . ~/projects/jruby ➔ jruby -e "require 'my_app_ext.jar'" hello ~/projects/jruby ➔ cat MyAppExtService.java import org.jruby.runtime.load.BasicLibraryService; import org.jruby.Ruby; import java.io.IOException; public class MyAppExtService implements BasicLibraryService { public boolean basicLoad(Ruby runtime) { System.out.println("hello"); return true; } }