Wrong var name inside thread dosent popup exception. With -d optino enabled.
----------------------------------------------------------------------------
Key: JRUBY-1417
URL: http://jira.codehaus.org/browse/JRUBY-1417
Project: JRuby
Issue Type: Bug
Components: Interpreter
Affects Versions: JRuby 1.0.1
Environment: Debian Linux, Java 6.
Reporter: ruivaldo neto
Priority: Critical
This method, when used with MRI pop up´s a exception:
##
# Executar reenvio
# Pega o primeiro item da lista de reenvio a cada uma hora
# E tenta enviar. Se conseguir, remove-o da lista.
def executar_reenvio()
while true
item_reenvio = proximo_reenvio()
#$log.debug(item_reenvio.inspect)
unless item_reenvio.nil? || item_reenvio.empty?
#$log.info("Reenviando: #{item_reenvio[:endereco]}
#{item_reenvio[:parametros].inspect}")
resposta = self.reenvio(item_reenvio[:endereco],
item_reenvio[:parametros])
if resposta == 200
## This line is bogus, look: item_reeEnvio
$log.info("Reenviado com exito: #{item_reeenvio[:endereco]} -
#{item_reenvio[:parametros].inspect}")
##
prosseguir_lista_reenvio()
$log.debug(carregar_lista_reenvio())
else
#$log.info("Falha ao reenviar: #{item_reenvio[:endereco]} -
#{item_reenvio[:parametros].inspect.inspect}")
end
else
#$log.info("Nao ha items setados para reenvio")
end
sleep_minutos(10) # Dorme por uma hora
end
end
00S00:/home/ruivaldo/Codes/Ruby/ColetorSisope# ruby -d sisope.rb
I, [10:39:10#3299] INFO -- : Iniciando coletor
Exception `NameError' at sisope.rb:150 - undefined local variable or method
`item_reeenvio' for #<Coletor:0xa7be99a0>
sisope.rb:150:in `executar_reenvio': undefined local variable or method
`item_reeenvio' for #<Coletor:0xa7be99a0> (NameError)
from sisope.rb:250:in `iniciar_coleta'
from sisope.rb:250:in `initialize'
from sisope.rb:250:in `new'
from sisope.rb:250:in `iniciar_coleta'
from sisope.rb:264
00S00:/home/ruivaldo/Codes/Ruby/ColetorSisope#
But with jruby 1.0.1, with -d enable, it just kills the thread and keeps
executing:
00S00:/home/ruivaldo/Codes/Ruby/ColetorSisope# ./jruby/bin/jruby -v
ruby 1.8.5 (2007-08-23 rev 4201) [i386-jruby1.0.1]
00S00:/home/ruivaldo/Codes/Ruby/ColetorSisope# ./jruby/bin/jruby -d sisope.rb
/home/ruivaldo/jruby/lib/ruby/1.8/net/http.rb:280 warning: global variable `$;'
not initialized
file:/home/ruivaldo/jruby/lib/jruby.jar!/builtin/javasupport/proxy/concrete.rb:5
warning: `*' interpreted as argument prefix
file:/home/ruivaldo/jruby/lib/jruby.jar!/builtin/javasupport/proxy/interface.rb:7
warning: `&' interpreted as argument prefix
I, [10:39:49#22591049] INFO -- : Iniciando coletor
<script>:0 warning: Useless use of a literal in void context.
<script>:0 warning: Useless use of a literal in void context.
The complete source code is disponible into:
http://pastebin.com/f6f72ce90
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email