francisco@ubuntu:~/realtravel/ext/data_local/jruby$ tar -zxf jruby-
bin-1.4.0.tar.gz
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ echo $PATH
/home/francisco/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
sbin:/bin:/usr/games:/home/francisco/bin
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ export PATH=$PATH:/
home/francisco/realtravel/ext/data_local/jruby/jruby-1.4.0/bin
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_16) [amd64-java]
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -S gem
install ruote json-jruby
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
Successfully installed rufus-json-0.2.0
Successfully installed rufus-cloche-0.1.15
Successfully installed rufus-dollar-1.0.2
Successfully installed rufus-lru-1.0.3
Successfully installed rufus-mnemo-1.1.1
Successfully installed rufus-scheduler-2.0.5
Successfully installed sexp_processor-3.0.3
Successfully installed ruby_parser-2.0.4
Successfully installed rufus-treechecker-1.0.3
Successfully installed ruote-2.1.7
Successfully installed json-jruby-1.2.2-universal-java-1.6
11 gems installed
Installing ri documentation for rufus-json-0.2.0...
Installing ri documentation for rufus-cloche-0.1.15...
Installing ri documentation for rufus-dollar-1.0.2...
Installing ri documentation for rufus-lru-1.0.3...
Installing ri documentation for rufus-mnemo-1.1.1...
Installing ri documentation for rufus-scheduler-2.0.5...
Installing ri documentation for sexp_processor-3.0.3...
Installing ri documentation for ruby_parser-2.0.4...
Installing ri documentation for rufus-treechecker-1.0.3...
Installing ri documentation for ruote-2.1.7...
Installing ri documentation for json-jruby-1.2.2-universal-java-1.6...
Installing RDoc documentation for rufus-json-0.2.0...
Installing RDoc documentation for rufus-cloche-0.1.15...
Installing RDoc documentation for rufus-dollar-1.0.2...
Installing RDoc documentation for rufus-lru-1.0.3...
Installing RDoc documentation for rufus-mnemo-1.1.1...
Installing RDoc documentation for rufus-scheduler-2.0.5...
Installing RDoc documentation for sexp_processor-3.0.3...
Installing RDoc documentation for ruby_parser-2.0.4...
Installing RDoc documentation for rufus-treechecker-1.0.3...
Installing RDoc documentation for ruote-2.1.7...
Installing RDoc documentation for json-jruby-1.2.2-universal-
java-1.6...
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ cd /home/francisco/
realtravel/rtsite/realtravel.com/
app/ bin/ db/ doc/ lib/
performance/ script/ stories/ tmp/ work/
assets/ config/ dependencies/ gems/ log/
public/ spec/ test/ vendor/
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ cd /home/francisco/
realtravel/rtsite/realtravel.com/lib/ruote/
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ more
test_ruote.rb
require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'
$engine =
Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new('work')))
$engine.register_participant :alpha do |workitem|
workitem.fields['message'] = { 'text' => 'hello !', 'author' =>
'Alice' }
end
$engine.register_participant :bravo do |workitem|
puts "I received a message from #{workitem.fields['message']
['author']}"
end
$engine.variables['sync_process'] = Ruote.process_definition :name =>
'sync_process' do
alpha
bravo
end
wfid = $engine.launch($engine.variables['sync_process'], {})
puts "done: #{wfid}"
outcome = $engine.wait_for(wfid)
puts "result: #{outcome}"
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ ruby
test_ruote.rb
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- ruote (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from test_ruote.rb:2
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ sudo
gem install ruote yajl-ruby
[sudo] password for francisco:
Successfully installed rufus-json-0.2.0
Successfully installed rufus-cloche-0.1.15
Successfully installed ruote-2.1.7
Building native extensions. This could take a while...
Successfully installed yajl-ruby-0.7.4
4 gems installed
Installing ri documentation for rufus-json-0.2.0...
Installing ri documentation for rufus-cloche-0.1.15...
Installing ri documentation for ruote-2.1.7...
Installing ri documentation for yajl-ruby-0.7.4...
Installing RDoc documentation for rufus-json-0.2.0...
Installing RDoc documentation for rufus-cloche-0.1.15...
Installing RDoc documentation for ruote-2.1.7...
Installing RDoc documentation for yajl-ruby-0.7.4...
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ ruby
test_ruote.rb
done: 20100312-biramopipe
I received a message from Alice
result: _rev0put_at2010-03-12 18:20:44.242301 UTCwfid20100312-
biramopipe_id11611!70280487916780!2010-03-12!1268418044.242250!
011actionterminatedworkitemparticipant_namebravofields__result__authorAlicetexthello !
messageauthorAlicetexthello !feisub_wfidwfid20100312-
biramopipeengine_idengineexpid0_1typemsgsfeisub_wfidwfid20100312-
biramopipeengine_idengineexpid0
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ jruby -
S test_ruote.rb
Exception in thread "Thread-1" java.lang.NullPointerException
at org.jruby.RubyFile.flock(RubyFile.java:297)
at org.jruby.RubyFile$i_method_1_0$RUBYINVOKER$flock.call(org/jruby/
RubyFile$i_method_1_0$RUBYINVOKER$flock.gen)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
147)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.IfNode.interpret(IfNode.java:119)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
at
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:
147)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:98)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:
317)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:
268)
at org.jruby.runtime.Block.yield(Block.java:194)
at org.jruby.libraries.ThreadLibrary
$Mutex.synchronize(ThreadLibrary.java:167)
at org.jruby.libraries.ThreadLibrary$Mutex$i_method_0_0$RUBYINVOKER
$synchronize.call(org/jruby/libraries/ThreadLibrary$Mutex
$i_method_0_0$RUBYINVOKER$synchronize.gen)
at
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:
116)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
123)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:
64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
266)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
209)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
360)
at
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:
238)
at
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:
253)
at
org.jruby.ast.FCallThreeArgBlockNode.interpret(FCallThreeArgBlockNode.java:
36)
at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
173)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
169)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
310)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
149)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
173)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
169)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
310)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
149)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
173)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
169)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
310)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
149)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.IfNode.interpret(IfNode.java:111)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
173)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
169)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
310)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
149)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
136)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
153)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
107)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:85)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:
136)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
153)
at
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:
290)
at
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
109)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:85)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:
317)
done: 20100312-fumirusa
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:
305)
at org.jruby.runtime.BlockBody.call(BlockBody.java:72)
at org.jruby.runtime.BlockBody.call(BlockBody.java:78)
at org.jruby.runtime.Block.call(Block.java:89)
at org.jruby.RubyProc.call(RubyProc.java:221)
at org.jruby.RubyProc.call(RubyProc.java:204)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:94)
at java.lang.Thread.run(Thread.java:619)
sorry for the late reply, I had to install Ubuntu somewhere in order
to reproduce the issue.
The fix is in rufus-cloche 0.1.16
(http://rubygems.org/gems/rufus-cloche) and in there :
http://github.com/jmettraux/ruote/commit/8c6b60dfee7dcce79f553d7085171485d4dabe0f
That means that your engine initialization line will have to look like :
---8<---
$engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new('work',
'cloche_nolock' => true)))
--->8---
That will disable flock for your storage.
This also implies that having concurrent workers for that storage will
not be possible (same restriction as for Windows).
I don't know if a later version of JRuby will fix the issue (maybe
it's that one http://jira.codehaus.org/browse/JRUBY-4386). We'll see.
Many thanks for reporting the issue. The fix will be part of the
upcoming ruote 2.1.8 release.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
pushd ~/realtravel/ext/data_local/jruby/jruby-1.4.0/
bin/ docs/ lib/ samples/ share/ tool/
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ pushd ~/
realtravel/ext/data_local/jruby/
~/realtravel/ext/data_local/jruby ~/realtravel/rtsite/realtravel.com/
lib/ruote
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ ls -l
total 12252
drwxr-xr-x 8 francisco francisco 4096 2010-03-12 10:16 jruby-1.4.0
-rw-r--r-- 1 francisco francisco 12525478 2010-03-12 10:15 jruby-
bin-1.4.0.tar.gz
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ rm -rf jruby-1.4.0
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -version
-bash: /home/francisco/realtravel/ext/data_local/jruby/jruby-1.4.0/bin/
jruby: No such file or directory
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ tar -zxf jruby-
bin-1.4.0.tar.gz
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -version
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_16) [amd64-java]
-e:1: undefined local variable or method `rsion' for main:Object
(NameError)
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -S gem
^Cfrancisco@ubuntu:~/realtravel/ext/data_local/jruby$ ^C
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -S gem
install ruote jruby-json
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
Successfully installed rufus-json-0.2.0
Successfully installed rufus-cloche-0.1.16
Successfully installed rufus-dollar-1.0.2
Successfully installed rufus-lru-1.0.3
Successfully installed rufus-mnemo-1.1.1
Successfully installed rufus-scheduler-2.0.5
Successfully installed sexp_processor-3.0.3
Successfully installed ruby_parser-2.0.4
Successfully installed rufus-treechecker-1.0.3
Successfully installed ruote-2.1.7
ERROR: could not find gem jruby-json locally or in a repository
10 gems installed
Installing ri documentation for rufus-json-0.2.0...
Installing ri documentation for rufus-cloche-0.1.16...
Installing ri documentation for rufus-dollar-1.0.2...
Installing ri documentation for rufus-lru-1.0.3...
Installing ri documentation for rufus-mnemo-1.1.1...
Installing ri documentation for rufus-scheduler-2.0.5...
Installing ri documentation for sexp_processor-3.0.3...
Installing ri documentation for ruby_parser-2.0.4...
Installing ri documentation for rufus-treechecker-1.0.3...
Installing ri documentation for ruote-2.1.7...
Installing RDoc documentation for rufus-json-0.2.0...
Installing RDoc documentation for rufus-cloche-0.1.16...
Installing RDoc documentation for rufus-dollar-1.0.2...
Installing RDoc documentation for rufus-lru-1.0.3...
Installing RDoc documentation for rufus-mnemo-1.1.1...
Installing RDoc documentation for rufus-scheduler-2.0.5...
Installing RDoc documentation for sexp_processor-3.0.3...
Installing RDoc documentation for ruby_parser-2.0.4...
Installing RDoc documentation for rufus-treechecker-1.0.3...
Installing RDoc documentation for ruote-2.1.7...
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ jruby -S gem
install json-jruby
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
Successfully installed json-jruby-1.2.3-universal-java-1.6
1 gem installed
Installing ri documentation for json-jruby-1.2.3-universal-java-1.6...
Installing RDoc documentation for json-jruby-1.2.3-universal-
java-1.6...
francisco@ubuntu:~/realtravel/ext/data_local/jruby$ popd
~/realtravel/rtsite/realtravel.com/lib/ruote
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ cat
test_ruote.rb
require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'
$engine =
Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new('work')))
$engine.register_participant :alpha do |workitem|
workitem.fields['message'] = { 'text' => 'hello !', 'author' =>
'Alice' }
end
$engine.register_participant :bravo do |workitem|
puts "I received a message from #{workitem.fields['message']
['author']}"
end
$engine.variables['sync_process'] = Ruote.process_definition :name =>
'sync_process' do
alpha
bravo
end
wfid = $engine.launch($engine.variables['sync_process'], {})
puts "done: #{wfid}"
outcome = $engine.wait_for(wfid)
puts "result: #{outcome}"francisco@ubuntu:~/realtravel/rtsite/
realtravel.com/lib/ruote$ ruby ./test_ruote.rb
done: 20100314-besobohodo
I received a message from Alice
I received a message from Alice
I received a message from Alice
result: _rev0put_at2010-03-14 17:02:29.405016 UTCwfid20100314-
besobohodo_id16162!70215558061860!2010-03-14!1268586149.404999!
029actionterminatedworkitemparticipant_namebravofields__result__authorAlicetexthello !
messageauthorAlicetexthello !feisub_wfidwfid20100314-
besobohodoengine_idengineexpid0_1typemsgsfeisub_wfidwfid20100314-
besobohodoengine_idengineexpid0
francisco@ubuntu:~/realtravel/rtsite/realtravel.com/lib/ruote$ jruby -
S ./test_ruote.rb
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:
305)
at org.jruby.runtime.BlockBody.call(BlockBody.java:72)
at org.jruby.runtime.BlockBody.call(BlockBody.java:78)
at org.jruby.runtime.Block.call(Block.java:89)
at org.jruby.RubyProc.call(RubyProc.java:221)
at org.jruby.RubyProc.call(RubyProc.java:204)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:94)
at java.lang.Thread.run(Thread.java:619)
done: 20100314-bodoshisutsu
On Mar 13, 10:27 pm, John Mettraux <jmettr...@openwfe.org> wrote:
> Hello Kiko,
>
> sorry for the late reply, I had to install Ubuntu somewhere in order
> to reproduce the issue.
>
> The fix is in rufus-cloche 0.1.16
> (http://rubygems.org/gems/rufus-cloche) and in there :
>
> http://github.com/jmettraux/ruote/commit/8c6b60dfee7dcce79f553d708517...
>
> That means that your engine initialization line will have to look like :
>
> ---8<---
> $engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::FsStorage.new('work',
> 'cloche_nolock' => true)))
> --->8---
>
> That will disable flock for your storage.
>
> This also implies that having concurrent workers for that storage will
> not be possible (same restriction as for Windows).
>
> I don't know if a later version of JRuby will fix the issue (maybe
> it's that onehttp://jira.codehaus.org/browse/JRUBY-4386). We'll see.
> support.http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
> support.http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
> at...
>
> read more »
Hello Francisco,
could we talk versions ?
I have :
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
on
Mac OS X 10.6.2 (Build 10C540)
and it works fine, no need for the 'cloche_nolock' parameter.
---8<---
jmettraux@siamese ~/w/ruote (ruote2.1)↑ $ ruby test/functional/test.rb -- --fs
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
Loaded suite test/functional/test
Started
..................................................................................................................................................................................................................................................................................................................................................
Finished in 131.718 seconds.
338 tests, 676 assertions, 0 failures, 0 errors
--->8---
(where --fs tells the test suite to use Ruote::FsStorage)
What are your versions ? Mac and Ubuntu please.
I have the exact same OS build number and jruby version, but I needed
to use the cloche_nolock parameter in both cases, otherwise the
exception repeated.
On Mar 14, 5:38 pm, John Mettraux <jmettr...@openwfe.org> wrote: