Newbie question: Having problems while launching process definitions in ruote-web2

23 views
Skip to first unread message

pranav

unread,
May 15, 2009, 7:12:49 AM5/15/09
to Ruote (OpenWFEru) users
Hi,
I apologize to have posted the same question on different thread.
I am working on windows, JRuby 1.2.0, Rails 2.3.2.
I am using ruote-web2 and trying to launch a process definition.
The problem that I face is of activerecord losing connection when I
launch a process.
Previously when I was working with MS SQL Server, I thought it was
because of it that I was facing that error.
After reading on few threads I noticed that ruote-web2 is working fine
with MySQL.
So I now I am using MySQL as my DB. I have activerecord-jdbcmysql-
adapter and jdbc-mysql driver gems installed. It performs db:migrate,
data:populate correctly. I am able to create a new user, define a new
process.
But, I still get the same error when I try to launch any process
definition (even SimpleSequence and LeaveRequest)
Following is the error -

ActiveRecord::ConnectionNotEstablished in ProcessesController#show

Dump--------------------------------------------------------------------------------------------------------------------------------------

C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:70:in
`columns_with_query_cache'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1276:in `columns'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1289:in `column_names'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1302:in `column_methods_hash'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all_attributes_exists?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all_attributes_exists?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1847:in `method_missing'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
extras/expool/db_errorjournal.rb:106:in `get_error_log'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:324:in `process_statuses'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:320:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:320:in `process_statuses'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:369:in `process_status'
C:/Users/233686/Documents/NetBeansProjects/RailsApplication1/app/
controllers/processes_controller.rb:73:in `show'

--------------------------------------------------------------------------------------------------------------------------------------

Also, similare error is created with process_errors and ar_workitems
tables.

Yes I have googled a bit.. I have tried to look for solutions but
haven't found any.
Please help!

Thanks in advance.
Pranav

John Mettraux

unread,
May 15, 2009, 7:28:47 AM5/15/09
to openwfe...@googlegroups.com
On Fri, May 15, 2009 at 8:12 PM, pranav <rpra...@gmail.com> wrote:
>
> I apologize to have posted the same question on different thread.
> I am working on windows, JRuby 1.2.0, Rails 2.3.2.
> I am using ruote-web2 and trying to launch a process definition.
> The problem that I face is of activerecord losing connection when I
> launch a process.
> Previously when I was working with MS SQL Server, I thought it was
> because of it that I was facing that error.
> After reading on few threads I noticed that ruote-web2 is working fine
> with MySQL.
> So I now I am using MySQL as my DB. I have activerecord-jdbcmysql-
> adapter and jdbc-mysql driver gems installed. It performs db:migrate,
> data:populate correctly. I am able to create a new user, define a new
> process.
> But, I still get the same error when I try to launch any process
> definition (even SimpleSequence and LeaveRequest)
> Following is the error -
>
> ActiveRecord::ConnectionNotEstablished in ProcessesController#show

Hi Pranav,

thanks for the detailed report, neat !

Could you please replace your lib/openwfe/extras/singlecon.rb with the one at :

http://gist.github.com/112174

and then observe the "reconnection" behaviour ?

This twisted version of singlecon is meant to ouput to stdout its
attempts at connection to the database. It should be informative.


Best regards,

--
John Mettraux - http://jmettraux.wordpress.com

pranav

unread,
May 15, 2009, 8:40:21 AM5/15/09
to Ruote (OpenWFEru) users
Hi John,
Thanks for the quick response..
I tried the singlecon.rb at http://gist.github.com/112174
I tried to use it as is.. It had some errors such as

uninitialized class variable @@connection in
OpenWFE::Extras::SingleConnectionMixin

With my limited Ruby knowledge I tried a few things to do away with
this error..
Once I was through I again received the same error of

ActiveRecord::ConnectionNotEstablished in ProcessesController#show

Also on the console
It dumps this infinite times--------

[1, #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1304a7c
@connection=#<ActiveRecord::ConnectionAdapters::JdbcConnection:
0x1e1b0e7 @adapter=#<ActiveRecord::ConnectionAdapters::JdbcAdapter:
0x1304a7c ...>, @connection=#<Java::ComMysqlJdbc::Connection:0x2516dc
@java_object=#<Java::JavaObject:0x1000323>>

[2, #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1304a7c
@connection=#<ActiveRecord::ConnectionAdapters::JdbcConnection:
0x1e1b0e7 @adapter=#<ActiveRecord::ConnectionAdapters::JdbcAdapter:
0x1304a7c ...>, @connection=#<Java::ComMysqlJdbc::Connection:0x2516dc
@java_object=#<Java::JavaObject:0x1000323>>
--------------------------------------------------------------------------------------------------------

Am I missing anything?
On a side note.. Is the MySQL version an issue?I am using MySQL
5.0.37.. Shall I update?


Thanks,
Pranav

On May 15, 4:28 pm, John Mettraux <jmettr...@openwfe.org> wrote:

John Mettraux

unread,
May 15, 2009, 9:10:52 AM5/15/09
to openwfe...@googlegroups.com
On Fri, May 15, 2009 at 9:40 PM, pranav <rpra...@gmail.com> wrote:
>
> I tried the singlecon.rb at http://gist.github.com/112174
> I tried to use it as is.. It had some errors such as
>
> uninitialized class variable @@connection in
> OpenWFE::Extras::SingleConnectionMixin
>
> With my limited Ruby knowledge I tried a few things to do away with
> this error..
> Once I was through

Too bad you're not explaining me how you "went through" :( That would
have helped.


> I again received the same error of
>
> ActiveRecord::ConnectionNotEstablished in ProcessesController#show
>
> Also on the console
> It dumps this infinite times--------
>
> [1, #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1304a7c
> @connection=#<ActiveRecord::ConnectionAdapters::JdbcConnection:
> 0x1e1b0e7 @adapter=#<ActiveRecord::ConnectionAdapters::JdbcAdapter:
> 0x1304a7c ...>, @connection=#<Java::ComMysqlJdbc::Connection:0x2516dc
> @java_object=#<Java::JavaObject:0x1000323>>

I have updated the gist :

http://gist.github.com/112174

Could you please try with that new version ?

When you hit the launch button, could you please tell how it behaves ?
I'm interested in output that look like :

[1, Ruote::ProcessError, ...

pranav

unread,
May 16, 2009, 11:41:11 AM5/16/09
to Ruote (OpenWFEru) users
Hi John,

I tried the new version of singlecon.rb.. The behavior is really
interesting..
When I try to launch the process for the first time it throws the
following error ( I think it is related to mongrel)

----------------------------------------------------------------------------------------------------------------------------------

Sat May 16 21:01:46 +0530 2009: Read error: #<NameError: uninitialized
constant ActionController::Dispatcher::FLAG>
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:105:in `const_missing'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:13:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/
rack/static.rb:31:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/urlmap.rb:48:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/
rack/log_tailer.rb:17:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/content_length.rb:13:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/chunked.rb:15:in `call'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:61:in
`process'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
mongrel.rb:159:in `process_client'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
mongrel.rb:158:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
mongrel.rb:158:in `process_client'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
mongrel.rb:285:in `run'
:1:in `initialize'
Sat May 16 21:01:46 +0530 2009: Client error: #<NoMethodError:
undefined method `close' for #<NameError:0x876d42>>
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/mongrel-1.1.5-java/lib/
mongrel.rb:196:in `run'
:1:in `initialize'
Exception in thread "Thread-28"
java.lang.ArrayIndexOutOfBoundsException: -1

at org.jruby.runtime.ThreadContext.popRubyClass
(ThreadContext.java:517)

at org.jruby.runtime.ThreadContext.postYield
(ThreadContext.java:1304)

at org.jruby.runtime.InterpretedBlock.post
(InterpretedBlock.java:113)

at org.jruby.runtime.InterpretedBlock.yield
(InterpretedBlock.java:184)

at org.jruby.runtime.BlockBody.call(BlockBody.java:65)

at org.jruby.runtime.BlockBody.call(BlockBody.java:71)

at org.jruby.runtime.Block.call(Block.java:80)

at org.jruby.RubyProc.call(RubyProc.java:204)

at org.jruby.RubyProc.call(RubyProc.java:187)

at org.jruby.internal.runtime.RubyRunnable.run
(RubyRunnable.java:90)

at java.lang.Thread.run(Thread.java:619)

----------------------------------------------------------------------------------------------------------------------------------

but the second time (with and w/o restarting mongrel) it throws the
following error -

----------------------------------------------------------------------------------------------------------------------------------
SystemStackError in ProcessesController#show ---- stack level too
deep

dump -

C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all_attributes_exists?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1991:in `all_attributes_exists?'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/base.rb:1847:in `method_missing'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
extras/expool/db_errorjournal.rb:106:in `get_error_log'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:324:in `process_statuses'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:320:in `each'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:320:in `process_statuses'
C:/pranav latest/1.2.0/lib/ruby/gems/1.8/gems/ruote-0.9.20/lib/openwfe/
engine/status_methods.rb:369:in `process_status'

----------------------------------------------------------------------------------------------------------------------------------

Unfortunately I am not getting any output/dump related to

[1, Ruote::ProcessError, ...

Above mentioned is all that I get..
Please suggest..


Thanks,
Pranav


On May 15, 6:10 pm, John Mettraux <jmettr...@openwfe.org> wrote:
> On Fri, May 15, 2009 at 9:40 PM, pranav <rprana...@gmail.com> wrote:
>
> > I tried the singlecon.rb athttp://gist.github.com/112174

John Mettraux

unread,
May 19, 2009, 1:51:59 AM5/19/09
to openwfe...@googlegroups.com
Hello,

sorry for the late reply. After a bit of fiddling :

http://github.com/jmettraux/ruote/commit/9fe7fbfa59597f6b6d98913288eae86968f9c192
http://github.com/jmettraux/ruote/commit/6e9e64f3d54520ada6a4f49d003fe426e6511cf8

I could reproduce your "connection not established" issue. I will
continue investigating. Meanwhile if you come across a solution,
please tell me.

pranav

unread,
May 19, 2009, 6:34:22 AM5/19/09
to Ruote (OpenWFEru) users
Hi John,

While looking at the dump, I found this line
vendor/plugins/will_paginate/lib/will_paginate/finder.rb:170:in
`method_missing_with_paginate'

Is the error "stack level too deep" related to a third party plugin
hooking on to activerecord?
So I googled a lil and here is an interesting read -
http://sod.lighthouseapp.com/projects/17958/tickets/223-infinite-loop-in-will_paginate-with-has_many-through

Is this related and of any help?


Thanks,
Pranav


On May 19, 10:51 am, John Mettraux <jmettr...@openwfe.org> wrote:
> Hello,
>
> sorry for the late reply. After a bit of fiddling :
>
>  http://github.com/jmettraux/ruote/commit/9fe7fbfa59597f6b6d98913288ea...
>  http://github.com/jmettraux/ruote/commit/6e9e64f3d54520ada6a4f49d003f...

John Mettraux

unread,
May 19, 2009, 7:00:32 AM5/19/09
to openwfe...@googlegroups.com
On Tue, May 19, 2009 at 7:34 PM, pranav <rpra...@gmail.com> wrote:
>
> Hi John,
>
> While looking at the dump, I found this line
> vendor/plugins/will_paginate/lib/will_paginate/finder.rb:170:in
> `method_missing_with_paginate'
>
> Is the error "stack level too deep" related to a third party plugin
> hooking on to activerecord?
> So I googled a lil and here is an interesting read -
> http://sod.lighthouseapp.com/projects/17958/tickets/223-infinite-loop-in-will_paginate-with-has_many-through
>
> Is this related and of any help?

Hello Pranav,

I cannot tell, I don't have the stack. It seems not related though.

I have encountered a "stack level too deep" issue and fixed it :
http://github.com/jmettraux/ruote/commit/6e9e64f3d54520ada6a4f49d003fe426e6511cf8
but it didn't appear in your report.

pranav

unread,
May 21, 2009, 6:45:15 AM5/21/09
to Ruote (OpenWFEru) users
Hi John,

http://github.com/jmettraux/ruote/commit/6e9e64f3d54520ada6a4f49d003fe426e6511cf8
has done the trick..
I downloaded it, tried it and was able to launch the process
definition :)
Thanks a ton for all the help and time.

Pranav



On May 19, 4:00 pm, John Mettraux <jmettr...@openwfe.org> wrote:
> On Tue, May 19, 2009 at 7:34 PM, pranav <rprana...@gmail.com> wrote:
>
> > Hi John,
>
> > While looking at the dump, I found this line
> > vendor/plugins/will_paginate/lib/will_paginate/finder.rb:170:in
> > `method_missing_with_paginate'
>
> > Is the error "stack level too deep" related to a third party plugin
> > hooking on to activerecord?
> > So I googled a lil and here is an interesting read -
> >http://sod.lighthouseapp.com/projects/17958/tickets/223-infinite-loop...
>
> > Is this related and of any help?
>
> Hello Pranav,
>
> I cannot tell, I don't have the stack. It seems not related though.
>
> I have encountered a "stack level too deep" issue and fixed it :http://github.com/jmettraux/ruote/commit/6e9e64f3d54520ada6a4f49d003f...
Reply all
Reply to author
Forward
0 new messages