From rjb-users at rubyforge.org Wed Nov 1 10:00:16 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Wed, 1 Nov 2006 07:00:16 -0800 (PST) Subject: [rjb-users] Strange error when including another library Message-ID: <20061101150016.42879.qmail@web34211.mail.mud.yahoo.com> Hello Again, I'm using RJB with a C++ toolkit called Open Babel (http://depth-first.com/articles/2006/10/31/obruby-a-ruby-interface-to-open-babel). It uses a SWIG wrapper. When using Open Babel and RJB together I get a strange error message. This series of commands produces the error: require 'rubygems' require_gem 'rjb' require 'rjb' require 'openbabel' nts = Rjb::import 'uk.ac.cam.ch.wwmm.opsin.NameToStructure' This is the error that is produced (using irb): InternalError: unknown exception from (irb):6:in `import' from (irb):6 However, when I use this sequence of commands, I get no errors and can go on to use both libraries: require 'rubygems' require_gem 'rjb' require 'rjb' nts = Rjb::import 'uk.ac.cam.ch.wwmm.opsin.NameToStructure' require 'openbabel' If I'm using Rjb::import to import Java library classes (java.util.Vector), then I don't get errors regardless of the order of commands. I've checked CLASSPATH, and it appears unmodified by require 'openbabel'. Also, require 'net/http' in place of require 'openbabel' does not produce an error regardless of the order of commands. Any ideas? thanks, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com __________________________________________________________________________________________ Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. (http://advision.webevents.yahoo.com/mailbeta) From rjb-users at rubyforge.org Wed Nov 1 10:17:47 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Wed, 1 Nov 2006 07:17:47 -0800 (PST) Subject: [rjb-users] Extending a Java class In-Reply-To: <20061101003215.ECE2.ARTON@e07.itscom.net> Message-ID: <20061101151747.60792.qmail@web34215.mail.mud.yahoo.com> Hi Arton, The delegation idea is nice. I gave it a try and it worked. Now I have a more difficult question. Here's a situation I'd like to get working. I have a Java library. A class has a static method that takes an argument of type Foo: public class Foo { //... public void bar() { //... } } and.... package my.lib; public class Util { //... public static void doSomething(Foo foo) { // use F } } In Ruby, I would like to create a pure Ruby class that works like the Java class Foo: class FakeFoo #... def bar #implement end end I'd like to be able to do this: require 'rjb' Util=Rjb::import 'my.lib.Util' ff=FakeFoo.new Util.doSomething(ff) When I try this now, I get a method_missing error. But what is the method that's missing? What can I do to FakeFoo to make it work with the Util.doSomething method? cheers, Rich --- arton wrote: > Hi Rich, > > At this time, the imported class is not a really > Ruby class in Rjb. > If you think it's better to map imported class as > Ruby's class, I positively > plan to implement the feature. > So, at this time, a workaround is to use delegation > instead of > inheritance. > This sample code describes how to delegate method > calls to the contained > object. > > require 'rjb' > require 'test/unit' > > class RubyVector > Vector = Rjb::import('java.util.Vector') > def initialize > @vector = Vector.new > end > def test_vector > 'it worked' > end > def method_missing(msg, *arg) > @vector.send(msg, *arg) > end > end > > class VectorTest < Test::Unit::TestCase > > def setup > @r = RubyVector.new > end > > def test_adding_method() > assert_equal('it worked', @r.test_vector) > end > > def test_add() > @r.add(1) > @r.add(2) > @r.add(3) > assert(@r.contains(1)) > assert(!@r.contains(8)) > end > > def test_get() > @r.add("ab") > @r.add("cd") > @r.add("ef") > assert_equal("ab", @r.get(0).toString) > assert_equal("cd", @r.get(1).toString) > assert_equal("ef", @r.get(2).toString) > end > > def test_iterator() > @r.add("ab") > @r.add("cd") > @r.add("ef") > i = @r.iterator > assert(i.hasNext) > assert_equal("ab", i.next.toString) > assert(i.hasNext) > assert_equal("cd", i.next.toString) > assert(i.hasNext) > assert_equal("ef", i.next.toString) > assert(!i.hasNext) > end > end > > Best reagrds > > On Mon, 30 Oct 2006 22:07:02 -0800 (PST) > richard apodaca ???? wrote: > > > Hi Arton, > > > > I was wondering how to extend a Java class with > RJB. I > > saw in the documentation how to bind a Java > interface > > to a Ruby class, but can I extend a Java class > with > > Ruby? Here's an example of what I've tried: > > > > require 'rubygems' > > require_gem 'rjb' > > require 'rjb' > > > > Vector=Rjb::import 'java.util.Vector' > > > > class Test < Vector.class > > def initialize > > end > > def test_vector > > puts "it worked" > > end > > end > > > > t=Test.new # => TypeError: allocator undefined for > > Test > > > > I get a TypeError with the above code. If I try to > > extend directly form Vector rather than > Vector.class, > > I get: > > > > TypeError: superclass must be a Class > > > > Any ideas? > > > > thanks, > > Rich > > > > > > ____________________________ > > Richard Apodaca > > Blog: http://depth-first.com > > > > > > > > > ____________________________________________________________________________________ > > Want to start your own business? Learn how on > Yahoo! Small Business > > (http://smallbusiness.yahoo.com) > > > > -- > arton > > ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ We have the perfect Group for you. Check out the handy changes to Yahoo! Groups (http://groups.yahoo.com) From rjb-users at rubyforge.org Wed Nov 1 12:00:45 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Thu, 02 Nov 2006 02:00:45 +0900 Subject: [rjb-users] Extending a Java class In-Reply-To: <20061101151747.60792.qmail@web34215.mail.mud.yahoo.com> References: <20061101003215.ECE2.ARTON@e07.itscom.net> <20061101151747.60792.qmail@web34215.mail.mud.yahoo.com> Message-ID: <20061102015357.B206.ARTON@e07.itscom.net> Hi, Rich, This is the case what really class inheritance is required. I suppose that the method_missing error was occured for calling Util#doSomething(Foo foo), because your FakeFoo is not a subclass of Foo, so Rjb searched a method Util#doSomething(Object), and then it threw the exception because the method was missing. At this time, the best solution is to define an interface, because Rjb can bind the interface with Ruby class. But I know that is useless for the existing methods like Utli#doSomething(Foo foo). On Wed, 1 Nov 2006 07:17:47 -0800 (PST) rjb-users at rubyforge.org?? wrote: > Hi Arton, > > The delegation idea is nice. I gave it a try and it > worked. Now I have a more difficult question. > > Here's a situation I'd like to get working. I have a > Java library. A class has a static method that takes > an argument of type Foo: > > public class Foo > { > //... > > public void bar() > { > //... > } > } > > and.... > > package my.lib; > > public class Util > { > //... > > public static void doSomething(Foo foo) > { > // use F > } > } > > In Ruby, I would like to create a pure Ruby class that > works like the Java class Foo: > > class FakeFoo > > #... > > def bar > #implement > end > end > > I'd like to be able to do this: > > require 'rjb' > > Util=Rjb::import 'my.lib.Util' > > ff=FakeFoo.new > > Util.doSomething(ff) > > When I try this now, I get a method_missing error. But > what is the method that's missing? What can I do to > FakeFoo to make it work with the Util.doSomething > method? > > cheers, > Rich > > --- arton wrote: > > > Hi Rich, > > > > At this time, the imported class is not a really > > Ruby class in Rjb. > > If you think it's better to map imported class as > > Ruby's class, I positively > > plan to implement the feature. > > So, at this time, a workaround is to use delegation > > instead of > > inheritance. > > This sample code describes how to delegate method > > calls to the contained > > object. > > > > require 'rjb' > > require 'test/unit' > > > > class RubyVector > > Vector = Rjb::import('java.util.Vector') > > def initialize > > @vector = Vector.new > > end > > def test_vector > > 'it worked' > > end > > def method_missing(msg, *arg) > > @vector.send(msg, *arg) > > end > > end > > > > class VectorTest < Test::Unit::TestCase > > > > def setup > > @r = RubyVector.new > > end > > > > def test_adding_method() > > assert_equal('it worked', @r.test_vector) > > end > > > > def test_add() > > @r.add(1) > > @r.add(2) > > @r.add(3) > > assert(@r.contains(1)) > > assert(!@r.contains(8)) > > end > > > > def test_get() > > @r.add("ab") > > @r.add("cd") > > @r.add("ef") > > assert_equal("ab", @r.get(0).toString) > > assert_equal("cd", @r.get(1).toString) > > assert_equal("ef", @r.get(2).toString) > > end > > > > def test_iterator() > > @r.add("ab") > > @r.add("cd") > > @r.add("ef") > > i = @r.iterator > > assert(i.hasNext) > > assert_equal("ab", i.next.toString) > > assert(i.hasNext) > > assert_equal("cd", i.next.toString) > > assert(i.hasNext) > > assert_equal("ef", i.next.toString) > > assert(!i.hasNext) > > end > > end > > > > Best reagrds > > > > On Mon, 30 Oct 2006 22:07:02 -0800 (PST) > > richard apodaca ???s wrote: > > > > > Hi Arton, > > > > > > I was wondering how to extend a Java class with > > RJB. I > > > saw in the documentation how to bind a Java > > interface > > > to a Ruby class, but can I extend a Java class > > with > > > Ruby? Here's an example of what I've tried: > > > > > > require 'rubygems' > > > require_gem 'rjb' > > > require 'rjb' > > > > > > Vector=Rjb::import 'java.util.Vector' > > > > > > class Test < Vector.class > > > def initialize > > > end > > > def test_vector > > > puts "it worked" > > > end > > > end > > > > > > t=Test.new # => TypeError: allocator undefined for > > > Test > > > > > > I get a TypeError with the above code. If I try to > > > extend directly form Vector rather than > > Vector.class, > > > I get: > > > > > > TypeError: superclass must be a Class > > > > > > Any ideas? > > > > > > thanks, > > > Rich > > > > > > > > > ____________________________ > > > Richard Apodaca > > > Blog: http://depth-first.com > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > Want to start your own business? Learn how on > > Yahoo! Small Business > > > (http://smallbusiness.yahoo.com) > > > > > > > -- > > arton > > > > > > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > > > ____________________________________________________________________________________ > We have the perfect Group for you. Check out the handy changes to Yahoo! Groups > (http://groups.yahoo.com) > > _______________________________________________ > rjb-users mailing list > rjb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rjb-users -- arton From rjb-users at rubyforge.org Wed Nov 1 12:04:22 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Thu, 02 Nov 2006 02:04:22 +0900 Subject: [rjb-users] Strange error when including another library In-Reply-To: <20061101150016.42879.qmail@web34211.mail.mud.yahoo.com> References: <20061101150016.42879.qmail@web34211.mail.mud.yahoo.com> Message-ID: <20061102020149.B209.ARTON@e07.itscom.net> Hi, Ummmm, it's difficult, and I have no idea about that. It's really need to analyze what had happend between Open Babel and uk.ac.cam.ch.... Sorry. On Wed, 1 Nov 2006 07:00:16 -0800 (PST) rjb-users at rubyforge.org?? wrote: > Hello Again, > > I'm using RJB with a C++ toolkit called Open Babel > (http://depth-first.com/articles/2006/10/31/obruby-a-ruby-interface-to-open-babel). > It uses a SWIG wrapper. > > When using Open Babel and RJB together I get a strange > error message. This series of commands produces the > error: > > require 'rubygems' > require_gem 'rjb' > require 'rjb' > require 'openbabel' > > nts = Rjb::import > 'uk.ac.cam.ch.wwmm.opsin.NameToStructure' > > This is the error that is produced (using irb): > > InternalError: unknown exception > from (irb):6:in `import' > from (irb):6 > > However, when I use this sequence of commands, I get > no errors and can go on to use both libraries: > > require 'rubygems' > require_gem 'rjb' > require 'rjb' > > nts = Rjb::import > 'uk.ac.cam.ch.wwmm.opsin.NameToStructure' > > require 'openbabel' > > If I'm using Rjb::import to import Java library > classes (java.util.Vector), then I don't get errors > regardless of the order of commands. I've checked > CLASSPATH, and it appears unmodified by require > 'openbabel'. Also, require 'net/http' in place of > require 'openbabel' does not produce an error > regardless of the order of commands. > > Any ideas? > > thanks, > Rich > > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > > > __________________________________________________________________________________________ > Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. > (http://advision.webevents.yahoo.com/mailbeta) > > _______________________________________________ > rjb-users mailing list > rjb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rjb-users -- arton From rjb-users at rubyforge.org Sat Nov 18 15:50:29 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Sat, 18 Nov 2006 12:50:29 -0800 (PST) Subject: [rjb-users] Can't find jarfile classes with Rails Message-ID: <835466.42977.qm@web34212.mail.mud.yahoo.com> I am having problems with RJB importing a class from a jarfile when using Rails. The following works fine (on Linux amd64): (1) Create a directory called 'test', and copy a jarfile into it (I'm using Junit 'junit-3.8.1.jar', but any jarfile will do). (2) export CLASSPATH="./junit-3.8.1.jar" (3) $ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rjb' => true irb(main):003:0> require 'rjb' => true irb(main):004:0> Rjb::import 'junit.framework.Assert' => # So far so good. But loading Rails first and then the JUnit class fails: $ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' => true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> require 'rjb' => true irb(main):005:0> Rjb::import 'junit.framework.Assert' InternalError: unknown exception from (irb):5:in `import' from (irb):5 irb(main):006:0> Rjb::import 'junit.framework.Assert' NoClassDefFoundError: junit/framework/Assert from (irb):6:in `import' from (irb):6 from :0 Notice how I'm getting two different errors for the same invocation of Rjb::import. Does anyone else have the same probelem? thanks, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $310k for $999/mo. Calculate new payment! www.LowerMyBills.com/lre From rjb-users at rubyforge.org Sat Nov 18 22:46:02 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Sun, 19 Nov 2006 12:46:02 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <20061118214710.23287.qmail@web34211.mail.mud.yahoo.com> References: <20061008051122.DD7B.ARTON@e07.itscom.net> <20061118214710.23287.qmail@web34211.mail.mud.yahoo.com> Message-ID: <20061119120712.0416.ARTON@e07.itscom.net> Hi, Rich I've heard the issue from Ias (CCed with this mail). But I couldn't reproduce with Ruby 1.8.5, rjb 1.0.2, rails 1.1.6 on Win32(x86). By the way, the mailing list is working, I think. irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' => true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> require 'rjb' => true irb(main):005:0> Rjb::import 'junit.framework.Assert' => # and on Linux (ruby 1.8.5, rjb 1.0.2, rails-1.1.6) irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' => true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> require 'rjb' => true irb(main):005:0> Rjb::import 'jp.co.infoseek.hp.arton.rjbtest.TestBean' => # irb(main):006:0> exit $ cat /proc/version Linux version 2.4.33-smp (root at coral) (gcc version 2.95.4 20011002 (Debian prerelease)) #1 SMP Tue Oct 31 15:24:38 JST 2006 Both are running with Java 1.5.0_* $ java -version java version "1.5.0_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05) Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing) C:\home\arton>java -version java version "1.5.0_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01) Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing) What is your version of Rails and Java ? On Sat, 18 Nov 2006 13:47:10 -0800 (PST) richard apodaca ?? wrote: > Hi Arton, > > I'm not sure if the rjb mailing list is working, so > I'll send this to you directly. > > I am having problems with RJB importing a class from a > jarfile when using Rails. > > The following works fine (on Linux amd64): > > (1) Create a directory called 'test', and copy a > jarfile into it (I'm using Junit 'junit-3.8.1.jar', > but any jarfile will do). > > (2) export CLASSPATH="./junit-3.8.1.jar" > > (3) $ irb > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require_gem 'rjb' > => true > irb(main):003:0> require 'rjb' > => true > irb(main):004:0> Rjb::import 'junit.framework.Assert' > => # > > So far so good. > > But loading Rails first and then the JUnit class > fails: > > $ irb > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require_gem 'rails' > => true > irb(main):003:0> require_gem 'rjb' > => true > irb(main):004:0> require 'rjb' > => true > irb(main):005:0> Rjb::import 'junit.framework.Assert' > InternalError: unknown exception > from (irb):5:in `import' > from (irb):5 > irb(main):006:0> Rjb::import 'junit.framework.Assert' > NoClassDefFoundError: junit/framework/Assert > from (irb):6:in `import' > from (irb):6 > from :0 > > Notice how I'm getting two different errors for the > same invocation of Rjb::import. > > Can you reproduce this bug? > > thanks, > Rich > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > > > ____________________________________________________________________________________ > Sponsored Link > > Don't quit your job - take classes online > www.Classesusa.com > -- arton From rjb-users at rubyforge.org Sun Nov 19 00:15:58 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Sat, 18 Nov 2006 21:15:58 -0800 (PST) Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <20061119120712.0416.ARTON@e07.itscom.net> Message-ID: <232765.42309.qm@web34215.mail.mud.yahoo.com> Hi Arton, Well, at least we've narrowed it down to my platform. Was the other user's platform also Linux amd64? $ cat /proc/version Linux version 2.6.17-5mdv (rtp at ramanujan.mandriva.com) (gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)) #1 SMP Wed Sep 13 14:28:02 EDT 2006 $ ruby -v ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] $ rails -v Rails 1.1.6 $ java -version java version "1.5.0_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_09-b01, mixed mode) --- arton wrote: > Hi, Rich > > I've heard the issue from Ias (CCed with this mail). > But I couldn't reproduce with Ruby 1.8.5, rjb 1.0.2, > rails 1.1.6 on > Win32(x86). > By the way, the mailing list is working, I think. > > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require_gem 'rails' > => true > irb(main):003:0> require_gem 'rjb' > => true > irb(main):004:0> require 'rjb' > => true > irb(main):005:0> Rjb::import > 'junit.framework.Assert' > => # > > and on Linux (ruby 1.8.5, rjb 1.0.2, rails-1.1.6) > > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require_gem 'rails' > => true > irb(main):003:0> require_gem 'rjb' > => true > irb(main):004:0> require 'rjb' > => true > irb(main):005:0> Rjb::import > 'jp.co.infoseek.hp.arton.rjbtest.TestBean' > => > # > irb(main):006:0> exit > > $ cat /proc/version > Linux version 2.4.33-smp (root at coral) (gcc version > 2.95.4 20011002 (Debian prerelease)) #1 SMP Tue Oct > 31 15:24:38 JST 2006 > > Both are running with Java 1.5.0_* > > $ java -version > java version "1.5.0_04" > Java(TM) 2 Runtime Environment, Standard Edition > (build 1.5.0_04-b05) > Java HotSpot(TM) Client VM (build 1.5.0_04-b05, > mixed mode, sharing) > > C:\home\arton>java -version > java version "1.5.0_09" > Java(TM) 2 Runtime Environment, Standard Edition > (build 1.5.0_09-b01) > Java HotSpot(TM) Client VM (build 1.5.0_09-b01, > mixed mode, sharing) > > What is your version of Rails and Java ? > > On Sat, 18 Nov 2006 13:47:10 -0800 (PST) > richard apodaca ???? wrote: > > > Hi Arton, > > > > I'm not sure if the rjb mailing list is working, > so > > I'll send this to you directly. > > > > I am having problems with RJB importing a class > from a > > jarfile when using Rails. > > > > The following works fine (on Linux amd64): > > > > (1) Create a directory called 'test', and copy a > > jarfile into it (I'm using Junit > 'junit-3.8.1.jar', > > but any jarfile will do). > > > > (2) export CLASSPATH="./junit-3.8.1.jar" > > > > (3) $ irb > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require_gem 'rjb' > > => true > > irb(main):003:0> require 'rjb' > > => true > > irb(main):004:0> Rjb::import > 'junit.framework.Assert' > > => # > > > > So far so good. > > > > But loading Rails first and then the JUnit class > > fails: > > > > $ irb > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require_gem 'rails' > > => true > > irb(main):003:0> require_gem 'rjb' > > => true > > irb(main):004:0> require 'rjb' > > => true > > irb(main):005:0> Rjb::import > 'junit.framework.Assert' > > InternalError: unknown exception > > from (irb):5:in `import' > > from (irb):5 > > irb(main):006:0> Rjb::import > 'junit.framework.Assert' > > NoClassDefFoundError: junit/framework/Assert > > from (irb):6:in `import' > > from (irb):6 > > from :0 > > > > Notice how I'm getting two different errors for > the > > same invocation of Rjb::import. > > > > Can you reproduce this bug? > > > > thanks, > > Rich > > > > ____________________________ > > Richard Apodaca > > Blog: http://depth-first.com > > > > > > > > > ____________________________________________________________________________________ > > Sponsored Link > > > > Don't quit your job - take classes online > > www.Classesusa.com > > > > -- > arton > > ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Sponsored Link $200,000 mortgage for $660/ mo - 30/15 yr fixed, reduce debt - http://yahoo.ratemarketplace.com From rjb-users at rubyforge.org Mon Nov 20 00:00:06 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 14:00:06 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <232765.42309.qm@web34215.mail.mud.yahoo.com> References: <20061119120712.0416.ARTON@e07.itscom.net> <232765.42309.qm@web34215.mail.mud.yahoo.com> Message-ID: <20061120135257.F0BD.ARTON@e07.itscom.net> Hi all I've got some information about that Amd64 version of Rjb is crushed in java.util.zip.Inflater. And I found Java's rt.jar was not compressed and junit-4.1.jar was compressed. So wouldn't you please un-jar and re-jar junit-4.1 or other jars caused InternalError without compression. Ias, I apologised you that I've forgotten the Rjb's feature that emits the stack-trace of Java'e exception if one sets $VERBOSE = true. Regards. On Sat, 18 Nov 2006 21:15:58 -0800 (PST) richard apodaca ?? wrote: > Hi Arton, > > Well, at least we've narrowed it down to my platform. > Was the other user's platform also Linux amd64? > > $ cat /proc/version > Linux version 2.6.17-5mdv (rtp at ramanujan.mandriva.com) > (gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)) > #1 SMP Wed Sep 13 14:28:02 EDT 2006 > > $ ruby -v > ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] > > $ rails -v > Rails 1.1.6 > > > $ java -version > java version "1.5.0_09" > Java(TM) 2 Runtime Environment, Standard Edition > (build 1.5.0_09-b01) > Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_09-b01, > mixed mode) > > > --- arton wrote: > > > Hi, Rich > > > > I've heard the issue from Ias (CCed with this mail). > > But I couldn't reproduce with Ruby 1.8.5, rjb 1.0.2, > > rails 1.1.6 on > > Win32(x86). > > By the way, the mailing list is working, I think. > > > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require_gem 'rails' > > => true > > irb(main):003:0> require_gem 'rjb' > > => true > > irb(main):004:0> require 'rjb' > > => true > > irb(main):005:0> Rjb::import > > 'junit.framework.Assert' > > => # > > > > and on Linux (ruby 1.8.5, rjb 1.0.2, rails-1.1.6) > > > > irb(main):001:0> require 'rubygems' > > => true > > irb(main):002:0> require_gem 'rails' > > => true > > irb(main):003:0> require_gem 'rjb' > > => true > > irb(main):004:0> require 'rjb' > > => true > > irb(main):005:0> Rjb::import > > 'jp.co.infoseek.hp.arton.rjbtest.TestBean' > > => > > > # > > irb(main):006:0> exit > > > > $ cat /proc/version > > Linux version 2.4.33-smp (root at coral) (gcc version > > 2.95.4 20011002 (Debian prerelease)) #1 SMP Tue Oct > > 31 15:24:38 JST 2006 > > > > Both are running with Java 1.5.0_* > > > > $ java -version > > java version "1.5.0_04" > > Java(TM) 2 Runtime Environment, Standard Edition > > (build 1.5.0_04-b05) > > Java HotSpot(TM) Client VM (build 1.5.0_04-b05, > > mixed mode, sharing) > > > > C:\home\arton>java -version > > java version "1.5.0_09" > > Java(TM) 2 Runtime Environment, Standard Edition > > (build 1.5.0_09-b01) > > Java HotSpot(TM) Client VM (build 1.5.0_09-b01, > > mixed mode, sharing) > > > > What is your version of Rails and Java ? > > > > On Sat, 18 Nov 2006 13:47:10 -0800 (PST) > > richard apodaca ???s wrote: > > > > > Hi Arton, > > > > > > I'm not sure if the rjb mailing list is working, > > so > > > I'll send this to you directly. > > > > > > I am having problems with RJB importing a class > > from a > > > jarfile when using Rails. > > > > > > The following works fine (on Linux amd64): > > > > > > (1) Create a directory called 'test', and copy a > > > jarfile into it (I'm using Junit > > 'junit-3.8.1.jar', > > > but any jarfile will do). > > > > > > (2) export CLASSPATH="./junit-3.8.1.jar" > > > > > > (3) $ irb > > > irb(main):001:0> require 'rubygems' > > > => true > > > irb(main):002:0> require_gem 'rjb' > > > => true > > > irb(main):003:0> require 'rjb' > > > => true > > > irb(main):004:0> Rjb::import > > 'junit.framework.Assert' > > > => # > > > > > > So far so good. > > > > > > But loading Rails first and then the JUnit class > > > fails: > > > > > > $ irb > > > irb(main):001:0> require 'rubygems' > > > => true > > > irb(main):002:0> require_gem 'rails' > > > => true > > > irb(main):003:0> require_gem 'rjb' > > > => true > > > irb(main):004:0> require 'rjb' > > > => true > > > irb(main):005:0> Rjb::import > > 'junit.framework.Assert' > > > InternalError: unknown exception > > > from (irb):5:in `import' > > > from (irb):5 > > > irb(main):006:0> Rjb::import > > 'junit.framework.Assert' > > > NoClassDefFoundError: junit/framework/Assert > > > from (irb):6:in `import' > > > from (irb):6 > > > from :0 > > > > > > Notice how I'm getting two different errors for > > the > > > same invocation of Rjb::import. > > > > > > Can you reproduce this bug? > > > > > > thanks, > > > Rich > > > > > > ____________________________ > > > Richard Apodaca > > > Blog: http://depth-first.com > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > Sponsored Link > > > > > > Don't quit your job - take classes online > > > www.Classesusa.com > > > > > > > -- > > arton > > > > > > > ____________________________ > Richard Apodaca > Blog: http://depth-first.com > > > > ____________________________________________________________________________________ > Sponsored Link > > $200,000 mortgage for $660/ mo - > 30/15 yr fixed, reduce debt - > http://yahoo.ratemarketplace.com -- arton From rjb-users at rubyforge.org Mon Nov 20 02:37:21 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 16:37:21 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <20061120135257.F0BD.ARTON@e07.itscom.net> References: <232765.42309.qm@web34215.mail.mud.yahoo.com> <20061120135257.F0BD.ARTON@e07.itscom.net> Message-ID: <20061120141108.F0C0.ARTON@e07.itscom.net> Hi all Please reference http://www.mail-archive.com/java-linux at java.blackdown.org/msg15762.html http://www.mail-archive.com/java-linux at java.blackdown.org/msg15763.html http://www.mail-archive.com/java-linux at java.blackdown.org/msg15764.html The conversation was stopped by fail, but my colleague found setting LD_PRELOAD is usable in his environment. So, please test with below. % export LD_LIBRARY_PATH=/opt/jdk1.5.0_09/jre/lib/amd64/server:/opt/jdk1.5.0_09/jre/lib/amd64 % export LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so Best regards On Mon, 20 Nov 2006 14:00:06 +0900 arton ?? wrote: > Hi all > > I've got some information about that Amd64 version of Rjb is crushed in > java.util.zip.Inflater. And I found Java's rt.jar was not compressed and > junit-4.1.jar was compressed. > So wouldn't you please un-jar and re-jar junit-4.1 or other jars caused > InternalError without compression. > > Ias, I apologised you that I've forgotten the Rjb's feature that emits > the stack-trace of Java'e exception if one sets $VERBOSE = true. > > Regards. > > On Sat, 18 Nov 2006 21:15:58 -0800 (PST) > richard apodaca ?? wrote: > > > Hi Arton, > > > > Well, at least we've narrowed it down to my platform. > > Was the other user's platform also Linux amd64? > > > > $ cat /proc/version > > Linux version 2.6.17-5mdv (rtp at ramanujan.mandriva.com) > > (gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)) > > #1 SMP Wed Sep 13 14:28:02 EDT 2006 > > > > $ ruby -v > > ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] > > > > $ rails -v > > Rails 1.1.6 > > > > > > $ java -version > > java version "1.5.0_09" > > Java(TM) 2 Runtime Environment, Standard Edition > > (build 1.5.0_09-b01) > > Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_09-b01, > > mixed mode) > > > > > > --- arton wrote: > > > > > Hi, Rich > > > > > > I've heard the issue from Ias (CCed with this mail). > > > But I couldn't reproduce with Ruby 1.8.5, rjb 1.0.2, > > > rails 1.1.6 on > > > Win32(x86). > > > By the way, the mailing list is working, I think. > > > > > > irb(main):001:0> require 'rubygems' > > > => true > > > irb(main):002:0> require_gem 'rails' > > > => true > > > irb(main):003:0> require_gem 'rjb' > > > => true > > > irb(main):004:0> require 'rjb' > > > => true > > > irb(main):005:0> Rjb::import > > > 'junit.framework.Assert' > > > => # > > > > > > and on Linux (ruby 1.8.5, rjb 1.0.2, rails-1.1.6) > > > > > > irb(main):001:0> require 'rubygems' > > > => true > > > irb(main):002:0> require_gem 'rails' > > > => true > > > irb(main):003:0> require_gem 'rjb' > > > => true > > > irb(main):004:0> require 'rjb' > > > => true > > > irb(main):005:0> Rjb::import > > > 'jp.co.infoseek.hp.arton.rjbtest.TestBean' > > > => > > > > > # > > > irb(main):006:0> exit > > > > > > $ cat /proc/version > > > Linux version 2.4.33-smp (root at coral) (gcc version > > > 2.95.4 20011002 (Debian prerelease)) #1 SMP Tue Oct > > > 31 15:24:38 JST 2006 > > > > > > Both are running with Java 1.5.0_* > > > > > > $ java -version > > > java version "1.5.0_04" > > > Java(TM) 2 Runtime Environment, Standard Edition > > > (build 1.5.0_04-b05) > > > Java HotSpot(TM) Client VM (build 1.5.0_04-b05, > > > mixed mode, sharing) > > > > > > C:\home\arton>java -version > > > java version "1.5.0_09" > > > Java(TM) 2 Runtime Environment, Standard Edition > > > (build 1.5.0_09-b01) > > > Java HotSpot(TM) Client VM (build 1.5.0_09-b01, > > > mixed mode, sharing) > > > > > > What is your version of Rails and Java ? > > > > > > On Sat, 18 Nov 2006 13:47:10 -0800 (PST) > > > richard apodaca ???s wrote: > > > > > > > Hi Arton, > > > > > > > > I'm not sure if the rjb mailing list is working, > > > so > > > > I'll send this to you directly. > > > > > > > > I am having problems with RJB importing a class > > > from a > > > > jarfile when using Rails. > > > > > > > > The following works fine (on Linux amd64): > > > > > > > > (1) Create a directory called 'test', and copy a > > > > jarfile into it (I'm using Junit > > > 'junit-3.8.1.jar', > > > > but any jarfile will do). > > > > > > > > (2) export CLASSPATH="./junit-3.8.1.jar" > > > > > > > > (3) $ irb > > > > irb(main):001:0> require 'rubygems' > > > > => true > > > > irb(main):002:0> require_gem 'rjb' > > > > => true > > > > irb(main):003:0> require 'rjb' > > > > => true > > > > irb(main):004:0> Rjb::import > > > 'junit.framework.Assert' > > > > => # > > > > > > > > So far so good. > > > > > > > > But loading Rails first and then the JUnit class > > > > fails: > > > > > > > > $ irb > > > > irb(main):001:0> require 'rubygems' > > > > => true > > > > irb(main):002:0> require_gem 'rails' > > > > => true > > > > irb(main):003:0> require_gem 'rjb' > > > > => true > > > > irb(main):004:0> require 'rjb' > > > > => true > > > > irb(main):005:0> Rjb::import > > > 'junit.framework.Assert' > > > > InternalError: unknown exception > > > > from (irb):5:in `import' > > > > from (irb):5 > > > > irb(main):006:0> Rjb::import > > > 'junit.framework.Assert' > > > > NoClassDefFoundError: junit/framework/Assert > > > > from (irb):6:in `import' > > > > from (irb):6 > > > > from :0 > > > > > > > > Notice how I'm getting two different errors for > > > the > > > > same invocation of Rjb::import. > > > > > > > > Can you reproduce this bug? > > > > > > > > thanks, > > > > Rich > > > > > > > > ____________________________ > > > > Richard Apodaca > > > > Blog: http://depth-first.com > > > > > > > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > > Sponsored Link > > > > > > > > Don't quit your job - take classes online > > > > www.Classesusa.com > > > > > > > > > > -- > > > arton > > > > > > > > > > > > ____________________________ > > Richard Apodaca > > Blog: http://depth-first.com > > > > > > > > ____________________________________________________________________________________ > > Sponsored Link > > > > $200,000 mortgage for $660/ mo - > > 30/15 yr fixed, reduce debt - > > http://yahoo.ratemarketplace.com > > -- > arton -- arton From rjb-users at rubyforge.org Mon Nov 20 02:48:49 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 16:48:49 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <20061120141108.F0C0.ARTON@e07.itscom.net> References: <20061120135257.F0BD.ARTON@e07.itscom.net> <20061120141108.F0C0.ARTON@e07.itscom.net> Message-ID: <20061120164539.F0C3.ARTON@e07.itscom.net> I made mistake > % export LD_LIBRARY_PATH=/opt/jdk1.5.0_09/jre/lib/amd64/server:/opt/jdk1.5.0_09/jre/lib/amd64 > % export LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so We may not export LD_PRELOAD because it's temporary solution. So please test as : % LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so irb % LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so script/server bye. -- arton From rjb-users at rubyforge.org Mon Nov 20 10:18:16 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 07:18:16 -0800 (PST) Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <20061120141108.F0C0.ARTON@e07.itscom.net> Message-ID: <881321.99107.qm@web34211.mail.mud.yahoo.com> Hi Arton, I tried setting LD_PRELOAD, and it worked! Using the same setup as in my original posting: $ export LD_LIBRARY_PATH=/usr/java/jdk1.5.0_09/jre/lib/amd64:/usr/java/jdk1.5.0_09/jre/lib/amd64/server $ export LD_PRELOAD=/usr/java/jdk1.5.0_09/jre/lib/amd64/libzip.so export CLASSPATH="./junit-3.8.1.jar" $ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rjb' => true irb(main):003:0> require 'rjb' => true irb(main):004:0> Rjb::import 'junit.framework.Assert' => # Many thanks for finding a solution! --- arton wrote: > Hi all > > Please reference > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15762.html > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15763.html > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15764.html > > The conversation was stopped by fail, but my > colleague found setting > LD_PRELOAD is usable in his environment. > So, please test with below. > > % export > LD_LIBRARY_PATH=/opt/jdk1.5.0_09/jre/lib/amd64/server:/opt/jdk1.5.0_09/jre/lib/amd64 > % export > LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so > > Best regards > > On Mon, 20 Nov 2006 14:00:06 +0900 > arton ???? wrote: > > > Hi all > > > > I've got some information about that Amd64 version > of Rjb is crushed in > > java.util.zip.Inflater. And I found Java's rt.jar > was not compressed and > > junit-4.1.jar was compressed. > > So wouldn't you please un-jar and re-jar junit-4.1 > or other jars caused > > InternalError without compression. > > > > Ias, I apologised you that I've forgotten the > Rjb's feature that emits > > the stack-trace of Java'e exception if one sets > $VERBOSE = true. > > > > Regards. > > > > On Sat, 18 Nov 2006 21:15:58 -0800 (PST) > > richard apodaca ???? > wrote: > > > > > Hi Arton, > > > > > > Well, at least we've narrowed it down to my > platform. > > > Was the other user's platform also Linux amd64? > > > > > > $ cat /proc/version > > > Linux version 2.6.17-5mdv > (rtp at ramanujan.mandriva.com) > > > (gcc version 4.1.1 20060724 (prerelease) > (4.1.1-3mdk)) > > > #1 SMP Wed Sep 13 14:28:02 EDT 2006 > > > > > > $ ruby -v > > > ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] > > > > > > $ rails -v > > > Rails 1.1.6 > > > > > > > > > $ java -version > > > java version "1.5.0_09" > > > Java(TM) 2 Runtime Environment, Standard Edition > > > (build 1.5.0_09-b01) > > > Java HotSpot(TM) 64-Bit Server VM (build > 1.5.0_09-b01, > > > mixed mode) > > > > > > > > > --- arton wrote: > > > > > > > Hi, Rich > > > > > > > > I've heard the issue from Ias (CCed with this > mail). > > > > But I couldn't reproduce with Ruby 1.8.5, rjb > 1.0.2, > > > > rails 1.1.6 on > > > > Win32(x86). > > > > By the way, the mailing list is working, I > think. > > > > > > > > irb(main):001:0> require 'rubygems' > > > > => true > > > > irb(main):002:0> require_gem 'rails' > > > > => true > > > > irb(main):003:0> require_gem 'rjb' > > > > => true > > > > irb(main):004:0> require 'rjb' > > > > => true > > > > irb(main):005:0> Rjb::import > > > > 'junit.framework.Assert' > > > > => # > > > > > > > > and on Linux (ruby 1.8.5, rjb 1.0.2, > rails-1.1.6) > > > > > > > > irb(main):001:0> require 'rubygems' > > > > => true > > > > irb(main):002:0> require_gem 'rails' > > > > => true > > > > irb(main):003:0> require_gem 'rjb' > > > > => true > > > > irb(main):004:0> require 'rjb' > > > > => true > > > > irb(main):005:0> Rjb::import > > > > 'jp.co.infoseek.hp.arton.rjbtest.TestBean' > > > > => > > > > > > > > # > > > > irb(main):006:0> exit > > > > > > > > $ cat /proc/version > > > > Linux version 2.4.33-smp (root at coral) (gcc > version > > > > 2.95.4 20011002 (Debian prerelease)) #1 SMP > Tue Oct > > > > 31 15:24:38 JST 2006 > > > > > > > > Both are running with Java 1.5.0_* > > > > > > > > $ java -version > > > > java version "1.5.0_04" > > > > Java(TM) 2 Runtime Environment, Standard > Edition > > > > (build 1.5.0_04-b05) > > > > Java HotSpot(TM) Client VM (build > 1.5.0_04-b05, > > > > mixed mode, sharing) > > > > > > > > C:\home\arton>java -version > > > > java version "1.5.0_09" > > > > Java(TM) 2 Runtime Environment, Standard > Edition > > > > (build 1.5.0_09-b01) > > > > Java HotSpot(TM) Client VM (build > 1.5.0_09-b01, > > > > mixed mode, sharing) > > > > > > > > What is your version of Rails and Java ? > > > > > > > > On Sat, 18 Nov 2006 13:47:10 -0800 (PST) > > > > richard apodaca > ??????s wrote: > > > > > > > > > Hi Arton, > > > > > > > > > > I'm not sure if the rjb mailing list is > working, > > > > so > > > > > I'll send this to you directly. > > > > > > > > > > I am having problems with RJB importing a > class > > > > from a > > > > > jarfile when using Rails. > > > > > > > > > > The following works fine (on Linux amd64): > > > > > > > > > > (1) Create a directory called 'test', and > copy a > > > > > jarfile into it (I'm using Junit > > > > 'junit-3.8.1.jar', > > > > > but any jarfile will do). > > > > > > > > > > (2) export CLASSPATH="./junit-3.8.1.jar" > > > > > > > > > > (3) $ irb > > > > > irb(main):001:0> require 'rubygems' > > > > > => true > > > > > irb(main):002:0> require_gem 'rjb' > > > > > => true > > > > > irb(main):003:0> require 'rjb' > > > > > => true > > > > > irb(main):004:0> Rjb::import > > > > 'junit.framework.Assert' > > > > > => # > > > > > > > > > > So far so good. > > > > > > > > > > But loading Rails first and then the JUnit > class > > > > > fails: > > > > > > > > > > $ irb > > > > > irb(main):001:0> require 'rubygems' > > > > > => true > > > > > irb(main):002:0> require_gem 'rails' > > > > > => true > > > > > irb(main):003:0> require_gem 'rjb' > > > > > => true > > > > > irb(main):004:0> require 'rjb' > > > > > => true > > > > > irb(main):005:0> Rjb::import > > > > 'junit.framework.Assert' > > > > > InternalError: unknown exception > === message truncated === ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $420k for $1,399/mo. Calculate new payment! www.LowerMyBills.com/lre From rjb-users at rubyforge.org Mon Nov 20 10:33:08 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 07:33:08 -0800 (PST) Subject: [rjb-users] Can't find jarfile classes with Rails Message-ID: <596135.7374.qm@web34201.mail.mud.yahoo.com> Hi All, I made a mistake in my test code. It should be: $ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' re=> true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> Rjb::import 'junit.framework.Assert' => # cheers, Rich --- richard apodaca wrote: > Hi Arton, > > I tried setting LD_PRELOAD, and it worked! Using the > same setup as in my original posting: > > $ export > LD_LIBRARY_PATH=/usr/java/jdk1.5.0_09/jre/lib/amd64:/usr/java/jdk1.5.0_09/jre/lib/amd64/server > > $ export > LD_PRELOAD=/usr/java/jdk1.5.0_09/jre/lib/amd64/libzip.so > > export CLASSPATH="./junit-3.8.1.jar" > > $ irb > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require_gem 'rjb' > => true > irb(main):003:0> require 'rjb' > => true > irb(main):004:0> Rjb::import > 'junit.framework.Assert' > => # > > Many thanks for finding a solution! > > --- arton wrote: > > > Hi all > > > > Please reference > > > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15762.html > > > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15763.html > > > http://www.mail-archive.com/java-linux at java.blackdown.org/msg15764.html > > > > The conversation was stopped by fail, but my > > colleague found setting > > LD_PRELOAD is usable in his environment. > > So, please test with below. > > > > % export > > > LD_LIBRARY_PATH=/opt/jdk1.5.0_09/jre/lib/amd64/server:/opt/jdk1.5.0_09/jre/lib/amd64 > > % export > > > LD_PRELOAD=/opt/jdk1.5.0_09/jre/lib/amd64/libzip.so > > > > Best regards > > > > On Mon, 20 Nov 2006 14:00:06 +0900 > > arton ???? wrote: > > > > > Hi all > > > > > > I've got some information about that Amd64 > version > > of Rjb is crushed in > > > java.util.zip.Inflater. And I found Java's > rt.jar > > was not compressed and > > > junit-4.1.jar was compressed. > > > So wouldn't you please un-jar and re-jar > junit-4.1 > > or other jars caused > > > InternalError without compression. > > > > > > Ias, I apologised you that I've forgotten the > > Rjb's feature that emits > > > the stack-trace of Java'e exception if one sets > > $VERBOSE = true. > > > > > > Regards. > > > > > > On Sat, 18 Nov 2006 21:15:58 -0800 (PST) > > > richard apodaca ???? > > wrote: > > > > > > > Hi Arton, > > > > > > > > Well, at least we've narrowed it down to my > > platform. > > > > Was the other user's platform also Linux > amd64? > > > > > > > > $ cat /proc/version > > > > Linux version 2.6.17-5mdv > > (rtp at ramanujan.mandriva.com) > > > > (gcc version 4.1.1 20060724 (prerelease) > > (4.1.1-3mdk)) > > > > #1 SMP Wed Sep 13 14:28:02 EDT 2006 > > > > > > > > $ ruby -v > > > > ruby 1.8.5 (2006-08-25) [x86_64-linux-gnu] > > > > > > > > $ rails -v > > > > Rails 1.1.6 > > > > > > > > > > > > $ java -version > > > > java version "1.5.0_09" > > > > Java(TM) 2 Runtime Environment, Standard > Edition > > > > (build 1.5.0_09-b01) > > > > Java HotSpot(TM) 64-Bit Server VM (build > > 1.5.0_09-b01, > > > > mixed mode) > > > > > > > > > > > > --- arton wrote: > > > > > > > > > Hi, Rich > > > > > > > > > > I've heard the issue from Ias (CCed with > this > > mail). > > > > > But I couldn't reproduce with Ruby 1.8.5, > rjb > > 1.0.2, > > > > > rails 1.1.6 on > > > > > Win32(x86). > > > > > By the way, the mailing list is working, I > > think. > > > > > > > > > > irb(main):001:0> require 'rubygems' > > > > > => true > > > > > irb(main):002:0> require_gem 'rails' > > > > > => true > > > > > irb(main):003:0> require_gem 'rjb' > > > > > => true > > > > > irb(main):004:0> require 'rjb' > > > > > => true > > > > > irb(main):005:0> Rjb::import > > > > > 'junit.framework.Assert' > > > > > => # > > > > > > > > > > and on Linux (ruby 1.8.5, rjb 1.0.2, > > rails-1.1.6) > > > > > > > > > > irb(main):001:0> require 'rubygems' > > > > > => true > > > > > irb(main):002:0> require_gem 'rails' > > > > > => true > > > > > irb(main):003:0> require_gem 'rjb' > > > > > => true > > > > > irb(main):004:0> require 'rjb' > > > > > => true > > > > > irb(main):005:0> Rjb::import > > > > > 'jp.co.infoseek.hp.arton.rjbtest.TestBean' > > > > > => > > > > > > > > > > > > # > > > > > irb(main):006:0> exit > > > > > > > > > > $ cat /proc/version > > > > > Linux version 2.4.33-smp (root at coral) (gcc > > version > > > > > 2.95.4 20011002 (Debian prerelease)) #1 SMP > > Tue Oct > > > > > 31 15:24:38 JST 2006 > > > > > > > > > > Both are running with Java 1.5.0_* > > > > > > > > > > $ java -version > > > > > java version "1.5.0_04" > > > > > Java(TM) 2 Runtime Environment, Standard > > Edition > > > > > (build 1.5.0_04-b05) > > > > > Java HotSpot(TM) Client VM (build > > 1.5.0_04-b05, > > > > > mixed mode, sharing) > > > > > > > > > > C:\home\arton>java -version > > > > > java version "1.5.0_09" > > > > > Java(TM) 2 Runtime Environment, Standard > > Edition > > > > > (build 1.5.0_09-b01) > > > > > Java HotSpot(TM) Client VM (build > > 1.5.0_09-b01, > > > > > mixed mode, sharing) > > > > > > > > > > What is your version of Rails and Java ? > > > > > > > > > > On Sat, 18 Nov 2006 13:47:10 -0800 (PST) > > > > > richard apodaca > > ??????s wrote: > > > > > > > > > > > Hi Arton, > > > > > > > > > > > > I'm not sure if the rjb mailing list is > > working, > > > > > so > > > > > > I'll send this to you directly. > > > > > > > > > > > > I am having problems with RJB importing a > > class > > > > > from a > === message truncated === ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Sponsored Link $420k for $1,399/mo. Think You Pay Too Much For Your Mortgage? Find Out! www.LowerMyBills.com/lre From rjb-users at rubyforge.org Mon Nov 20 14:46:02 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Tue, 21 Nov 2006 04:46:02 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <596135.7374.qm@web34201.mail.mud.yahoo.com> References: <596135.7374.qm@web34201.mail.mud.yahoo.com> Message-ID: <20061121043815.0496.ARTON@e07.itscom.net> Hi All I don't know exactly what module was confliting with libzip.so. But at least rjb's external symbols were very vague. So I've changed the symbols and just released rjb-1.0.3. Wouldn't you please test with this version without setting LD_PRELOAD. If it could work, there's no need to set LD_PRELOAD anymore. But if it couldn't work unfortunately, another shared object is the cause. Sorry for inconvenience. Best regards -- arton From rjb-users at rubyforge.org Mon Nov 20 21:57:50 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Mon, 20 Nov 2006 18:57:50 -0800 (PST) Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <7bce072c0611201848m5d8a4c98h3e44b86a20b1d9f5@mail.gmail.com> Message-ID: <964453.54375.qm@web34211.mail.mud.yahoo.com> --- Changshin Lee wrote: > Hi all, > > First of all, I'd appreciate work from arton and > Richard. Thanks! Welcome, Changshin! Glad to see we have another user. > LD_PRELOAD works with my environment, particularly > ruby 1.8.4 and rjb > 1.0.2 on Ubuntu 6.0.6 (amd64). Unfortunately, I > tested rjb 1.0.3 and > found that it doesn't remove the necessity of > setting LD_PRELOAD. I just tested 1.0.3 it as well, and I'm still getting: $ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' => true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> require 'rjb' => true irb(main):005:0> Rjb::import 'junit.framework.Assert' InternalError: unknown exception from (irb):5:in `import' from (irb):5 But when I use LD_PRELOAD, 1.0.3 still works fine: $ LD_PRELOAD=/usr/java/jdk1.5.0_09/jre/lib/amd64/libzip.so irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require_gem 'rails' re=> true irb(main):003:0> require_gem 'rjb' => true irb(main):004:0> require 'rjb' => true irb(main):005:0> Rjb::import 'junit.framework.Assert' => # > Cheers, > > Ias > > On 11/21/06, arton wrote: > > Hi All > > > > I don't know exactly what module was confliting > with libzip.so. > > But at least rjb's external symbols were very > vague. So I've changed the > > symbols and just released rjb-1.0.3. > > Wouldn't you please test with this version without > setting LD_PRELOAD. > > If it could work, there's no need to set > LD_PRELOAD anymore. But if it > > couldn't work unfortunately, another shared object > is the cause. > > Sorry for inconvenience. > > > > Best regards > > > > -- > > arton > > > > > ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Sponsored Link Mortgage rates near 39yr lows. $510k for $1,698/mo. Calculate new payment! www.LowerMyBills.com/lre From rjb-users at rubyforge.org Tue Nov 21 06:10:06 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Tue, 21 Nov 2006 20:10:06 +0900 Subject: [rjb-users] Can't find jarfile classes with Rails In-Reply-To: <964453.54375.qm@web34211.mail.mud.yahoo.com> References: <7bce072c0611201848m5d8a4c98h3e44b86a20b1d9f5@mail.gmail.com> <964453.54375.qm@web34211.mail.mud.yahoo.com> Message-ID: <20061121195523.0499.ARTON@e07.itscom.net> Hi all, > I just tested 1.0.3 it as well, and I'm still getting: > Unfortunately, I tested rjb 1.0.3 and > found that it doesn't remove the necessity of setting LD_PRELOAD. Thanks for your testing rjb-1.0.3. The problem is caused by Sun's implementation of libzip.so, this shared object exports non-internalized symbols, so dynamic loader (not Java world, it's just C world) miss resolves the functions in the process. And at this time, I have no clue and resolution, so please use LD_PRELOAD carefully. The reason of update for Rjb-1.0.3 is just changing rjb's external symbols as internalize with putting prefix, because I'm afraid of the confliction is triggered by rjb, but unfortunately rjb is not guilty. Thanks -- arton From rjb-users at rubyforge.org Tue Nov 28 21:08:20 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Tue, 28 Nov 2006 18:08:20 -0800 (PST) Subject: [rjb-users] Overloaded Two-Argument Constructors with new_with_sig Message-ID: <865533.51632.qm@web34215.mail.mud.yahoo.com> Hi All, How can I invoke an overloaded two-argument constructor with new_with_sig? I'm trying this (not my actual example, but similar): Foo.new_with_sig('Ljava.lang.String;Ljava.lang.String;', 'hello', 'goodbye') Is this the correct format? thanks, Rich ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com From rjb-users at rubyforge.org Thu Nov 30 09:12:24 2006 From: rjb-users at rubyforge.org (rjb-users at rubyforge.org) Date: Thu, 30 Nov 2006 23:12:24 +0900 Subject: [rjb-users] Overloaded Two-Argument Constructors with new_with_sig In-Reply-To: <865533.51632.qm@web34215.mail.mud.yahoo.com> References: <865533.51632.qm@web34215.mail.mud.yahoo.com> Message-ID: <20061130230831.1103.ARTON@e07.itscom.net> Hi Rich, > I'm trying this (not my actual example, but similar): > > Foo.new_with_sig('Ljava.lang.String;Ljava.lang.String;', > 'hello', 'goodbye') > > Is this the correct format? Yes, this format is correct. Any problem ? -- arton