<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-14107</id>
	<title>Nabble - JRuby - User</title>
	<updated>2009-11-07T17:07:59Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/JRuby---User-f14107.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby---User-f14107.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26250132</id>
	<title>Re: jruby 1.4 CLI vs. embedded syntax difference?</title>
	<published>2009-11-07T17:07:59Z</published>
	<updated>2009-11-07T17:07:59Z</updated>
	<author>
		<name>ed_s</name>
	</author>
	<content type="html">Yoko,
&lt;br&gt;&amp;nbsp; You are correct. I instantiate a Map object in Java and pass it as an argument to the ruby function. I will go ahead and file an issue.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Ed
&lt;br&gt;&lt;br&gt;&lt;quote author=&quot;Yoko Harada&quot;&gt;&lt;br&gt;&amp;gt;From the exception, I guess you created a java.lang.Map type object
&lt;br&gt;&amp;gt;and called Ruby method with that object in its argument. Right?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;This is a Java integration related problem. I think this seems to be a
&lt;br&gt;&amp;gt;bug since Map type object didn't converted to Ruby's Hash. &amp;nbsp;In the
&lt;br&gt;&amp;gt;method, getMaxList, &amp;nbsp;the Java's Map type object was there as a &amp;quot;hash.&amp;quot;
&lt;br&gt;&amp;gt;Because Java's Map and its descendants don't have &amp;quot;each&amp;quot; method, &amp;nbsp;you
&lt;br&gt;&amp;gt;got the error. Would you file this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;-Yoko
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jruby-1.4-CLI-vs.-embedded-syntax-difference--tp26235462p26250132.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26248343</id>
	<title>Re: jruby 1.4 CLI vs. embedded syntax difference?</title>
	<published>2009-11-07T12:35:27Z</published>
	<updated>2009-11-07T12:35:27Z</updated>
	<author>
		<name>Yoko Harada</name>
	</author>
	<content type="html">On Fri, Nov 6, 2009 at 10:07 PM, ed_s &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26248343&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ed_sumitra@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a JRuby script that works fine through the JRuby command line. However
&lt;br&gt;&amp;gt; when I execute the same script in an embedded environment, Tomcat/bsf/jruby,
&lt;br&gt;&amp;gt; I get undefined method errors. Any pointers as to why the script does not
&lt;br&gt;&amp;gt; work in the embedded environment?
&lt;br&gt;&lt;br&gt;From the exception, I guess you created a java.lang.Map type object
&lt;br&gt;and called Ruby method with that object in its argument. Right?
&lt;br&gt;&lt;br&gt;This is a Java integration related problem. I think this seems to be a
&lt;br&gt;bug since Map type object didn't converted to Ruby's Hash. &amp;nbsp;In the
&lt;br&gt;method, getMaxList, &amp;nbsp;the Java's Map type object was there as a &amp;quot;hash.&amp;quot;
&lt;br&gt;Because Java's Map and its descendants don't have &amp;quot;each&amp;quot; method, &amp;nbsp;you
&lt;br&gt;got the error. Would you file this?
&lt;br&gt;&lt;br&gt;-Yoko
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Ed
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; code below works with JRuby CLI but not in embedded JRuby!!!
&lt;br&gt;&amp;gt; MyHash = {&amp;quot;1&amp;quot; =&amp;gt; &amp;quot;One&amp;quot;, &amp;quot;2&amp;quot; =&amp;gt; &amp;quot;Two&amp;quot;, &amp;quot;3&amp;quot; =&amp;gt; &amp;quot;Three&amp;quot;, &amp;quot;4&amp;quot; =&amp;gt; &amp;quot;Four&amp;quot;}
&lt;br&gt;&amp;gt; def getMaxList(hash,num)
&lt;br&gt;&amp;gt;  (num &amp;lt; hash.size) ? hash.values[0..num-1] : hash.values
&lt;br&gt;&amp;gt; end
&lt;br&gt;&amp;gt; puts getMaxList(MyHash,2).inspect
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; need to use the alternate form below instead
&lt;br&gt;&amp;gt; def getMaxList(hash,num)
&lt;br&gt;&amp;gt;  result = []
&lt;br&gt;&amp;gt;  for i in 0..num-1
&lt;br&gt;&amp;gt;    result &amp;lt;&amp;lt; hash[i.to_s]
&lt;br&gt;&amp;gt;  end
&lt;br&gt;&amp;gt;  result
&lt;br&gt;&amp;gt; end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The error I get with the first form of the code  is
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;script&amp;gt;:6:in `getMaxList': undefined method `[]' for
&lt;br&gt;&amp;gt; #&amp;lt;#&amp;lt;Class:01x12e5c94&amp;gt;:0xbffc3a&amp;gt; (NoMethodError)
&lt;br&gt;&amp;gt;        from &amp;lt;script&amp;gt;:4:in `each'
&lt;br&gt;&amp;gt;        from &amp;lt;script&amp;gt;:4:in `getMaxList'
&lt;br&gt;&amp;gt;        from :1
&lt;br&gt;&amp;gt; org.jruby.embed.InvokeFailedException: undefined method `[]' for
&lt;br&gt;&amp;gt; #&amp;lt;#&amp;lt;Class:01x12e5c94&amp;gt;:0xbffc3a&amp;gt;
&lt;br&gt;&amp;gt;        at
&lt;br&gt;&amp;gt; org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.call(EmbedRubyObjectAdapterImpl.java:369)
&lt;br&gt;&amp;gt;        at
&lt;br&gt;&amp;gt; org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.callMethod(EmbedRubyObjectAdapterImpl.java:188)
&lt;br&gt;&amp;gt;        at
&lt;br&gt;&amp;gt; org.jruby.embed.ScriptingContainer.callMethod(ScriptingContainer.java:585)
&lt;br&gt;&amp;gt;        at
&lt;br&gt;&amp;gt; org.jruby.embed.jsr223.JRubyEngine.invokeFunction(JRubyEngine.java:278)
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: &lt;a href=&quot;http://old.nabble.com/jruby-1.4-CLI-vs.-embedded-syntax-difference--tp26235462p26235462.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/jruby-1.4-CLI-vs.-embedded-syntax-difference--tp26235462p26235462.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the JRuby - User mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jruby-1.4-CLI-vs.-embedded-syntax-difference--tp26235462p26248343.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26244010</id>
	<title>Raising Native Exceptions</title>
	<published>2009-11-07T03:43:20Z</published>
	<updated>2009-11-07T03:43:20Z</updated>
	<author>
		<name>Fouad Mardini</name>
	</author>
	<content type="html">&lt;div dir=&quot;ltr&quot;&gt;Hello,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;I am having an issue with raising java exceptions from ruby&lt;/div&gt;&lt;div&gt;Googling around I found this &lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-1615&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-1615&lt;/a&gt; which would suggest the issue was solved&lt;/div&gt;

&lt;div&gt;I am running jruby right out of git (branch jruby-1_4)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Boils down to this:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;require &amp;#39;java&amp;#39;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;begin&lt;/div&gt;&lt;div&gt;  raise java.lang.Exception.new(&amp;quot;Hello&amp;quot;)&lt;/div&gt;

&lt;div&gt;  # raise Exception.new(&amp;quot;Hello&amp;quot;)&lt;/div&gt;&lt;div&gt;rescue Object =&amp;gt; e&lt;/div&gt;&lt;div&gt;  puts e.to_s&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks for any pointers :)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;--&lt;br&gt;


&lt;/div&gt;&lt;div&gt;Fouad Mardini&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Raising-Native-Exceptions-tp26244010p26244010.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235462</id>
	<title>jruby 1.4 CLI vs. embedded syntax difference?</title>
	<published>2009-11-06T19:07:10Z</published>
	<updated>2009-11-06T19:07:10Z</updated>
	<author>
		<name>ed_s</name>
	</author>
	<content type="html">I have a JRuby script that works fine through the JRuby command line. However when I execute the same script in an embedded environment, Tomcat/bsf/jruby, I get undefined method errors. Any pointers as to why the script does not work in the embedded environment?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Ed
&lt;br&gt;&lt;br&gt;code below works with JRuby CLI but not in embedded JRuby!!!
&lt;br&gt;MyHash = {&amp;quot;1&amp;quot; =&amp;gt; &amp;quot;One&amp;quot;, &amp;quot;2&amp;quot; =&amp;gt; &amp;quot;Two&amp;quot;, &amp;quot;3&amp;quot; =&amp;gt; &amp;quot;Three&amp;quot;, &amp;quot;4&amp;quot; =&amp;gt; &amp;quot;Four&amp;quot;}
&lt;br&gt;def getMaxList(hash,num)
&lt;br&gt;&amp;nbsp; (num &amp;lt; hash.size) ? hash.values[0..num-1] : hash.values
&lt;br&gt;end
&lt;br&gt;puts getMaxList(MyHash,2).inspect
&lt;br&gt;&lt;br&gt;need to use the alternate form below instead
&lt;br&gt;def getMaxList(hash,num)
&lt;br&gt;&amp;nbsp; result = []
&lt;br&gt;&amp;nbsp; for i in 0..num-1
&lt;br&gt;&amp;nbsp; &amp;nbsp; result &amp;lt;&amp;lt; hash[i.to_s]
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;&amp;nbsp; result
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;The error I get with the first form of the code &amp;nbsp;is
&lt;br&gt;&lt;br&gt;&amp;lt;script&amp;gt;:6:in `getMaxList': undefined method `[]' for #&amp;lt;#&amp;lt;Class:01x12e5c94&amp;gt;:0xbffc3a&amp;gt; (NoMethodError)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;lt;script&amp;gt;:4:in `each'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;lt;script&amp;gt;:4:in `getMaxList'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from :1
&lt;br&gt;org.jruby.embed.InvokeFailedException: undefined method `[]' for #&amp;lt;#&amp;lt;Class:01x12e5c94&amp;gt;:0xbffc3a&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.call(EmbedRubyObjectAdapterImpl.java:369)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.callMethod(EmbedRubyObjectAdapterImpl.java:188)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.jruby.embed.ScriptingContainer.callMethod(ScriptingContainer.java:585)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.jruby.embed.jsr223.JRubyEngine.invokeFunction(JRubyEngine.java:278) </content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jruby-1.4-CLI-vs.-embedded-syntax-difference--tp26235462p26235462.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26237210</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T11:11:47Z</published>
	<updated>2009-11-06T11:11:47Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">G N wrote:
&lt;br&gt;&amp;gt; Mate, did you set that RUBYOPT explicitly or was it set by default by
&lt;br&gt;&amp;gt; Windows installer?
&lt;br&gt;I setted nothing, I am newbie. :)
&lt;br&gt;&lt;br&gt;&amp;gt; I guess the other idea for better startup performance: NailGun
&lt;br&gt;&amp;gt; Have only checked with 1.3, but most probably works with 1.4 too:
&lt;br&gt;With NailGun JRuby crashes if I started it from console (&amp;quot;cmd&amp;quot;) or from 
&lt;br&gt;a batch script. (SocketException: Connection reset) It starts up in 1.0 
&lt;br&gt;second if I run it from a Perl script.
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26237210.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236634</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T10:34:11Z</published>
	<updated>2009-11-06T10:34:11Z</updated>
	<author>
		<name>gin</name>
	</author>
	<content type="html">Cheers for that, Vladimir.
&lt;br&gt;&lt;br&gt;Mate, did you set that RUBYOPT explicitly or was it set by default by
&lt;br&gt;Windows installer?
&lt;br&gt;IMHO, if it causes unexpected delays, should we have it off by
&lt;br&gt;default? Or, have some more direct way to turn it off? For example,
&lt;br&gt;--fast option or a new startup script 'jruby-lite' which would
&lt;br&gt;optimise for one liners and simple scripts.
&lt;br&gt;&lt;br&gt;I guess the other idea for better startup performance: NailGun
&lt;br&gt;(&lt;a href=&quot;http://kenai.com/projects/jruby/pages/JRubyWithNailgun&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kenai.com/projects/jruby/pages/JRubyWithNailgun&lt;/a&gt;)
&lt;br&gt;Have only checked with 1.3, but most probably works with 1.4 too:
&lt;br&gt;$jruby --ng-server
&lt;br&gt;Then
&lt;br&gt;$jruby --ng
&lt;br&gt;should be lightning fast.
&lt;br&gt;&lt;br&gt;Also, -that default- JRUBY_HOME setting- caused me some grief on
&lt;br&gt;Windows, when running on Eclipse OSGI (an extra ~15sec delay, fixed by
&lt;br&gt;explicitly setting it).
&lt;br&gt;&lt;br&gt;Good luck,
&lt;br&gt;Gergo
&lt;br&gt;&lt;br&gt;2009/11/6 Rob Heittman &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236634&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rob.heittman@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; That's a huge win.  Awesome tip.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Nov 6, 2009, at 11:56 AM, Vladimir Sizikov &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236634&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;vsizikov@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Please double check that you don't have %RUBYOPT% set, and you don't
&lt;br&gt;&amp;gt;&amp;gt; load rubygems by default.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Your fib benchmark shows pretty good numbers for JRuby, compared to MRI.
&lt;br&gt;&amp;gt;&amp;gt; :)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;&amp;gt;  --Vladimir
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Fri, Nov 6, 2009 at 5:16 PM, Máté Farkas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236634&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is it normal that printing &amp;quot;1&amp;quot; requires more than five second? Sorry my
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; english.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I am new to ruby, currently I use PHP and Perl in Windows, but I don't
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; like PHP and Perl is not 100% compatible to Windows (nor Ruby, as I
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; see). I have found JRuby which claimed itself fully cross-platform. I
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; tried it, but it starts very-very slow. I have AMD 64 3000+, 1 Gb DDR,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Windows7, Java 6u17.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26236634.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236164</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T10:06:04Z</published>
	<updated>2009-11-06T10:06:04Z</updated>
	<author>
		<name>Rob Heittman</name>
	</author>
	<content type="html">That's a huge win. &amp;nbsp;Awesome tip.
&lt;br&gt;&lt;br&gt;On Nov 6, 2009, at 11:56 AM, Vladimir Sizikov &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236164&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;vsizikov@...&lt;/a&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Please double check that you don't have %RUBYOPT% set, and you don't
&lt;br&gt;&amp;gt; load rubygems by default.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Your fib benchmark shows pretty good numbers for JRuby, compared to &amp;nbsp;
&lt;br&gt;&amp;gt; MRI. :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; &amp;nbsp;--Vladimir
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 6, 2009 at 5:16 PM, Máté Farkas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26236164&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; w 
&lt;br&gt;&amp;gt; rote:
&lt;br&gt;&amp;gt;&amp;gt; Is it normal that printing &amp;quot;1&amp;quot; requires more than five second? &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Sorry my
&lt;br&gt;&amp;gt;&amp;gt; english.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I am new to ruby, currently I use PHP and Perl in Windows, but I &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; don't
&lt;br&gt;&amp;gt;&amp;gt; like PHP and Perl is not 100% compatible to Windows (nor Ruby, as I
&lt;br&gt;&amp;gt;&amp;gt; see). I have found JRuby which claimed itself fully cross-platform. I
&lt;br&gt;&amp;gt;&amp;gt; tried it, but it starts very-very slow. I have AMD 64 3000+, 1 Gb &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; DDR,
&lt;br&gt;&amp;gt;&amp;gt; Windows7, Java 6u17.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26236164.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26236047</id>
	<title>Re: auto test for maven?</title>
	<published>2009-11-06T09:56:04Z</published>
	<updated>2009-11-06T09:56:04Z</updated>
	<author>
		<name>Steven Parkes</name>
	</author>
	<content type="html">&lt;br&gt;On Nov 6, 2009, at Nov 6,8:55 AM , Nick Sieger wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I actually don't know of any, and when I found autotest in Ruby I
&lt;br&gt;&amp;gt; always wondered why nothing similar had been done for Java. You might
&lt;br&gt;&amp;gt; try using a Ruby library like directory_watcher and just have it
&lt;br&gt;&amp;gt; re-run maven when files change.
&lt;br&gt;&lt;br&gt;There's also the watchr gem. A number of watcher-like gems ... too &amp;nbsp;
&lt;br&gt;many, at least from the perspective of trying to build momentum.
&lt;br&gt;&lt;br&gt;I've been thinking about the same issues re: integration with the &amp;nbsp;
&lt;br&gt;build tools. autotest was kind of a revelation when it came to ease of &amp;nbsp;
&lt;br&gt;testing. But that's just the beginning. What about building HTML from &amp;nbsp;
&lt;br&gt;Haml or CSS from Sass (just a couple of my itches). Or compiling .o's &amp;nbsp;
&lt;br&gt;or .class's. Basically, everything our build tools do, whether they're &amp;nbsp;
&lt;br&gt;maven, or ant, or rake, or make. Why shouldn't those be more event &amp;nbsp;
&lt;br&gt;driven? Coming from autotest, the batch mode feels archaic and annoying.
&lt;br&gt;&lt;br&gt;I suppose the IDEs have mitigated some of these issues, for &amp;nbsp;
&lt;br&gt;environments/users where they're used. But lots of non-IDE things &amp;nbsp;
&lt;br&gt;naturally fit this, too.
&lt;br&gt;&lt;br&gt;But, of course, those build tools aren't structured like that. I find &amp;nbsp;
&lt;br&gt;it a very interesting idea.
&lt;br&gt;&lt;br&gt;In my own experiments, when you do start down this path, things get a &amp;nbsp;
&lt;br&gt;little tricky, quickly, with regard to dependences. Even autotest &amp;nbsp;
&lt;br&gt;doesn't do a particularly good job at this. The problem isn't &amp;nbsp;
&lt;br&gt;implementing dependences, but discovering them. gcc was great with, -M &amp;nbsp;
&lt;br&gt;was it? And I had a whole environment that used jikes just for -M. But &amp;nbsp;
&lt;br&gt;it seems like the cases where dependences are detected and &amp;nbsp;
&lt;br&gt;externalized are the very rare exception. Hierarchical/multiple-pass &amp;nbsp;
&lt;br&gt;makes are equally ubiquitous and evil.
&lt;br&gt;&lt;br&gt;Ah, well, enough of my soap-box. Sorry.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/auto-test-for-maven--tp26234973p26236047.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235983</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T09:52:26Z</published>
	<updated>2009-11-06T09:52:26Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Vladimir Sizikov wrote:
&lt;br&gt;&amp;gt; Please double check that you don't have %RUBYOPT% set, and you don't
&lt;br&gt;&amp;gt; load rubygems by default.
&lt;br&gt;Dear Vladimir!
&lt;br&gt;&lt;br&gt;Thanks, I deleted this value and it's startup is 1.8 sec now.
&lt;br&gt;I didn't checked anything, just installed it and I did would like to try 
&lt;br&gt;(and learn) Ruby, but I became terrified. (Sorry my english)
&lt;br&gt;&lt;br&gt;Thank you for your help again!
&lt;br&gt;&lt;br&gt;Best Wishes,
&lt;br&gt;Máté (from Hungary)
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26235983.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235227</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T08:56:17Z</published>
	<updated>2009-11-06T08:56:17Z</updated>
	<author>
		<name>Vladimir Sizikov-2</name>
	</author>
	<content type="html">Hi &amp;nbsp;Máté,
&lt;br&gt;&lt;br&gt;Your results are very atypical. I also run JRuby every day on Windows
&lt;br&gt;7, and JRuby's startup is around 0.5 sec for me, which is not that bad
&lt;br&gt;for JVM-based language.
&lt;br&gt;&lt;br&gt;Please double check that you don't have %RUBYOPT% set, and you don't
&lt;br&gt;load rubygems by default.
&lt;br&gt;&lt;br&gt;Your fib benchmark shows pretty good numbers for JRuby, compared to MRI. :)
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&amp;nbsp; --Vladimir
&lt;br&gt;&lt;br&gt;On Fri, Nov 6, 2009 at 5:16 PM, Máté Farkas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235227&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Is it normal that printing &amp;quot;1&amp;quot; requires more than five second? Sorry my
&lt;br&gt;&amp;gt; english.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am new to ruby, currently I use PHP and Perl in Windows, but I don't
&lt;br&gt;&amp;gt; like PHP and Perl is not 100% compatible to Windows (nor Ruby, as I
&lt;br&gt;&amp;gt; see). I have found JRuby which claimed itself fully cross-platform. I
&lt;br&gt;&amp;gt; tried it, but it starts very-very slow. I have AMD 64 3000+, 1 Gb DDR,
&lt;br&gt;&amp;gt; Windows7, Java 6u17.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26235227.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235219</id>
	<title>Re: auto test for maven?</title>
	<published>2009-11-06T08:55:48Z</published>
	<updated>2009-11-06T08:55:48Z</updated>
	<author>
		<name>Nick Sieger-2</name>
	</author>
	<content type="html">On Fri, Nov 6, 2009 at 10:40 AM, Roger Pack &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235219&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Not actually a ruby related question, but does anybody know the
&lt;br&gt;&amp;gt; equivalent of auto test for a maven based java project?
&lt;br&gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt; -r
&lt;br&gt;&lt;br&gt;I actually don't know of any, and when I found autotest in Ruby I
&lt;br&gt;always wondered why nothing similar had been done for Java. You might
&lt;br&gt;try using a Ruby library like directory_watcher and just have it
&lt;br&gt;re-run maven when files change.
&lt;br&gt;&lt;br&gt;/Nick
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/auto-test-for-maven--tp26234973p26235219.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26235148</id>
	<title>Re: JRuby startup very slow on Win7</title>
	<published>2009-11-06T08:51:20Z</published>
	<updated>2009-11-06T08:51:20Z</updated>
	<author>
		<name>Rob Heittman</name>
	</author>
	<content type="html">The Java virtual machine can take a while to start up, as it&amp;#39;s doing quite a lot (like booting a small virtual computer every time you start it).  This is no problem for long running programs like a web server, but you will certainly notice it when you run a short script like &amp;quot;puts 1&amp;quot; from the command line.  All JVM based languages have this startup time issue.  This is the trade off for running inside the portable JVM environment.&lt;div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I think the problem would be less severe if you had more memory available.  I notice much worse Java startup times at only 1Gb in Windows.  At 2Gb it still is not instantaneous, but it seldom needs to reallocate and swap in order to get the JVM running.  Understand that even on a server machine with many GB of memory and powerful CPU, &amp;quot;jruby -e &amp;#39;puts 1&amp;#39;&amp;quot; still takes a second or so, while &amp;quot;ruby -e &amp;#39;puts 1&amp;#39;&amp;quot; takes only a few ms.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- Rob&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Nov 6, 2009 at 11:16 AM, Máté Farkas &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26235148&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
Is it normal that printing &amp;quot;1&amp;quot; requires more than five second? Sorry my&lt;br&gt;
english.&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26235148.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26234973</id>
	<title>auto test for maven?</title>
	<published>2009-11-06T08:40:16Z</published>
	<updated>2009-11-06T08:40:16Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Not actually a ruby related question, but does anybody know the
&lt;br&gt;equivalent of auto test for a maven based java project?
&lt;br&gt;Thanks!
&lt;br&gt;-r
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/auto-test-for-maven--tp26234973p26234973.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26234611</id>
	<title>JRuby startup very slow on Win7</title>
	<published>2009-11-06T08:16:42Z</published>
	<updated>2009-11-06T08:16:42Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Is it normal that printing &amp;quot;1&amp;quot; requires more than five second? Sorry my
&lt;br&gt;english.
&lt;br&gt;&lt;br&gt;I am new to ruby, currently I use PHP and Perl in Windows, but I don't
&lt;br&gt;like PHP and Perl is not 100% compatible to Windows (nor Ruby, as I
&lt;br&gt;see). I have found JRuby which claimed itself fully cross-platform. I
&lt;br&gt;tried it, but it starts very-very slow. I have AMD 64 3000+, 1 Gb DDR,
&lt;br&gt;Windows7, Java 6u17.
&lt;br&gt;&lt;br&gt;I have created a simple test (as I seen here:
&lt;br&gt;&lt;a href=&quot;http://www.ruby-forum.com/topic/164191):&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/topic/164191):&lt;/a&gt;&amp;nbsp;I runned the programs ten times
&lt;br&gt;and get the average run time. Here are the results (in seconds):
&lt;br&gt;&lt;br&gt;0.1 perl -e &amp;quot;print 1&amp;quot;
&lt;br&gt;0.1 ruby-1.9 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;0.2 php -r &amp;quot;print(1);&amp;quot;
&lt;br&gt;0.5 ruby-1.8 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;1.9 jruby-1.2.0 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;2.1 jruby-1.3.1 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;5.6 jruby-1.4 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;5.3 jruby-1.4 --1.9 -e &amp;quot;puts 1&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;*********************************************
&lt;br&gt;Content of t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;require 'benchmark'
&lt;br&gt;&lt;br&gt;def fib_ruby(n)
&lt;br&gt;&amp;nbsp; &amp;nbsp;if n &amp;lt; 2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;n
&lt;br&gt;&amp;nbsp; &amp;nbsp;else
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;fib_ruby(n - 2) + fib_ruby(n - 1)
&lt;br&gt;&amp;nbsp; &amp;nbsp;end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;TIMES = (ARGV[0] || 5).to_i
&lt;br&gt;N = (ARGV[1] || 30).to_i
&lt;br&gt;TIMES.times {
&lt;br&gt;&amp;nbsp; &amp;nbsp;puts Benchmark.measure { fib_ruby(N) }
&lt;br&gt;}
&lt;br&gt;*********************************************
&lt;br&gt;c:\Programs\ruby\bin\ruby.exe t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 4.172000 &amp;nbsp; 0.000000 &amp;nbsp; 4.172000 ( &amp;nbsp;4.934000)
&lt;br&gt;&amp;nbsp; 4.265000 &amp;nbsp; 0.000000 &amp;nbsp; 4.265000 ( &amp;nbsp;5.245000)
&lt;br&gt;&amp;nbsp; 4.203000 &amp;nbsp; 0.000000 &amp;nbsp; 4.203000 ( &amp;nbsp;5.141000)
&lt;br&gt;&amp;nbsp; 4.250000 &amp;nbsp; 0.000000 &amp;nbsp; 4.250000 ( &amp;nbsp;4.943000)
&lt;br&gt;&amp;nbsp; 4.141000 &amp;nbsp; 0.000000 &amp;nbsp; 4.141000 ( &amp;nbsp;4.924000)
&lt;br&gt;*********************************************
&lt;br&gt;t:\ruby-1.9\bin\ruby.exe t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 2.328000 &amp;nbsp; 0.000000 &amp;nbsp; 2.328000 ( &amp;nbsp;2.992187)
&lt;br&gt;&amp;nbsp; 2.391000 &amp;nbsp; 0.000000 &amp;nbsp; 2.391000 ( &amp;nbsp;2.759766)
&lt;br&gt;&amp;nbsp; 2.328000 &amp;nbsp; 0.000000 &amp;nbsp; 2.328000 ( &amp;nbsp;2.704102)
&lt;br&gt;&amp;nbsp; 2.375000 &amp;nbsp; 0.000000 &amp;nbsp; 2.375000 ( &amp;nbsp;2.836914)
&lt;br&gt;&amp;nbsp; 2.406000 &amp;nbsp; 0.000000 &amp;nbsp; 2.406000 ( &amp;nbsp;2.768555)
&lt;br&gt;*********************************************
&lt;br&gt;t:\jruby-1.2.0\bin\jruby.bat t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 1.340000 &amp;nbsp; 0.000000 &amp;nbsp; 1.340000 ( &amp;nbsp;1.259000)
&lt;br&gt;&amp;nbsp; 1.176000 &amp;nbsp; 0.000000 &amp;nbsp; 1.176000 ( &amp;nbsp;1.178000)
&lt;br&gt;&amp;nbsp; 1.167000 &amp;nbsp; 0.000000 &amp;nbsp; 1.167000 ( &amp;nbsp;1.167000)
&lt;br&gt;&amp;nbsp; 1.193000 &amp;nbsp; 0.000000 &amp;nbsp; 1.193000 ( &amp;nbsp;1.193000)
&lt;br&gt;&amp;nbsp; 1.177000 &amp;nbsp; 0.000000 &amp;nbsp; 1.177000 ( &amp;nbsp;1.176000)
&lt;br&gt;*********************************************
&lt;br&gt;t:\jruby-1.3.1\bin\jruby.bat t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 1.409000 &amp;nbsp; 0.000000 &amp;nbsp; 1.409000 ( &amp;nbsp;1.305000)
&lt;br&gt;&amp;nbsp; 1.218000 &amp;nbsp; 0.000000 &amp;nbsp; 1.218000 ( &amp;nbsp;1.217000)
&lt;br&gt;&amp;nbsp; 1.210000 &amp;nbsp; 0.000000 &amp;nbsp; 1.210000 ( &amp;nbsp;1.209000)
&lt;br&gt;&amp;nbsp; 1.181000 &amp;nbsp; 0.000000 &amp;nbsp; 1.181000 ( &amp;nbsp;1.181000)
&lt;br&gt;&amp;nbsp; 1.191000 &amp;nbsp; 0.000000 &amp;nbsp; 1.191000 ( &amp;nbsp;1.191000)
&lt;br&gt;*********************************************
&lt;br&gt;c:\Programs\jruby-1.4\bin\jruby.exe t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 1.303000 &amp;nbsp; 0.000000 &amp;nbsp; 1.303000 ( &amp;nbsp;1.302000)
&lt;br&gt;&amp;nbsp; 1.289000 &amp;nbsp; 0.000000 &amp;nbsp; 1.289000 ( &amp;nbsp;1.290000)
&lt;br&gt;&amp;nbsp; 1.280000 &amp;nbsp; 0.000000 &amp;nbsp; 1.280000 ( &amp;nbsp;1.281000)
&lt;br&gt;&amp;nbsp; 1.296000 &amp;nbsp; 0.000000 &amp;nbsp; 1.296000 ( &amp;nbsp;1.296000)
&lt;br&gt;&amp;nbsp; 1.263000 &amp;nbsp; 0.000000 &amp;nbsp; 1.263000 ( &amp;nbsp;1.263000)
&lt;br&gt;*********************************************
&lt;br&gt;c:\Programs\jruby-1.4\bin\jruby.exe --1.9 t:\benchmark.rb
&lt;br&gt;*********************************************
&lt;br&gt;&amp;nbsp; 3.260000 &amp;nbsp; 0.000000 &amp;nbsp; 3.260000 ( &amp;nbsp;3.261000)
&lt;br&gt;&amp;nbsp; 3.224000 &amp;nbsp; 0.000000 &amp;nbsp; 3.224000 ( &amp;nbsp;3.224000)
&lt;br&gt;&amp;nbsp; 3.212000 &amp;nbsp; 0.000000 &amp;nbsp; 3.212000 ( &amp;nbsp;3.212000)
&lt;br&gt;&amp;nbsp; 3.155000 &amp;nbsp; 0.000000 &amp;nbsp; 3.155000 ( &amp;nbsp;3.153000)
&lt;br&gt;&amp;nbsp; 3.231000 &amp;nbsp; 0.000000 &amp;nbsp; 3.231000 ( &amp;nbsp;3.232000)
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JRuby-startup-very-slow-on-Win7-tp26234611p26234611.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26233990</id>
	<title>Re: Managing (start/stop) a JRuby application from a  Servlet</title>
	<published>2009-11-06T07:31:54Z</published>
	<updated>2009-11-06T07:31:54Z</updated>
	<author>
		<name>ben.christenson</name>
	</author>
	<content type="html">Spectacular Nick.  That is exactly what was occurring.  I got tripped up by inspecting the jar with a GUI tool instead of &amp;#39;jar -tf&amp;#39;.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-weight: bold;&quot;&gt;Ben Christenson&lt;/span&gt;&lt;/font&gt;&lt;br&gt;
&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Developer/Analyst&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;/span&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt;


Kinetic Data, Inc.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-style: italic;&quot;&gt;&amp;quot;Building a Better Service Experience&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt;


&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;2&quot;&gt;&lt;br&gt;&lt;font size=&quot;1&quot;&gt;651.556.0937&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;1&quot;&gt;  &lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;I&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 102, 0);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: rgb(204, 102, 0);&quot;&gt;www.kineticdata.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;


&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Nov 5, 2009 at 9:14 PM, Nick Sieger &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26233990&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
On Thu, Nov 5, 2009 at 5:16 PM, Benjamin Christenson&lt;br&gt;
&lt;div class=&quot;im&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26233990&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ben.christenson@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&amp;gt; Hey guys,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Well with the release of 1.4 and some embedded code hacking I have pretty&lt;br&gt;
&amp;gt; much resolved the problem.  A few niceties came up during the process that I&lt;br&gt;
&amp;gt; am interested in feedback on.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; First, we have quite a few jar files (and a jar file for gems leveraging the&lt;br&gt;
&amp;gt; gems-in-a-jar strategy).  Right now Jruby does not support loading scripts&lt;br&gt;
&amp;gt; from jars within other jars (&lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-3299&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-3299&lt;/a&gt;).&lt;br&gt;
&amp;gt; Is there a plan to address this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Also, for embedded Jruby, it looks like __FILE__ does not work when&lt;br&gt;
&amp;gt; executing scripts from the classpath.  It just returns the base file name&lt;br&gt;
&amp;gt; (without the location within the jar file it is in).  I think I saw a thread&lt;br&gt;
&amp;gt; about this already on the list, but I wanted to verify that this is&lt;br&gt;
&amp;gt; unexpected behavior.  If so, are there any known workarounds?  We got around&lt;br&gt;
&amp;gt; it by finding the file using the java classloader and then modifying our&lt;br&gt;
&amp;gt; init scripts to append the jar file manually.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Lastly, there are a few idiosyncrasies that I don&amp;#39;t quite understand:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It is possible to check if a jar file contains a specified file, but it&lt;br&gt;
&amp;gt; doesn&amp;#39;t look like it is possible to check if a jar file contains a directory&lt;br&gt;
&amp;gt; (see below).  Is that expected behavior?&lt;br&gt;
&amp;gt;   File.exist?(&amp;quot;file:/C:/my.jar!/directory/file.txt&amp;quot;) # true&lt;br&gt;
&amp;gt;   File.exist?(&amp;quot;file:/C:/my.jar!/directory&amp;quot;) # false&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Also, Dir.glob with wildcards does not seem to work within jar files (see&lt;br&gt;
&amp;gt; below).  Is that expected behavior?&lt;br&gt;
&amp;gt;   Dir[&amp;quot;file:/C:/my.jar!/*&amp;quot;] # []&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;Make sure you build your jar files with directory entries; otherwise&lt;br&gt;
neither of the above will work (File.exist? or File.directory? or Dir&lt;br&gt;
glob in jars).&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
/Nick&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Managing-%28start-stop%29-a-JRuby-application-from-a-Servlet-tp25373867p26233990.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26227532</id>
	<title>Re: Setting java.library.path in JRuby</title>
	<published>2009-11-05T22:35:13Z</published>
	<updated>2009-11-05T22:35:13Z</updated>
	<author>
		<name>Antti Karanta</name>
	</author>
	<content type="html">&lt;br&gt;On Wed, 04 Nov 2009 18:43:21 +0200, Simon Chiang &amp;nbsp;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26227532&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;simon.a.chiang@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; So how can I set java.library.path within my script so I don't need the
&lt;br&gt;&amp;gt; command line flag?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;I don't think you can. Like many other system properties (e.g. &amp;nbsp;
&lt;br&gt;java.class.path), the jvm copies the value at startup and ignores any &amp;nbsp;
&lt;br&gt;changes thereafter. There's nothing jruby can do about it.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; No luck so far. &amp;nbsp;Any ideas? &amp;nbsp;Thanks.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;These things come to mind:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Add the folder containing the native library to PATH (if on windows) or &amp;nbsp;
&lt;br&gt;to LD_LIBRARY_PATH (e.g. linux, solaris) before launching your script.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Make a short shell script to launch your script.
&lt;br&gt;&amp;nbsp; &amp;nbsp;As a variation of this, you could make your ruby script spawn a copy of &amp;nbsp;
&lt;br&gt;itself in a new process if it notices java.library.path does not contain &amp;nbsp;
&lt;br&gt;the folder you want (setting java.library.path correctly for the new &amp;nbsp;
&lt;br&gt;process, naturally). Note that there are some subtleties about launching a &amp;nbsp;
&lt;br&gt;new jruby process from jruby (IIRC there's an optimization that prevents a &amp;nbsp;
&lt;br&gt;new process from being created and instead runs the script in the same &amp;nbsp;
&lt;br&gt;process) - others more knowledgeable can comment more on this.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;::Antti::
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Setting-java.library.path-in-JRuby-tp26199925p26227532.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26226292</id>
	<title>Re: Managing (start/stop) a JRuby application from a  Servlet</title>
	<published>2009-11-05T19:14:46Z</published>
	<updated>2009-11-05T19:14:46Z</updated>
	<author>
		<name>Nick Sieger-2</name>
	</author>
	<content type="html">On Thu, Nov 5, 2009 at 5:16 PM, Benjamin Christenson
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26226292&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ben.christenson@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hey guys,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Well with the release of 1.4 and some embedded code hacking I have pretty
&lt;br&gt;&amp;gt; much resolved the problem.  A few niceties came up during the process that I
&lt;br&gt;&amp;gt; am interested in feedback on.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; First, we have quite a few jar files (and a jar file for gems leveraging the
&lt;br&gt;&amp;gt; gems-in-a-jar strategy).  Right now Jruby does not support loading scripts
&lt;br&gt;&amp;gt; from jars within other jars (&lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-3299&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-3299&lt;/a&gt;).
&lt;br&gt;&amp;gt; Is there a plan to address this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also, for embedded Jruby, it looks like __FILE__ does not work when
&lt;br&gt;&amp;gt; executing scripts from the classpath.  It just returns the base file name
&lt;br&gt;&amp;gt; (without the location within the jar file it is in).  I think I saw a thread
&lt;br&gt;&amp;gt; about this already on the list, but I wanted to verify that this is
&lt;br&gt;&amp;gt; unexpected behavior.  If so, are there any known workarounds?  We got around
&lt;br&gt;&amp;gt; it by finding the file using the java classloader and then modifying our
&lt;br&gt;&amp;gt; init scripts to append the jar file manually.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Lastly, there are a few idiosyncrasies that I don't quite understand:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It is possible to check if a jar file contains a specified file, but it
&lt;br&gt;&amp;gt; doesn't look like it is possible to check if a jar file contains a directory
&lt;br&gt;&amp;gt; (see below).  Is that expected behavior?
&lt;br&gt;&amp;gt;   File.exist?(&amp;quot;file:/C:/my.jar!/directory/file.txt&amp;quot;) # true
&lt;br&gt;&amp;gt;   File.exist?(&amp;quot;file:/C:/my.jar!/directory&amp;quot;) # false
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also, Dir.glob with wildcards does not seem to work within jar files (see
&lt;br&gt;&amp;gt; below).  Is that expected behavior?
&lt;br&gt;&amp;gt;   Dir[&amp;quot;file:/C:/my.jar!/*&amp;quot;] # []
&lt;/div&gt;&lt;br&gt;Make sure you build your jar files with directory entries; otherwise
&lt;br&gt;neither of the above will work (File.exist? or File.directory? or Dir
&lt;br&gt;glob in jars).
&lt;br&gt;&lt;br&gt;/Nick
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Managing-%28start-stop%29-a-JRuby-application-from-a-Servlet-tp25373867p26226292.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26225995</id>
	<title>Re: DRY up issues</title>
	<published>2009-11-05T18:33:38Z</published>
	<updated>2009-11-05T18:33:38Z</updated>
	<author>
		<name>Nick Sieger-2</name>
	</author>
	<content type="html">Issues and wiki are disabled. Left info out of the readme, as
&lt;br&gt;jruby.org contains all that.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;/Nick
&lt;br&gt;&lt;br&gt;On Thu, Nov 5, 2009 at 9:31 AM, Roger Pack &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225995&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Might be nice to disable the issues on
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://github.com/jruby/jruby&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/jruby/jruby&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; and provide a link to the JIRA in the README file
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; for us githubbers to not get confused :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt; -r
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/DRY-up-issues-tp26216868p26225995.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26225698</id>
	<title>Re: Load path issues inside jar / external app</title>
	<published>2009-11-05T18:02:14Z</published>
	<updated>2009-11-05T18:02:14Z</updated>
	<author>
		<name>steve_molitor</name>
	</author>
	<content type="html">Thanks for the help.  That got me further but I&amp;#39;ve hit another snag that has me really confused.  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Background:  I&amp;#39;m running ruby code that uses activerecord against MsSql inside a jar that is loaded inside a spring application.  I&amp;#39;m using a spring dynamic language jruby bean, which kicks everything off.  I&amp;#39;ve removed the jdbc_adapter_internal.jar from within the jdbc_adapter gem and replaced it with an empty jdbc_adapter_internal.rb.  My ruby code and gems (minus jars in the gems) are jarred up.  This is all running inside tomcat in a WAR, and I put jdbc_adapter_internal.jar and my_ruby_code_with_gem.jar under WEB-INF/lib in the war.&lt;div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Problem:  I&amp;#39;m getting this when my jruby code tries to establish a connection to the db:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;org.springframework.scripting.jruby.JRubyScriptUtils$JRubyExecutionException: uninitialized constant ActiveRecord::ConnectionAdapters::MssqlJdbcConnection; nested exception is org.jruby.exceptions.RaiseException: uninitialized constant ActiveRecord::ConnectionAdapters::MssqlJdbcConnection&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at org.springframework.scripting.jruby.JRubyScriptUtils$RubyObjectInvocationHandler.invoke(JRubyScriptUtils.java:184)&lt;/div&gt;&lt;div&gt;...&amp;lt;snip&amp;gt;...&lt;/div&gt;&lt;div&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Caused by: org.jruby.exceptions.RaiseException: uninitialized constant ActiveRecord::ConnectionAdapters::MssqlJdbcConnection&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at Kernel.raise(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activesupport/lib/active_support/dependencies.rb:442)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveSupport::Dependencies.load_missing_constant(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activesupport/lib/active_support/dependencies.rb:77)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveSupport::Dependencies::ModuleConstMissing.const_missing_with_dependencies(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_mssql.rb:35)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x45192510&amp;gt;.jdbc_connection_class(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:462)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::JdbcAdapter.jdbc_connection_class(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:452)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::JdbcAdapter.initialize(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at JdbcSpec::ActiveRecordExtensions.jdbc_connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:223)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.new_connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:245)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout_new_connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:188)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:184)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at Kernel.loop(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:184)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/jruby-complete-1.3.1.jar!/monitor.rb:191)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at MonitorMixin.mon_synchronize(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:183)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:98)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionPool.connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:326)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at ActiveRecord::ConnectionAdapters::ConnectionHandler.retrieve_connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:121)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.retrieve_connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:113)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.connection(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/base.rb:2934)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.quoted_table_name(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/base.rb:1626)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.construct_finder_sql(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/base.rb:1490)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.find_every(file:/Users/steve/src/apache-tomcat-6.0.20/webapps/mercybatch/WEB-INF/lib/remittanceAdvice-1.0.jar!/vendor/gems/activerecord/lib/active_record/base.rb:589)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at #&amp;lt;Class:01x322a0b7b&amp;gt;.find(:38)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at RemittanceAdvice::RaItemReader.read(:1)&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;at (unknown).(unknown)(:1)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I know warbler and jruby-rack gets AR/jdbc adapter and ms sql to work in a WAR, but that isn&amp;#39;t really an option for me right now; I&amp;#39;m trying to squeeze in some existing jruby stuff into an existing spring app built by maven.  So I guess I&amp;#39;m going to have to figure out what jruby-rack and warbler do to make this stuff work.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Any help would be greatly appreciated!!!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Steve&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 4, 2009 at 11:24 AM, Nick Sieger &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div class=&quot;im&quot;&gt;On Wed, Nov 4, 2009 at 11:07 AM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;

&amp;gt; One more thing - what&amp;#39;s the state of embedding gems in a jar, where the gem&lt;br&gt;
&amp;gt; includes its own java code in a jar?  I&amp;#39;m trying to use the&lt;br&gt;
&amp;gt; activerecord-jdbc-adapter inside a spring application where all my ruby code&lt;br&gt;
&amp;gt; and dependent ruby gems are packaged in a jar (or jars).   However&lt;br&gt;
&amp;gt; activerecord-jdbc can&amp;#39;t load it&amp;#39;s java classes:&lt;br&gt;
&amp;gt; `class_eval&amp;#39;: cannot load Java class jdbc_adapter.JdbcConnectionFactory&lt;br&gt;
&amp;gt; (NameError)&lt;br&gt;
&amp;gt; I&amp;#39;m not surprised it&amp;#39;s not working, but I&amp;#39;m not sure what the best&lt;br&gt;
&amp;gt; solution is.  Should I just copy jdbc_adapter_internal.jar (used internally&lt;br&gt;
&amp;gt; by the activerecord-jdbc gem) out from under the activerecord-jdbc directory&lt;br&gt;
&amp;gt; to someplace in my classpath?&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;I think better would be to un-jar the contents of the jar into another&lt;br&gt;
jar. There&amp;#39;s also the problem that the jdbc adapter code does a&lt;br&gt;
&amp;quot;require &amp;#39;jdbc_adapter/jdbc_adapter_internal&amp;#39;&amp;quot; which means that you&lt;br&gt;
might have to put an empty &amp;#39;jdbc_adapter/jdbc_adapter_internal.rb&amp;quot;&lt;br&gt;
file inside your jar as well.&lt;br&gt;
&lt;br&gt;
The relevant JIRA is &lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-3299&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-3299&lt;/a&gt;. If we&lt;br&gt;
can&amp;#39;t find a solution to jars-in-jars, we might need to build a gem&lt;br&gt;
re-packaging solution that takes care of the above for you.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
/Nick&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Steve&lt;br&gt;
&amp;gt; On Wed, Nov 4, 2009 at 10:28 AM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Yes I had Spring load the scripts from a classpath.   I&amp;#39;ve worked around&lt;br&gt;
&amp;gt;&amp;gt; the issue by removing the File.dirname(__FILE__) bits from my code.  Instead&lt;br&gt;
&amp;gt;&amp;gt; I specify from the root of the classpath:  &amp;#39;require &amp;quot;path/to/ruby/file&amp;quot;&lt;br&gt;
&amp;gt;&amp;gt; where the directory &amp;quot;path&amp;quot; is on the root of the classpath.  I can do this&lt;br&gt;
&amp;gt;&amp;gt; because it&amp;#39;s all my code and not that many files to modify.&lt;br&gt;
&amp;gt;&amp;gt; I&amp;#39;m still playing around with it; will update if I find anything out.&lt;br&gt;
&amp;gt;&amp;gt; Steve&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; On Wed, Nov 4, 2009 at 8:28 AM, Yoko Harada &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yokolet@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; On Tue, Nov 3, 2009 at 9:35 AM, Nick Sieger &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; On Mon, Nov 2, 2009 at 4:03 PM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26225698&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; I&amp;#39;m trying to package some ruby code for running inside spring batch.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;  I&amp;#39;m&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; using the spring dynamic language bean feature to load ruby classes&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; from&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; files on the class path.  The problem is these ruby files require&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; other&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; files via File.dirname(__FILE__).  That&amp;#39;s not working.  What&amp;#39;s the&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; best way&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; to package up a bunch of jruby code for running inside a java&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; application,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; such that the jruby files can require other jruby files?&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Steve&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Did Spring load Ruby scripts from a classpath? If so, I might have got&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; an error from the same reason.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; What is the value of __FILE__? Even with __FILE__ set to a file: URL&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; of a path inside a jar file, typical Rubyisms like you indicate should&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; be working. If you can illustrate what is failing, that would help;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; there might be a bug. Also indicate what version of JRuby you&amp;#39;re&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; using. Some of the bugs related to file: URLs and paths have been&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; fixed in recent releases.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I haven&amp;#39;t figured out what&amp;#39;s wrong with that, but __FILE__ doesn&amp;#39;t&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; work when a script is loaded from a  classpath. For example, when I&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; set all necessary all classapths and load test/test_file.rb from the&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; classpath, evaluation failed because the error below at the line&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;quot;expect = File.read(__FILE__)[0..100]&amp;quot;:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Loaded suite -&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Started&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; .................................E.......................&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Finished in 2.153 seconds.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;  1) Error:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; test_file_url(TestFile):&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Errno::ENOENT: No such file or directory - File not found - test_file.rb&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;    test_file.rb:926:in `initialize&amp;#39;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;    test_file.rb:926:in `test_file_url&amp;#39;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; 57 tests, 293 assertions, 0 failures, 1 errors&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; However, when I read test_file.rb from an absolute path, it worked&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; well. This happens in trunk version as well. If this should work even&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; when scripts are loaded from classpath, there might be a bug.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; -Yoko&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; Cheers,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; /Nick&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt; To unsubscribe from this list, please visit:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; To unsubscribe from this list, please visit:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Load-path-issues-inside-jar---external-app-tp26171542p26225698.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26224367</id>
	<title>Re: Migrations with Warfile deployment?</title>
	<published>2009-11-05T15:39:03Z</published>
	<updated>2009-11-05T15:39:03Z</updated>
	<author>
		<name>straightflush@gmail.com</name>
	</author>
	<content type="html">&lt;a href=&quot;http://blog.dberg.org/2009/10/run-dbmigrate-in-jruby-without-rails.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blog.dberg.org/2009/10/run-dbmigrate-in-jruby-without-rails.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;does that help ?
&lt;br&gt;&lt;br&gt;On Thu, Nov 5, 2009 at 6:12 PM, Michael Hagedorn
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224367&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Chad:
&lt;br&gt;&amp;gt; This is a little long in the tooth now, but I cooked up
&lt;br&gt;&amp;gt; this &lt;a href=&quot;http://github.com/mwhagedorn/migrate_war&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mwhagedorn/migrate_war&lt;/a&gt;&amp;nbsp;for a project.  Basically it
&lt;br&gt;&amp;gt; applys the migrations when you deploy.
&lt;br&gt;&amp;gt; HTH
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Nov 5, 2009, at 5:06 PM, Benjamin Christenson wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Chad,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; A little late in responding, but we are working on a solution to a similar
&lt;br&gt;&amp;gt; problem.  We are working with a local code-hacker to build out a strategy,
&lt;br&gt;&amp;gt; and the initial PoC looks good.  The general strategy we are taking is to
&lt;br&gt;&amp;gt; deploy our application pre-configured with a sqlite3 database.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For installation, a customer simply deploys the war file to unpack it.
&lt;br&gt;&amp;gt; Then, when they connect to the application, it identifies that it is being
&lt;br&gt;&amp;gt; run in &amp;quot;configuration mode&amp;quot; and allows an administrator to configure the
&lt;br&gt;&amp;gt; database connection.  This writes the configuration to database.yml and
&lt;br&gt;&amp;gt; executes ActiveRecord::Base.establish_connection.  The administrator then
&lt;br&gt;&amp;gt; has an option to execute migrations.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For upgrades, we provide a &amp;quot;configuration backup&amp;quot; that basically copies out
&lt;br&gt;&amp;gt; the existing database.yml.  The customer can then redeploy the war file, and
&lt;br&gt;&amp;gt; load the backup to reconfigure the database.yml.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Ben Christenson
&lt;br&gt;&amp;gt; Developer/Analyst
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Kinetic Data, Inc.
&lt;br&gt;&amp;gt; &amp;quot;Building a Better Service Experience&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 651.556.0937  I  www.kineticdata.com
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, Sep 29, 2009 at 11:09 AM, Chad Woolley &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224367&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thewoolleyman@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; We want to give a versioned WAR to customers for deployment on their
&lt;br&gt;&amp;gt;&amp;gt; internal environment, and are wondering how to handle migrations.  It
&lt;br&gt;&amp;gt;&amp;gt; seems like a chicken-and-egg problem - you can't fire up a new war
&lt;br&gt;&amp;gt;&amp;gt; until you run the migrations, but you can't run migrations which are
&lt;br&gt;&amp;gt;&amp;gt; zipped up inside the WAR.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; How do others handle this?  Give them a separate executable file/jar
&lt;br&gt;&amp;gt;&amp;gt; (with a version matching the WAR) to run manually?  Something else?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;&amp;gt; -- Chad
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Michael Hagedorn
&lt;br&gt;&amp;gt; Silverchair Solutions - Agile Web Develoment
&lt;br&gt;&amp;gt; Houston, Tx       &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224367&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.silverchairsolutions.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.silverchairsolutions.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Migrations-with-Warfile-deployment--tp25667133p26224367.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26224109</id>
	<title>Re: Managing (start/stop) a JRuby application from a  Servlet</title>
	<published>2009-11-05T15:16:40Z</published>
	<updated>2009-11-05T15:16:40Z</updated>
	<author>
		<name>ben.christenson</name>
	</author>
	<content type="html">Hey guys,&lt;br&gt;&lt;br&gt;Well with the release of 1.4 and some embedded code hacking I have pretty much resolved the problem.  A few niceties came up during the process that I am interested in feedback on.&lt;br&gt;&lt;br&gt;First, we have quite a few jar files (and a jar file for gems leveraging the gems-in-a-jar strategy).  Right now Jruby does not support loading scripts from jars within other jars (&lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-3299&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-3299&lt;/a&gt;).  Is there a plan to address this?&lt;br&gt;
&lt;br&gt;Also, for embedded Jruby, it looks like __FILE__ does not work when executing scripts from the classpath.  It just returns the base file name (without the location within the jar file it is in).  I think I saw a thread about this already on the list, but I wanted to verify that this is unexpected behavior.  If so, are there any known workarounds?  We got around it by finding the file using the java classloader and then modifying our init scripts to append the jar file manually.&lt;br&gt;
&lt;br&gt;&lt;br&gt;Lastly, there are a few idiosyncrasies that I don&amp;#39;t quite understand:&lt;br&gt;&lt;br&gt;It is possible to check if a jar file contains a specified file, but it doesn&amp;#39;t look like it is possible to check if a jar file contains a directory (see below).  Is that expected behavior?&lt;br&gt;
  File.exist?(&amp;quot;file:/C:/my.jar!/directory/file.txt&amp;quot;) # true&lt;br&gt;  File.exist?(&amp;quot;file:/C:/my.jar!/directory&amp;quot;) # false&lt;br&gt;&lt;br&gt;Also, Dir.glob with wildcards does not seem to work within jar files (see below).  Is that expected behavior?&lt;br&gt;
  Dir[&amp;quot;file:/C:/my.jar!/*&amp;quot;] # []&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-weight: bold;&quot;&gt;Ben Christenson&lt;/span&gt;&lt;/font&gt;&lt;br&gt;
&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Developer/Analyst&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;/span&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt;


Kinetic Data, Inc.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-style: italic;&quot;&gt;&amp;quot;Building a Better Service Experience&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt;


&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;2&quot;&gt;&lt;br&gt;&lt;font size=&quot;1&quot;&gt;651.556.0937&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;1&quot;&gt;  &lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;I&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 102, 0);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: rgb(204, 102, 0);&quot;&gt;www.kineticdata.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;


&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Sep 11, 2009 at 12:21 PM, Benjamin Christenson &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224109&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ben.christenson@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Sure.  We have a simple ruby DSL built up that represents a tree of dependent actions.  Each action is built up of an xml description and a ruby class that gets called when it is its turn to execute.  Managing this process is a simple driver program that loads up the application:&lt;br&gt;

&lt;br&gt;FILE: kinetic_task.rb (this is our loader script)&lt;br&gt;  # Require ruby standard libraries&lt;br&gt;  require &amp;#39;erb&amp;#39;&lt;br&gt;  require &amp;#39;rexml/document&amp;#39;&lt;br&gt;  ...&lt;br&gt;  # Require gems&lt;br&gt;  require &amp;#39;uuidtools&amp;#39;&lt;br&gt;

  require &amp;#39;xmlsimple&amp;#39;&lt;br&gt;  ...&lt;br&gt;  # Require the DSL files (either ruby source or precompiled)&lt;br&gt;  Dir[File.join(File.dirname(__FILE__), &amp;#39;dsl&amp;#39;, &amp;#39;**&amp;#39;, &amp;#39;*.{rb,class}&amp;#39;)].each do |lib|&lt;br&gt;    require File.expand_path(lib.chomp(&amp;#39;.class&amp;#39;))&lt;br&gt;

  end&lt;br&gt;&lt;br&gt;FILE: driver.rb&lt;br&gt;  # Require our application&lt;br&gt;  require &amp;#39;kinetic_task&amp;#39;&lt;br&gt;  # Process the configuration&lt;br&gt;  ...&lt;br&gt;  # Start the polling process&lt;br&gt;  engine = DSL::Engine.new(:config =&amp;gt; {...})&lt;br&gt;

  engine.start&lt;br&gt;&lt;br&gt;The start method queries the database for records indicating an action is ready and then executes them (once by default, or loops continually sleeping for x seconds if configured to run as a continual process).&lt;br&gt;

&lt;br&gt;Currently, we have our entire application packaged with RAWR and just pass in a configuration item so that the engine loops infinitely.  What we would like to do is be able to call Engine.start or Engine.stop from a Servlet so that we can control the process from our web interface (and allow for safe termination of the polling process).  I think we can do this if we package the plaintext ruby files into our web application, but we want to be able to deploy this package as a jar file.&lt;br&gt;

&lt;br&gt;I was able to successfully write a manager ruby class that supported start/stop control of a worker thread (that just did a puts statement and slept for x seconds) and then manage the starting/stoping from a Servlet.  However, when I attempted to replace the puts with actual code (requiring our application from the RAWRed jar file) _FILE_ was returning odd results in the loader script.  Is it possible that I need to play with loading a bit more or was I doing something wrong there?  How stable is the patched JRuby 1.4.0 that JRuby Embed uses?&lt;div class=&quot;im&quot;&gt;
&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-weight: bold;&quot;&gt;Ben Christenson&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Developer/Analyst&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;

&lt;/span&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt;

Kinetic Data, Inc.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-style: italic;&quot;&gt;&amp;quot;Building a Better Service Experience&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt;



&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;2&quot;&gt;&lt;br&gt;&lt;font size=&quot;1&quot;&gt;651.556.0937&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;1&quot;&gt;  &lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;I&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 102, 0);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: rgb(204, 102, 0);&quot;&gt;www.kineticdata.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;



&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Sep 11, 2009 at 12:48 PM, Charles Oliver Nutter &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224109&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;headius@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Can you describe what you need to accomplish in the other &amp;quot;process&amp;quot; in&lt;br&gt;
a little more detail? I&amp;#39;m not sure if there&amp;#39;s a perfect solution, but&lt;br&gt;
maybe we can work together to come up with something that fits your&lt;br&gt;
needs...&lt;br&gt;
&lt;br&gt;
2009/9/9 Benjamin Christenson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224109&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ben.christenson@...&lt;/a&gt;&amp;gt;:&lt;br&gt;
&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;gt; After playing around with JRuby Embed and RAWR (and my ruby application require statements), I still don&amp;#39;t have a good solution for managing a process written in Ruby from a Java Servlet.  For some background, we are developing a &amp;quot;next generation&amp;quot; suite of tools for our products (Java based) in Ruby and working to deploy them as part of our existing applications.  One of these is a simple poller written in Ruby that we would like to be able to manage from our existing web management console.&lt;br&gt;


&amp;gt;&lt;br&gt;
&amp;gt; Currently, we are doing this via a RAWRed executable jar file that is triggered to execute on initialization of a loader Servlet.  This works fine, but prevents us from passing information back and forth (such as the desire to cleanly halt after the current poll process).  I dug into JRuby Embed a bit (the interface examples specifically) and came up with a small manager/worker thread example that seemed to work pretty well.  However when I went to implement the worker thread to load up my rawred library, I found myself in a load path spiderweb that I was unable to untangle.  Specifically, the _FILE_ constant in my loader file was not evaluating properly in precompiled files.&lt;br&gt;


&amp;gt;&lt;br&gt;
&amp;gt; Does JRuby Embed support precompiled Jruby?  IE can I jrubyc my ruby application and then have a single uncompiled ruby manager class that is loaded via JRuby Embed?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Am I missing something easy on how to implement starting and stopping of a ruby polling process from a Java Servlet?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Ben Christenson&lt;br&gt;
&amp;gt; Developer/Analyst&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Kinetic Data, Inc.&lt;br&gt;
&amp;gt; &amp;quot;Building a Better Service Experience&amp;quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 651.556.0937  I  &lt;a href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;www.kineticdata.com&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Managing-%28start-stop%29-a-JRuby-application-from-a-Servlet-tp25373867p26224109.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26224052</id>
	<title>Re: Migrations with Warfile deployment?</title>
	<published>2009-11-05T15:12:17Z</published>
	<updated>2009-11-05T15:12:17Z</updated>
	<author>
		<name>Mike Hagedorn</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;Chad:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This is a little long in the tooth now, but I cooked up this&amp;nbsp;&lt;a href=&quot;http://github.com/mwhagedorn/migrate_war&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mwhagedorn/migrate_war&lt;/a&gt; for a project. &amp;nbsp;Basically it applys the migrations when you deploy.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;HTH&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On Nov 5, 2009, at 5:06 PM, Benjamin Christenson wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Chad,&lt;br&gt;&lt;br&gt;A little late in responding, but we are working on a solution to a similar problem.&amp;nbsp; We are working with a local code-hacker to build out a strategy, and the initial PoC looks good.&amp;nbsp; The general strategy we are taking is to deploy our application pre-configured with a sqlite3 database.&lt;br&gt; &lt;br&gt;For installation, a customer simply deploys the war file to unpack it.&amp;nbsp; Then, when they connect to the application, it identifies that it is being run in &quot;configuration mode&quot; and allows an administrator to configure the database connection.&amp;nbsp; This writes the configuration to database.yml and executes ActiveRecord::Base.establish_connection.&amp;nbsp; The administrator then has an option to execute migrations.&lt;br&gt; &lt;br&gt;For upgrades, we provide a &quot;configuration backup&quot; that basically copies out the existing database.yml.&amp;nbsp; The customer can then redeploy the war file, and load the backup to reconfigure the database.yml.&lt;br&gt;&lt;br&gt; Thanks,&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-weight: bold;&quot;&gt;Ben Christenson&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Developer/Analyst&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt; Kinetic Data, Inc.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-style: italic;&quot;&gt;&quot;Building a Better Service Experience&quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt; &lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;2&quot;&gt;&lt;br&gt;&lt;font size=&quot;1&quot;&gt;651.556.0937&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;1&quot;&gt;&amp;nbsp; &lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;I&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 102, 0);&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: rgb(204, 102, 0);&quot;&gt;www.kineticdata.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Sep 29, 2009 at 11:09 AM, Chad Woolley &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224052&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thewoolleyman@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt; We want to give a versioned WAR to customers for deployment on their&lt;br&gt; internal environment, and are wondering how to handle migrations. &amp;nbsp;It&lt;br&gt; seems like a chicken-and-egg problem - you can't fire up a new war&lt;br&gt; until you run the migrations, but you can't run migrations which are&lt;br&gt; zipped up inside the WAR.&lt;br&gt; &lt;br&gt; How do others handle this? &amp;nbsp;Give them a separate executable file/jar&lt;br&gt; (with a version matching the WAR) to run manually? &amp;nbsp;Something else?&lt;br&gt; &lt;br&gt; Thanks,&lt;br&gt; &lt;font color=&quot;#888888&quot;&gt;-- Chad&lt;br&gt; &lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt; ---------------------------------------------------------------------&lt;br&gt; To unsubscribe from this list, please visit:&lt;br&gt; &lt;br&gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div apple-content-edited=&quot;true&quot;&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; &quot;&gt;&lt;div style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;Michael Hagedorn&amp;nbsp;&lt;/div&gt;&lt;div&gt;Silverchair Solutions - Agile Web Develoment&lt;/div&gt;&lt;div&gt;Houston, Tx &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26224052&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike@...&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://www.silverchairsolutions.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.silverchairsolutions.com&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt; &lt;/div&gt;&lt;br&gt;&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Migrations-with-Warfile-deployment--tp25667133p26224052.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26223978</id>
	<title>Re: Migrations with Warfile deployment?</title>
	<published>2009-11-05T15:06:12Z</published>
	<updated>2009-11-05T15:06:12Z</updated>
	<author>
		<name>ben.christenson</name>
	</author>
	<content type="html">Chad,&lt;br&gt;&lt;br&gt;A little late in responding, but we are working on a solution to a similar problem.  We are working with a local code-hacker to build out a strategy, and the initial PoC looks good.  The general strategy we are taking is to deploy our application pre-configured with a sqlite3 database.&lt;br&gt;
&lt;br&gt;For installation, a customer simply deploys the war file to unpack it.  Then, when they connect to the application, it identifies that it is being run in &amp;quot;configuration mode&amp;quot; and allows an administrator to configure the database connection.  This writes the configuration to database.yml and executes ActiveRecord::Base.establish_connection.  The administrator then has an option to execute migrations.&lt;br&gt;
&lt;br&gt;For upgrades, we provide a &amp;quot;configuration backup&amp;quot; that basically copies out the existing database.yml.  The customer can then redeploy the war file, and load the backup to reconfigure the database.yml.&lt;br&gt;&lt;br&gt;
Thanks,&lt;br&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-weight: bold;&quot;&gt;Ben Christenson&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Developer/Analyst&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;
&lt;/span&gt;&lt;font size=&quot;2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br&gt;

Kinetic Data, Inc.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif; font-style: italic;&quot;&gt;&amp;quot;Building a Better Service Experience&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;&lt;br&gt;


&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;2&quot;&gt;&lt;br&gt;&lt;font size=&quot;1&quot;&gt;651.556.0937&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-family: arial,helvetica,sans-serif;&quot; size=&quot;1&quot;&gt;  &lt;font style=&quot;color: rgb(204, 102, 0);&quot; size=&quot;2&quot;&gt;I&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(204, 102, 0);&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size=&quot;1&quot;&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: rgb(204, 102, 0);&quot;&gt;www.kineticdata.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a style=&quot;color: rgb(204, 102, 0);&quot; href=&quot;http://www.kineticdata.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;


&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Sep 29, 2009 at 11:09 AM, Chad Woolley &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26223978&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thewoolleyman@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
We want to give a versioned WAR to customers for deployment on their&lt;br&gt;
internal environment, and are wondering how to handle migrations.  It&lt;br&gt;
seems like a chicken-and-egg problem - you can&amp;#39;t fire up a new war&lt;br&gt;
until you run the migrations, but you can&amp;#39;t run migrations which are&lt;br&gt;
zipped up inside the WAR.&lt;br&gt;
&lt;br&gt;
How do others handle this?  Give them a separate executable file/jar&lt;br&gt;
(with a version matching the WAR) to run manually?  Something else?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;-- Chad&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Migrations-with-Warfile-deployment--tp25667133p26223978.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26216868</id>
	<title>DRY up issues</title>
	<published>2009-11-05T07:31:56Z</published>
	<updated>2009-11-05T07:31:56Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Might be nice to disable the issues on
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://github.com/jruby/jruby&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/jruby/jruby&lt;/a&gt;&lt;br&gt;&lt;br&gt;and provide a link to the JIRA in the README file
&lt;br&gt;&lt;br&gt;for us githubbers to not get confused :)
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;-r
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/DRY-up-issues-tp26216868p26216868.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26210799</id>
	<title>Re: Array#select doesnt return Enumerator?</title>
	<published>2009-11-05T00:24:20Z</published>
	<updated>2009-11-05T00:24:20Z</updated>
	<author>
		<name>David Calavera</name>
	</author>
	<content type="html">In the last ruby build there were some backports that haven&amp;#39;t been included in jruby yet, perhaps that&amp;#39;s one of those. I&amp;#39;m filing a bug and sending a patch in a while.&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Nov 5, 2009 at 6:31 AM, Hirotsugu Asari &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26210799&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;asari.ruby@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div style=&quot;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 4, 2009, at 9:40 PM, koji Lin wrote:&lt;/div&gt;

&lt;br&gt;&lt;blockquote type=&quot;cite&quot;&gt;Hi,&lt;div&gt;    I have tried jruby1.4, and something works in ruby1.8.7 doesn&amp;#39;t works in jruby1.4.&lt;/div&gt;&lt;div&gt;My code is like below.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = [&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;]&lt;/b&gt;&lt;/div&gt;

&lt;div&gt;
&lt;b&gt;array.select.with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;got C:/Program Files/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/core_ext/symbol.rb:1:in `select&amp;#39;: yield called out of block (LocalJumpError)&lt;/div&gt;


&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;but this works well&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = [&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;]&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;q = array.enum_for(:select).with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;


  &lt;span style=&quot;font-family: arial,sans-serif,&amp;#39;Arial Unicode MS&amp;#39;; font-size: 13px; border-collapse: collapse;&quot;&gt;Is this a bug? and Should i file it in jira?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
  koji&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;It looks like a bug to me, in the sense that JRuby&amp;#39;s behavior deviates from MRI&amp;#39;s. The thing is, Enumerable#select without body doesn&amp;#39;t seem to be documented (please educate me if I missed the documentation), so in that sense, it is not. In fact, there are no spec on Array#select that contains no blocks (yet).&lt;/div&gt;

&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regardless, I think it is worth opening a JIRA ticket.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;By the way, the code works with JRuby in 1.9 mode.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Hiro&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;David Calavera&lt;br&gt;&lt;a href=&quot;http://www.thinkincode.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.thinkincode.net&lt;/a&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Array-select-doesnt-return-Enumerator--tp26208857p26210799.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26210795</id>
	<title>Re: Problems with table name quoting in ActiveRecord-JDBC-Adapter &gt; 0.9.0</title>
	<published>2009-11-05T00:24:04Z</published>
	<updated>2009-11-05T00:24:04Z</updated>
	<author>
		<name>Andreas Gungl-3</name>
	</author>
	<content type="html">Am Mittwoch, 4. November 2009 schrieb Nick Sieger:
&lt;br&gt;&amp;gt; Hi Andreas,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks for the report. Looks like we have some work to do on the
&lt;br&gt;&amp;gt; Oracle adapter. If you monkey-patch the JdbcSpec::Oracle module to add
&lt;br&gt;&amp;gt; a #quote_table_name method that does what you need, does it help? Or
&lt;br&gt;&amp;gt; do you still need the Java patch below?
&lt;br&gt;&lt;br&gt;Hi Nick,
&lt;br&gt;&lt;br&gt;I needed both changes. The Ruby part corrects the quoting of the table name, 
&lt;br&gt;the Java part fixes the extraction of the schema name from the model's 
&lt;br&gt;table_name (if set via: set_table_name &amp;quot;schema.table&amp;quot;).
&lt;br&gt;&lt;br&gt;Further I've found in jdbc_oracle.rb:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; def self.guess_date_or_time(value)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (value.hour == 0 &amp;&amp; value.min == 0 &amp;&amp; value.sec == 0) ?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new_date(value.year, value.month, value.day) : value
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end
&lt;br&gt;&lt;br&gt;I haven't found a definition for new_date(). If my code hits that line, I 
&lt;br&gt;get an exception...
&lt;br&gt;I think, the code as in the oracle_enhanced adapter is safer (as I also had 
&lt;br&gt;problems with the hour() method in some circumstances):
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; def self.guess_date_or_time(value)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value.respond_to?(:hour) &amp;&amp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (value.hour == 0 &amp;&amp; value.min == 0 &amp;&amp; value.sec == 0) ?
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Date.new(value.year, value.month, value.day) : value
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; In any case, if you could file this in
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://kenai.com/jira/browse/ACTIVERECORD_JDBC&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kenai.com/jira/browse/ACTIVERECORD_JDBC&lt;/a&gt;, that would be great.
&lt;br&gt;&lt;br&gt;Sure, I will do including a patch against the files from 0.9.2.
&lt;br&gt;&lt;br&gt;Andreas
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; /Nick
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Wed, Nov 4, 2009 at 4:46 AM, Andreas Gungl &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26210795&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gungl@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Am Mittwoch, 4. November 2009 schrieb &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26210795&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gungl@...&lt;/a&gt;:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; The difference is that the version &amp;gt; 0.9.0 quotes the table names and
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp;thus invalidates the statements.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; The only working quotation were &amp;quot;LNX&amp;quot;.&amp;quot;S_KEY&amp;quot; for the example above.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; But I don't see a way to make this work without taking out the schema
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; from the name. (In that case I'd write only the table name and in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; upper case.)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Here's what I've found so far:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; a) Quoting
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Originally in AR 2.2.2 (that's what I have here) there is in
&lt;br&gt;&amp;gt; &amp;gt; quoting.rb:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Quotes the column name. Defaults to no quoting.
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;def quote_column_name(column_name)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;column_name
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Quotes the table name. Defaults to column name quoting.
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;def quote_table_name(table_name)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quote_column_name(table_name)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; So quote_table_name doesn't quote here. Unfortunately jdbc_oracle.rb
&lt;br&gt;&amp;gt; &amp;gt; redefines quote_column_name. It would be good to add there:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;# Quotes the table name. Defaults to original column name quoting
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;# from AR which doesn't quote!
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;def quote_table_name(table_name)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;table_name
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;end
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; b) Schema usage
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In RubyJdbcConnection.java we have:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;public IRubyObject columns_internal(final ThreadContext context,
&lt;br&gt;&amp;gt; &amp;gt; final IRubyObject[] args) throws SQLException, IOException {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (IRubyObject) withConnectionAndRetry(context, new
&lt;br&gt;&amp;gt; &amp;gt; SQLBlock() { public Object call(Connection c, Block proc) throws
&lt;br&gt;&amp;gt; &amp;gt; SQLException { ResultSet results = null;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String table_name =
&lt;br&gt;&amp;gt; &amp;gt; rubyApi.convertToRubyString(args[0]).getUnicodeValue(); String
&lt;br&gt;&amp;gt; &amp;gt; schemaName = null;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int index = table_name.indexOf(&amp;quot;.&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(index != -1) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;schemaName = table_name.substring(0, index);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;table_name = table_name.substring(index + 1);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DatabaseMetaData metadata = c.getMetaData();
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(args.length &amp;gt; 2 &amp;&amp; schemaName == null) schemaName
&lt;br&gt;&amp;gt; &amp;gt; = toStringOrNull(args[2]);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (schemaName != null) schemaName =
&lt;br&gt;&amp;gt; &amp;gt; caseConvertIdentifierForJdbc(metadata, schemaName); table_name =
&lt;br&gt;&amp;gt; &amp;gt; caseConvertIdentifierForJdbc(metadata, table_name);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The problem is that the schema name is corectly parsed from the table
&lt;br&gt;&amp;gt; &amp;gt; name but then it's unconditionally replaced by the schema name of the
&lt;br&gt;&amp;gt; &amp;gt; current user. The commands should get rearranged like this:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String table_name =
&lt;br&gt;&amp;gt; &amp;gt; rubyApi.convertToRubyString(args[0]).getUnicodeValue(); String
&lt;br&gt;&amp;gt; &amp;gt; schemaName = null;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DatabaseMetaData metadata = c.getMetaData();
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int index = table_name.indexOf(&amp;quot;.&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(index != -1) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;schemaName = table_name.substring(0, index);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;table_name = table_name.substring(index + 1);
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(args.length &amp;gt; 2) schemaName =
&lt;br&gt;&amp;gt; &amp;gt; args[2].toString(); }
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (schemaName != null) schemaName =
&lt;br&gt;&amp;gt; &amp;gt; caseConvertIdentifierForJdbc(metadata, schemaName); table_name =
&lt;br&gt;&amp;gt; &amp;gt; caseConvertIdentifierForJdbc(metadata, table_name);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; That means to read the meta data before the check for a schema part in
&lt;br&gt;&amp;gt; &amp;gt; the table name, and then use the schema from the meta data only if no
&lt;br&gt;&amp;gt; &amp;gt; schema name was found.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Best regards,
&lt;br&gt;&amp;gt; &amp;gt; Andreas
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; &amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Problems-with-table-name-quoting-in-ActiveRecord-JDBC-Adapter-%3E-0.9.0-tp26193773p26210795.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26209524</id>
	<title>Re: Array#select doesnt return Enumerator?</title>
	<published>2009-11-04T21:31:27Z</published>
	<updated>2009-11-04T21:31:27Z</updated>
	<author>
		<name>Hirotsugu Asari</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Nov 4, 2009, at 9:40 PM, koji Lin wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Hi,&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;I have tried jruby1.4, and something works in ruby1.8.7 doesn't works in jruby1.4.&lt;/div&gt;&lt;div&gt;My code is like below.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = ['a','b','c']&lt;/b&gt;&lt;/div&gt;&lt;div&gt;
&lt;b&gt;array.select.with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;got&amp;nbsp;C:/Program Files/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/core_ext/symbol.rb:1:in `select': yield called out of block (LocalJumpError)&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;but this works well&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = ['a','b','c']&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;q = array.enum_for(:select).with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif, 'Arial Unicode MS'; font-size: 13px; border-collapse: collapse; &quot;&gt;Is this a bug? and Should i file it in jira?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
&amp;nbsp;&amp;nbsp;koji&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;It looks like a bug to me, in the sense that JRuby's behavior deviates from MRI's. The thing is, Enumerable#select without body doesn't seem to be documented (please educate me if I missed the documentation), so in that sense, it is not. In fact, there are no spec on Array#select that contains no blocks (yet).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regardless, I think it is worth opening a JIRA ticket.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;By the way, the code works with JRuby in 1.9 mode.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Hiro&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Array-select-doesnt-return-Enumerator--tp26208857p26209524.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26208857</id>
	<title>Array#select doesnt return Enumerator?</title>
	<published>2009-11-04T19:40:14Z</published>
	<updated>2009-11-04T19:40:14Z</updated>
	<author>
		<name>kang-sze lin</name>
	</author>
	<content type="html">Hi,&lt;div&gt;    I have tried jruby1.4, and something works in ruby1.8.7 doesn&amp;#39;t works in jruby1.4.&lt;/div&gt;&lt;div&gt;My code is like below.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = [&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;]&lt;/b&gt;&lt;/div&gt;&lt;div&gt;
&lt;b&gt;array.select.with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;got C:/Program Files/jruby-1.4.0/lib/ruby/site_ruby/shared/builtin/core_ext/symbol.rb:1:in `select&amp;#39;: yield called out of block (LocalJumpError)&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;but this works well&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;array = [&amp;#39;a&amp;#39;,&amp;#39;b&amp;#39;,&amp;#39;c&amp;#39;]&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;q = array.enum_for(:select).with_index{|x, i| i &amp;gt;= 1}&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
  &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif, &amp;#39;Arial Unicode MS&amp;#39;; font-size: 13px; border-collapse: collapse; &quot;&gt;Is this a bug? and Should i file it in jira?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
  koji&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Array-select-doesnt-return-Enumerator--tp26208857p26208857.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26204968</id>
	<title>Re: Re: Calling Java from JRuby problem</title>
	<published>2009-11-04T13:29:00Z</published>
	<updated>2009-11-04T13:29:00Z</updated>
	<author>
		<name>Justin Coyne</name>
	</author>
	<content type="html">If your class is in a package you need to specify it.
&lt;br&gt;&lt;br&gt;package org.myname.foo
&lt;br&gt;&lt;br&gt;public class Test02 { ... }
&lt;br&gt;&lt;br&gt;this becomes:
&lt;br&gt;&lt;br&gt;Java::OrgMynameFoo::Test02.new
&lt;br&gt;&lt;br&gt;&lt;br&gt;Otherwise you can call java_import()
&lt;br&gt;&lt;br&gt;java_import('org.myname.foo.Test02')
&lt;br&gt;Test02.new
&lt;br&gt;&lt;br&gt;&lt;br&gt;-Justin
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, Nov 3, 2009 at 7:23 PM, James Way &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26204968&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm not sure but maybe you need to put the full path to your jar file.
&lt;br&gt;&amp;gt; I am new at this also.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; require '/Users/myname/jar/Test02.jar'
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; TestClasses = Java::Test02.Test02    #package.class, here assuming pkg
&lt;br&gt;&amp;gt; Test02
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; someVar = TestClasses.Test02.new
&lt;br&gt;&amp;gt; someVar.output
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Fla As wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt; I was playing to load my own Java code in JRuby, but my little example
&lt;br&gt;&amp;gt;&amp;gt; does not work and I do not understand why.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; [code]
&lt;br&gt;&amp;gt;&amp;gt; public class Test02 {
&lt;br&gt;&amp;gt;&amp;gt;   public void output() {
&lt;br&gt;&amp;gt;&amp;gt;     System.out.print(&amp;quot;From Java&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt; [/code]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; To create the jar archive I use &amp;quot;jar cf Test02.jar Test02.class&amp;quot;.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; [code]
&lt;br&gt;&amp;gt;&amp;gt; require 'java'
&lt;br&gt;&amp;gt;&amp;gt; require 'Test02.jar'
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; test = Test02.new()
&lt;br&gt;&amp;gt;&amp;gt; test.output
&lt;br&gt;&amp;gt;&amp;gt; [/code]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; When I start &amp;quot;jruby Test02.rb&amp;quot; I always get this error:
&lt;br&gt;&amp;gt;&amp;gt; /home/mitlox/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/javasupport.rb:1:in
&lt;br&gt;&amp;gt;&amp;gt; `const_missing': uninitialized constant Test02 (NameError)
&lt;br&gt;&amp;gt;&amp;gt;      from Test02.rb:6
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Perhaps I must set classpath variable but I have no idea how. Maybe do
&lt;br&gt;&amp;gt;&amp;gt; you any idea what I did wrong with my little example?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Best regards
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Calling-Java-from-JRuby-problem-tp26189621p26204968.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26201104</id>
	<title>Re: Problems with table name quoting in  ActiveRecord-JDBC-Adapter &gt; 0.9.0</title>
	<published>2009-11-04T09:37:53Z</published>
	<updated>2009-11-04T09:37:53Z</updated>
	<author>
		<name>Nick Sieger-2</name>
	</author>
	<content type="html">Hi Andreas,
&lt;br&gt;&lt;br&gt;Thanks for the report. Looks like we have some work to do on the
&lt;br&gt;Oracle adapter. If you monkey-patch the JdbcSpec::Oracle module to add
&lt;br&gt;a #quote_table_name method that does what you need, does it help? Or
&lt;br&gt;do you still need the Java patch below?
&lt;br&gt;&lt;br&gt;In any case, if you could file this in
&lt;br&gt;&lt;a href=&quot;http://kenai.com/jira/browse/ACTIVERECORD_JDBC&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kenai.com/jira/browse/ACTIVERECORD_JDBC&lt;/a&gt;, that would be great.
&lt;br&gt;&lt;br&gt;/Nick
&lt;br&gt;&lt;br&gt;On Wed, Nov 4, 2009 at 4:46 AM, Andreas Gungl &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26201104&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gungl@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Am Mittwoch, 4. November 2009 schrieb &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26201104&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gungl@...&lt;/a&gt;:
&lt;br&gt;&amp;gt;&amp;gt; The difference is that the version &amp;gt; 0.9.0 quotes the table names and
&lt;br&gt;&amp;gt;&amp;gt;  thus invalidates the statements.
&lt;br&gt;&amp;gt;&amp;gt; The only working quotation were &amp;quot;LNX&amp;quot;.&amp;quot;S_KEY&amp;quot; for the example above. But
&lt;br&gt;&amp;gt;&amp;gt;  I don't see a way to make this work without taking out the schema from
&lt;br&gt;&amp;gt;&amp;gt;  the name. (In that case I'd write only the table name and in upper
&lt;br&gt;&amp;gt;&amp;gt;  case.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here's what I've found so far:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; a) Quoting
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Originally in AR 2.2.2 (that's what I have here) there is in quoting.rb:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;      # Quotes the column name. Defaults to no quoting.
&lt;br&gt;&amp;gt;      def quote_column_name(column_name)
&lt;br&gt;&amp;gt;        column_name
&lt;br&gt;&amp;gt;      end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;      # Quotes the table name. Defaults to column name quoting.
&lt;br&gt;&amp;gt;      def quote_table_name(table_name)
&lt;br&gt;&amp;gt;        quote_column_name(table_name)
&lt;br&gt;&amp;gt;      end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So quote_table_name doesn't quote here. Unfortunately jdbc_oracle.rb
&lt;br&gt;&amp;gt; redefines quote_column_name. It would be good to add there:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    # Quotes the table name. Defaults to original column name quoting
&lt;br&gt;&amp;gt;    # from AR which doesn't quote!
&lt;br&gt;&amp;gt;    def quote_table_name(table_name)
&lt;br&gt;&amp;gt;      table_name
&lt;br&gt;&amp;gt;    end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; b) Schema usage
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In RubyJdbcConnection.java we have:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    public IRubyObject columns_internal(final ThreadContext context, final IRubyObject[] args)
&lt;br&gt;&amp;gt;            throws SQLException, IOException {
&lt;br&gt;&amp;gt;        return (IRubyObject) withConnectionAndRetry(context, new SQLBlock() {
&lt;br&gt;&amp;gt;            public Object call(Connection c, Block proc) throws SQLException {
&lt;br&gt;&amp;gt;                ResultSet results = null;
&lt;br&gt;&amp;gt;                try {
&lt;br&gt;&amp;gt;                    String table_name = rubyApi.convertToRubyString(args[0]).getUnicodeValue();
&lt;br&gt;&amp;gt;                    String schemaName = null;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    int index = table_name.indexOf(&amp;quot;.&amp;quot;);
&lt;br&gt;&amp;gt;                    if(index != -1) {
&lt;br&gt;&amp;gt;                        schemaName = table_name.substring(0, index);
&lt;br&gt;&amp;gt;                        table_name = table_name.substring(index + 1);
&lt;br&gt;&amp;gt;                    }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    DatabaseMetaData metadata = c.getMetaData();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    if(args.length &amp;gt; 2 &amp;&amp; schemaName == null) schemaName = toStringOrNull(args[2]);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    if (schemaName != null) schemaName = caseConvertIdentifierForJdbc(metadata, schemaName);
&lt;br&gt;&amp;gt;                    table_name = caseConvertIdentifierForJdbc(metadata, table_name);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The problem is that the schema name is corectly parsed from the table name
&lt;br&gt;&amp;gt; but then it's unconditionally replaced by the schema name of the current user.
&lt;br&gt;&amp;gt; The commands should get rearranged like this:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    String table_name = rubyApi.convertToRubyString(args[0]).getUnicodeValue();
&lt;br&gt;&amp;gt;                    String schemaName = null;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    DatabaseMetaData metadata = c.getMetaData();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    int index = table_name.indexOf(&amp;quot;.&amp;quot;);
&lt;br&gt;&amp;gt;                    if(index != -1) {
&lt;br&gt;&amp;gt;                        schemaName = table_name.substring(0, index);
&lt;br&gt;&amp;gt;                        table_name = table_name.substring(index + 1);
&lt;br&gt;&amp;gt;                    } else {
&lt;br&gt;&amp;gt;                        if(args.length &amp;gt; 2) schemaName = args[2].toString();
&lt;br&gt;&amp;gt;                    }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;                    if (schemaName != null) schemaName = caseConvertIdentifierForJdbc(metadata, schemaName);
&lt;br&gt;&amp;gt;                    table_name = caseConvertIdentifierForJdbc(metadata, table_name);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That means to read the meta data before the check for a schema part in the
&lt;br&gt;&amp;gt; table name, and then use the schema from the meta data only if no schema
&lt;br&gt;&amp;gt; name was found.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Best regards,
&lt;br&gt;&amp;gt; Andreas
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Problems-with-table-name-quoting-in-ActiveRecord-JDBC-Adapter-%3E-0.9.0-tp26193773p26201104.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26200744</id>
	<title>Re: Load path issues inside jar / external app</title>
	<published>2009-11-04T09:24:52Z</published>
	<updated>2009-11-04T09:24:52Z</updated>
	<author>
		<name>Nick Sieger-2</name>
	</author>
	<content type="html">On Wed, Nov 4, 2009 at 11:07 AM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200744&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; One more thing - what's the state of embedding gems in a jar, where the gem
&lt;br&gt;&amp;gt; includes its own java code in a jar?  I'm trying to use the
&lt;br&gt;&amp;gt; activerecord-jdbc-adapter inside a spring application where all my ruby code
&lt;br&gt;&amp;gt; and dependent ruby gems are packaged in a jar (or jars).   However
&lt;br&gt;&amp;gt; activerecord-jdbc can't load it's java classes:
&lt;br&gt;&amp;gt; `class_eval': cannot load Java class jdbc_adapter.JdbcConnectionFactory
&lt;br&gt;&amp;gt; (NameError)
&lt;br&gt;&amp;gt; I'm not surprised it's not working, but I'm not sure what the best
&lt;br&gt;&amp;gt; solution is.  Should I just copy jdbc_adapter_internal.jar (used internally
&lt;br&gt;&amp;gt; by the activerecord-jdbc gem) out from under the activerecord-jdbc directory
&lt;br&gt;&amp;gt; to someplace in my classpath?
&lt;/div&gt;&lt;br&gt;I think better would be to un-jar the contents of the jar into another
&lt;br&gt;jar. There's also the problem that the jdbc adapter code does a
&lt;br&gt;&amp;quot;require 'jdbc_adapter/jdbc_adapter_internal'&amp;quot; which means that you
&lt;br&gt;might have to put an empty 'jdbc_adapter/jdbc_adapter_internal.rb&amp;quot;
&lt;br&gt;file inside your jar as well.
&lt;br&gt;&lt;br&gt;The relevant JIRA is &lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-3299&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-3299&lt;/a&gt;. If we
&lt;br&gt;can't find a solution to jars-in-jars, we might need to build a gem
&lt;br&gt;re-packaging solution that takes care of the above for you.
&lt;br&gt;&lt;br&gt;/Nick
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Steve
&lt;br&gt;&amp;gt; On Wed, Nov 4, 2009 at 10:28 AM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200744&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Yes I had Spring load the scripts from a classpath.   I've worked around
&lt;br&gt;&amp;gt;&amp;gt; the issue by removing the File.dirname(__FILE__) bits from my code.  Instead
&lt;br&gt;&amp;gt;&amp;gt; I specify from the root of the classpath:  'require &amp;quot;path/to/ruby/file&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt; where the directory &amp;quot;path&amp;quot; is on the root of the classpath.  I can do this
&lt;br&gt;&amp;gt;&amp;gt; because it's all my code and not that many files to modify.
&lt;br&gt;&amp;gt;&amp;gt; I'm still playing around with it; will update if I find anything out.
&lt;br&gt;&amp;gt;&amp;gt; Steve
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Wed, Nov 4, 2009 at 8:28 AM, Yoko Harada &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200744&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yokolet@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Nov 3, 2009 at 9:35 AM, Nick Sieger &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200744&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; On Mon, Nov 2, 2009 at 4:03 PM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200744&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; I'm trying to package some ruby code for running inside spring batch.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;  I'm
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; using the spring dynamic language bean feature to load ruby classes
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; from
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; files on the class path.  The problem is these ruby files require
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; other
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; files via File.dirname(__FILE__).  That's not working.  What's the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; best way
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; to package up a bunch of jruby code for running inside a java
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; application,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; such that the jruby files can require other jruby files?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Steve
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Did Spring load Ruby scripts from a classpath? If so, I might have got
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; an error from the same reason.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; What is the value of __FILE__? Even with __FILE__ set to a file: URL
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; of a path inside a jar file, typical Rubyisms like you indicate should
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; be working. If you can illustrate what is failing, that would help;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; there might be a bug. Also indicate what version of JRuby you're
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; using. Some of the bugs related to file: URLs and paths have been
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; fixed in recent releases.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I haven't figured out what's wrong with that, but __FILE__ doesn't
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; work when a script is loaded from a  classpath. For example, when I
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; set all necessary all classapths and load test/test_file.rb from the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; classpath, evaluation failed because the error below at the line
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;expect = File.read(__FILE__)[0..100]&amp;quot;:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Loaded suite -
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Started
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; .................................E.......................
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Finished in 2.153 seconds.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;  1) Error:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; test_file_url(TestFile):
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Errno::ENOENT: No such file or directory - File not found - test_file.rb
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    test_file.rb:926:in `initialize'
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    test_file.rb:926:in `test_file_url'
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; 57 tests, 293 assertions, 0 failures, 1 errors
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; However, when I read test_file.rb from an absolute path, it worked
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; well. This happens in trunk version as well. If this should work even
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; when scripts are loaded from classpath, there might be a bug.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; -Yoko
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Cheers,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; /Nick
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Load-path-issues-inside-jar---external-app-tp26171542p26200744.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26200333</id>
	<title>Re: Load path issues inside jar / external app</title>
	<published>2009-11-04T09:07:26Z</published>
	<updated>2009-11-04T09:07:26Z</updated>
	<author>
		<name>steve_molitor</name>
	</author>
	<content type="html">One more thing - what&amp;#39;s the state of embedding gems in a jar, where the gem includes its own java code in a jar?  I&amp;#39;m trying to use the activerecord-jdbc-adapter inside a spring application where all my ruby code and dependent ruby gems are packaged in a jar (or jars).   However activerecord-jdbc can&amp;#39;t load it&amp;#39;s java classes:&lt;div&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;`class_eval&amp;#39;: cannot load Java class jdbc_adapter.JdbcConnectionFactory (NameError)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m not surprised it&amp;#39;s not working, but I&amp;#39;m not sure what the best solution is.  Should I just copy jdbc_adapter_internal.jar (used internally by the activerecord-jdbc gem) out from under the activerecord-jdbc directory to someplace in my classpath?&lt;br&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;Steve&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 4, 2009 at 10:28 AM, Steve Molitor &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200333&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
Yes I had Spring load the scripts from a classpath.   I&amp;#39;ve worked around the issue by removing the File.dirname(__FILE__) bits from my code.  Instead I specify from the root of the classpath:  &amp;#39;require &amp;quot;path/to/ruby/file&amp;quot; where the directory &amp;quot;path&amp;quot; is on the root of the classpath.  I can do this because it&amp;#39;s all my code and not that many files to modify.&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m still playing around with it; will update if I find anything out.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#888888&quot;&gt;Steve&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 4, 2009 at 8:28 AM, Yoko Harada &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200333&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yokolet@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;&lt;div&gt;On Tue, Nov 3, 2009 at 9:35 AM, Nick Sieger &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200333&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;


&amp;gt; On Mon, Nov 2, 2009 at 4:03 PM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26200333&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; I&amp;#39;m trying to package some ruby code for running inside spring batch.  I&amp;#39;m&lt;br&gt;
&amp;gt;&amp;gt; using the spring dynamic language bean feature to load ruby classes from&lt;br&gt;
&amp;gt;&amp;gt; files on the class path.  The problem is these ruby files require other&lt;br&gt;
&amp;gt;&amp;gt; files via File.dirname(__FILE__).  That&amp;#39;s not working.  What&amp;#39;s the best way&lt;br&gt;
&amp;gt;&amp;gt; to package up a bunch of jruby code for running inside a java application,&lt;br&gt;
&amp;gt;&amp;gt; such that the jruby files can require other jruby files?&lt;br&gt;
&amp;gt;&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&amp;gt; Steve&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Did Spring load Ruby scripts from a classpath? If so, I might have got&lt;br&gt;
an error from the same reason.&lt;br&gt;
&lt;div&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What is the value of __FILE__? Even with __FILE__ set to a file: URL&lt;br&gt;
&amp;gt; of a path inside a jar file, typical Rubyisms like you indicate should&lt;br&gt;
&amp;gt; be working. If you can illustrate what is failing, that would help;&lt;br&gt;
&amp;gt; there might be a bug. Also indicate what version of JRuby you&amp;#39;re&lt;br&gt;
&amp;gt; using. Some of the bugs related to file: URLs and paths have been&lt;br&gt;
&amp;gt; fixed in recent releases.&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;I haven&amp;#39;t figured out what&amp;#39;s wrong with that, but __FILE__ doesn&amp;#39;t&lt;br&gt;
work when a script is loaded from a  classpath. For example, when I&lt;br&gt;
set all necessary all classapths and load test/test_file.rb from the&lt;br&gt;
classpath, evaluation failed because the error below at the line&lt;br&gt;
&amp;quot;expect = File.read(__FILE__)[0..100]&amp;quot;:&lt;br&gt;
&lt;br&gt;
Loaded suite -&lt;br&gt;
Started&lt;br&gt;
.................................E.......................&lt;br&gt;
Finished in 2.153 seconds.&lt;br&gt;
&lt;br&gt;
  1) Error:&lt;br&gt;
test_file_url(TestFile):&lt;br&gt;
Errno::ENOENT: No such file or directory - File not found - test_file.rb&lt;br&gt;
    test_file.rb:926:in `initialize&amp;#39;&lt;br&gt;
    test_file.rb:926:in `test_file_url&amp;#39;&lt;br&gt;
&lt;br&gt;
57 tests, 293 assertions, 0 failures, 1 errors&lt;br&gt;
&lt;br&gt;
However, when I read test_file.rb from an absolute path, it worked&lt;br&gt;
well. This happens in trunk version as well. If this should work even&lt;br&gt;
when scripts are loaded from classpath, there might be a bug.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
-Yoko&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Cheers,&lt;br&gt;
&amp;gt; /Nick&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt; To unsubscribe from this list, please visit:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Load-path-issues-inside-jar---external-app-tp26171542p26200333.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26199925</id>
	<title>Setting java.library.path in JRuby</title>
	<published>2009-11-04T08:43:21Z</published>
	<updated>2009-11-04T08:43:21Z</updated>
	<author>
		<name>Simon Chiang</name>
	</author>
	<content type="html">I&amp;#39;m attempting to use a JNI provided by somebody else (CLIPS).  Basically I need to require a jar and then include a Java class into my JRuby environment.  When my folder is setup like this it all works:&lt;br&gt;&lt;br&gt;  script.rb&lt;br&gt;
  CLIPSJNI.jar&lt;br&gt;  libCLIPSJNI.jnilib&lt;br&gt;&lt;br&gt;  [script.rb]&lt;br&gt;  include Java&lt;br&gt;  require &amp;#39;CLIPSJNI.jar&amp;#39;&lt;br&gt;  include_class &amp;#39;CLIPSJNI.Environment&amp;#39;&lt;br&gt;  puts Environment&lt;br&gt;&lt;br&gt;  % jruby script.rb&lt;br&gt;  Java::CLIPSJNI::Environment&lt;br&gt;
&lt;br&gt;However when I setup like this I get an error:&lt;br&gt;&lt;br&gt;  script.rb&lt;br&gt;  lib/&lt;br&gt;    CLIPSJNI.jar&lt;br&gt;    libCLIPSJNI.jnilib&lt;br&gt;&lt;br&gt;  % jruby script.rb&lt;br&gt;  (eval):1:in `include_class&amp;#39;: cannot link Java class CLIPSJNI.Environment, probable missing dependency: no&lt;br&gt;
  CLIPSJNI in java.library.path (NameError)&lt;br&gt;&lt;br&gt;I can fix it by setting java.library.path from the command line:&lt;br&gt;&lt;br&gt;  % jruby -J-Djava.library.path=lib clips.rb &lt;br&gt;  Java::CLIPSJNI::Environment&lt;br&gt;&lt;br&gt;So how can I set java.library.path within my script so I don&amp;#39;t need the command line flag?  I&amp;#39;ve tried:&lt;br&gt;
&lt;br&gt;  current = java.lang.System.getProperty(&amp;quot;java.library.path&amp;quot;)&lt;br&gt;  java.lang.System.setProperty(&amp;quot;java.library.path&amp;quot;, &amp;quot;#{current}:#{File.expand_path(&amp;#39;lib&amp;#39;)}&amp;quot;);&lt;br&gt;&lt;br&gt;And:&lt;br&gt;&lt;br&gt;  java.lang.System.load(File.expand_path(&amp;#39;lib/libCLIPSJNI.jnilib&amp;#39;));&lt;br&gt;
&lt;br&gt;No luck so far.  Any ideas?  Thanks.&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Setting-java.library.path-in-JRuby-tp26199925p26199925.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26199656</id>
	<title>Re: Load path issues inside jar / external app</title>
	<published>2009-11-04T08:28:46Z</published>
	<updated>2009-11-04T08:28:46Z</updated>
	<author>
		<name>steve_molitor</name>
	</author>
	<content type="html">Yes I had Spring load the scripts from a classpath.   I&amp;#39;ve worked around the issue by removing the File.dirname(__FILE__) bits from my code.  Instead I specify from the root of the classpath:  &amp;#39;require &amp;quot;path/to/ruby/file&amp;quot; where the directory &amp;quot;path&amp;quot; is on the root of the classpath.  I can do this because it&amp;#39;s all my code and not that many files to modify.&lt;div&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m still playing around with it; will update if I find anything out.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Steve&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 4, 2009 at 8:28 AM, Yoko Harada &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26199656&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yokolet@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div class=&quot;im&quot;&gt;On Tue, Nov 3, 2009 at 9:35 AM, Nick Sieger &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26199656&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nicksieger@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;

&amp;gt; On Mon, Nov 2, 2009 at 4:03 PM, Steve Molitor &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26199656&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stevemolitor@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; I&amp;#39;m trying to package some ruby code for running inside spring batch.  I&amp;#39;m&lt;br&gt;
&amp;gt;&amp;gt; using the spring dynamic language bean feature to load ruby classes from&lt;br&gt;
&amp;gt;&amp;gt; files on the class path.  The problem is these ruby files require other&lt;br&gt;
&amp;gt;&amp;gt; files via File.dirname(__FILE__).  That&amp;#39;s not working.  What&amp;#39;s the best way&lt;br&gt;
&amp;gt;&amp;gt; to package up a bunch of jruby code for running inside a java application,&lt;br&gt;
&amp;gt;&amp;gt; such that the jruby files can require other jruby files?&lt;br&gt;
&amp;gt;&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&amp;gt; Steve&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Did Spring load Ruby scripts from a classpath? If so, I might have got&lt;br&gt;
an error from the same reason.&lt;br&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What is the value of __FILE__? Even with __FILE__ set to a file: URL&lt;br&gt;
&amp;gt; of a path inside a jar file, typical Rubyisms like you indicate should&lt;br&gt;
&amp;gt; be working. If you can illustrate what is failing, that would help;&lt;br&gt;
&amp;gt; there might be a bug. Also indicate what version of JRuby you&amp;#39;re&lt;br&gt;
&amp;gt; using. Some of the bugs related to file: URLs and paths have been&lt;br&gt;
&amp;gt; fixed in recent releases.&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;I haven&amp;#39;t figured out what&amp;#39;s wrong with that, but __FILE__ doesn&amp;#39;t&lt;br&gt;
work when a script is loaded from a  classpath. For example, when I&lt;br&gt;
set all necessary all classapths and load test/test_file.rb from the&lt;br&gt;
classpath, evaluation failed because the error below at the line&lt;br&gt;
&amp;quot;expect = File.read(__FILE__)[0..100]&amp;quot;:&lt;br&gt;
&lt;br&gt;
Loaded suite -&lt;br&gt;
Started&lt;br&gt;
.................................E.......................&lt;br&gt;
Finished in 2.153 seconds.&lt;br&gt;
&lt;br&gt;
  1) Error:&lt;br&gt;
test_file_url(TestFile):&lt;br&gt;
Errno::ENOENT: No such file or directory - File not found - test_file.rb&lt;br&gt;
    test_file.rb:926:in `initialize&amp;#39;&lt;br&gt;
    test_file.rb:926:in `test_file_url&amp;#39;&lt;br&gt;
&lt;br&gt;
57 tests, 293 assertions, 0 failures, 1 errors&lt;br&gt;
&lt;br&gt;
However, when I read test_file.rb from an absolute path, it worked&lt;br&gt;
well. This happens in trunk version as well. If this should work even&lt;br&gt;
when scripts are loaded from classpath, there might be a bug.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
-Yoko&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Cheers,&lt;br&gt;
&amp;gt; /Nick&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt; To unsubscribe from this list, please visit:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Load-path-issues-inside-jar---external-app-tp26171542p26199656.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26199540</id>
	<title>Re: [ANN] JRuby 1.4.0 Released</title>
	<published>2009-11-04T08:20:55Z</published>
	<updated>2009-11-04T08:20:55Z</updated>
	<author>
		<name>James Herdman</name>
	</author>
	<content type="html">Hi Charlie.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;ve filed a bug and am working with Vladimir Sizikov to isolate the issue here: &lt;a href=&quot;http://jira.codehaus.org/browse/JRUBY-4212&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JRUBY-4212&lt;/a&gt;&lt;/div&gt;&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you for your response though. It&amp;#39;s much appreciated.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;James&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Nov 4, 2009 at 1:49 AM, Charles Oliver Nutter &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26199540&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;headius@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div class=&quot;im&quot;&gt;On Tue, Nov 3, 2009 at 7:18 PM, James Herdman &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26199540&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;james.herdman@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;


&amp;gt; Hi friends.&lt;br&gt;
&amp;gt; Is anyone else having difficulty with Rails&amp;#39; gem related Rake tasks?&lt;br&gt;
&amp;gt; James&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;What sort of trouble?&lt;br&gt;
&lt;br&gt;
- Charlie&lt;br&gt;
&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
    &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ANN--JRuby-1.4.0-Released-tp26172834p26199540.html" />
</entry>

</feed>
