Ehi, jruby 1.5, what's happen?

I’m upgraded a rails application from jruby 1.4.0 to jruby-1-5-1.
I’m using scaffolding to insert records in a database.
On myapp/product/new here is the error:

undefined method `application_backtrace’ for
#Java::OrgJcodingsException::EncodingException:0x3c8f03a5

Is it a jruby-1.5.1 problem?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 16 June 2010 09:17, Mauro [email protected] wrote:

I’m upgraded a rails application from jruby 1.4.0 to jruby-1-5-1.
I’m using scaffolding to insert records in a database.
On myapp/product/new here is the error:

undefined method `application_backtrace’ for
#Java::OrgJcodingsException::EncodingException:0x3c8f03a5

Is it a jruby-1.5.1 problem?

If I go to jruby-1.4.1 I have no problems so I think it’s a problem of
1.5 version.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

none knows about the problem?

On 16 June 2010 09:47, Mauro [email protected] wrote:

If I go to jruby-1.4.1 I have no problems so I think it’s a problem of
1.5 version.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

my two cents:

there are two problems:

first is some kind of encoding problems - which might be new to
jruby1.5 and the missing application_backtrace method.

I first would try to monkey patch
Java::OrgJcodingsException::EncodingException
to have the missing method and then look at the encoding problem.

regards Kristian

On Wed, Jun 16, 2010 at 9:38 PM, Mauro [email protected] wrote:

undefined method `application_backtrace’ for

  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 16 June 2010 18:31, kristian [email protected] wrote:

regards Kristian

Sorry for my ignorance but I don’t understand what have I do.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

somewhere before you get the error you need to add

class Java::OrgJcodingsException::EncodingException
def application_backtrace
print_stack_trace
end
end

this should print out the stacktrace into the console.

does this help ?

regards Kristian

On Thu, Jun 17, 2010 at 1:43 PM, Mauro [email protected] wrote:

to have the missing method and then look at the encoding problem.


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

yes, try it. Kristian

On Thu, Jun 17, 2010 at 2:21 PM, Mauro [email protected] wrote:

  @suppliers = Supplier.all.paginate :per_page => 8, :page => params[:page]
  @supplier = Supplier.find(params[:id])
  @supplier = Supplier.new
before the class SupplierController definition?


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’ve tried and now the error is undefined method
`framework_backtrace’, then I’ve changed ‘application_backtrace’ with
‘framework_backtrace’ in the code and the new error is
‘clean_backtrace’, I think there is a serious problem in jruby-1.5.1.

On 17 June 2010 11:04, kristian [email protected] wrote:

end
 # GET /suppliers.xml
 # GET /suppliers/1
 # GET /suppliers/new
 end

To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

sorry, I should have look into rails before.

so rails extends the standard exception class of ruby but it does not
for java exceptions that is why you see these missing methods error.

so basically there are four new methods:

  • clean_message
  • clean_backtrace
  • application_backtrace
  • framework_backtrace

so gave a bit too early. just implement these for methods.

whether this is jruby bug I do not know, maybe some of the jruby
developer can comment on this.

but did you see any java exception stacktrace in the console ??

Kristian

On Thu, Jun 17, 2010 at 2:52 PM, Mauro [email protected] wrote:

On Thu, Jun 17, 2010 at 2:21 PM, Mauro [email protected] wrote:

  @suppliers = Supplier.all.paginate :per_page => 8, :page => params[:page]
  @supplier = Supplier.find(params[:id])
  @supplier = Supplier.new
before the class SupplierController definition?

      =


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This is what I see on the console:

ActionView::TemplateError (undefined method `clean_backtrace’ for
#Java::OrgJcodingsException::EncodingException:0xa756b37) in
/home/user/jruby-1.5.1/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/templates/rescues/_trace.erb:

I want to say that with jruby-1.4.1 there are no problems.

On 17 June 2010 11:59, kristian [email protected] wrote:

On Thu, Jun 17, 2010 at 2:21 PM, Mauro [email protected] wrote:

  @suppliers = Supplier.all.paginate :per_page => 8, :page => params[:page]
  @supplier = Supplier.find(params[:id])
  @supplier = Supplier.new
before the class SupplierController definition?

      =

protect your privacy while searching the net: www.ixquick.com

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Can you share the code snippet that’s getting module_eval’d? The
parser is choking on something, it would be helpful to know what it is
so we can fix it or at a minimum generate a better error message.

Thanks,
/Nick

On Fri, Jul 9, 2010 at 6:36 AM, Klaus-dieter Gundermann
[email protected] wrote:

C:/Programme/NetBeans
org.jruby.lexer.yacc.RubyYaccLexer.getIdentifier(RubyYaccLexer.java:1062)
org.jruby.evaluator.ASTInterpreter.evalSimple(ASTInterpreter.java:147)
org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:259)
org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen:65535)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:199)
org.jruby.RubyArray.eachCommon(RubyArray.java:1630)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 17 June 2010 10:43, kristian [email protected] wrote:

does this help ?
The error raise when I call new method of a controller:

class SuppliersController < ApplicationController

GET /suppliers

GET /suppliers.xml

def index
#@suppliers = Supplier.all
@suppliers = Supplier.all.paginate :per_page => 8, :page =>
params[:page]

respond_to do |format|
  format.html # index.html.erb
  format.xml  { render :xml => @suppliers }
end

end

GET /suppliers/1

GET /suppliers/1.xml

def show
@supplier = Supplier.find(params[:id])

respond_to do |format|
  format.html # show.html.erb
  format.xml  { render :xml => @supplier }
end

end

GET /suppliers/new

GET /suppliers/new.xml

def new
@supplier = Supplier.new
@sectors = Sector.all
@categories = Category.all

respond_to do |format|
  format.html # new.html.erb
  format.xml  { render :xml => @supplier }
end

end

Should I put class Java::OrgJcodingsException::EncodingException
before the class SupplierController definition?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I just upgraded from Netbeans 6.8 with jRuby 1.4 to
Netbeans 6.9 with jRuby 1.5.0 on Windows

Running a simple unit test who tries to read data from the database
gave me the error to.

Here is the backtrace :

Test-unit version : 2.0.9 loaded
PLATFORM: java
C:/Programme/NetBeans
6.9/ruby/jruby-1.5.0/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3.2-java/lib/ruby-debug-base.rb:214
warning: tracing (e.g. set_trace_func) will not capture all events
without --debug flag

  1. Error:
    test_Lese_Artikelgruppe_130(ArtikelgruppeTest):
    Java::OrgJcodingsException::EncodingException: invalid code point value
    org.jcodings.specific.BaseUTF8Encoding.codeToMbcLength(BaseUTF8Encoding.java:80)
    org.jruby.lexer.yacc.RubyYaccLexer.isMultiByteChar(RubyYaccLexer.java:466)
    org.jruby.lexer.yacc.RubyYaccLexer.isIdentifierChar(RubyYaccLexer.java:456)
    org.jruby.lexer.yacc.RubyYaccLexer.getIdentifier(RubyYaccLexer.java:1062)
    org.jruby.lexer.yacc.RubyYaccLexer.identifier(RubyYaccLexer.java:1429)
    org.jruby.lexer.yacc.RubyYaccLexer.yylex(RubyYaccLexer.java:1033)
    org.jruby.lexer.yacc.RubyYaccLexer.advance(RubyYaccLexer.java:293)
    org.jruby.parser.DefaultRubyParser.yyparse(DefaultRubyParser.java:1380)
    org.jruby.parser.DefaultRubyParser.yyparse(DefaultRubyParser.java:1332)
    org.jruby.parser.DefaultRubyParser.parse(DefaultRubyParser.java:3986)
    org.jruby.parser.Parser.parse(Parser.java:111)
    org.jruby.parser.Parser.parse(Parser.java:82)
    org.jruby.parser.Parser.parse(Parser.java:74)
    org.jruby.Ruby.parseEval(Ruby.java:2289)
    org.jruby.evaluator.ASTInterpreter.evalSimple(ASTInterpreter.java:147)
    org.jruby.RubyObject.evalUnder(RubyObject.java:436)
    org.jruby.RubyObject.specificEval(RubyObject.java:388)
    org.jruby.RubyModule.module_eval(RubyModule.java:2077)
    org.jruby.RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.call(org/jruby/RubyModule$i_method_multi$RUBYFRAMEDINVOKER$module_eval.gen:65535)
    org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrNBlock.call(JavaMethod.java:283)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:186)
    org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:199)
    org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:118)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:221)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:188)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:186)
    org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:262)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:226)
    org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.IfNode.interpret(IfNode.java:119)
    org.jruby.ast.IfNode.interpret(IfNode.java:119)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.IfNode.interpret(IfNode.java:119)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
    org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:259)
    org.jruby.runtime.Block.yieldSpecific(Block.java:117)
    org.jruby.RubyHash$11.visit(RubyHash.java:1132)
    org.jruby.RubyHash.visitAll(RubyHash.java:579)
    org.jruby.RubyHash.iteratorVisitAll(RubyHash.java:1119)
    org.jruby.RubyHash.each(RubyHash.java:1130)
    org.jruby.RubyHash.each19(RubyHash.java:1150)
    org.jruby.RubyHash$i_method_0_0$RUBYFRAMEDINVOKER$each19.call(org/jruby/RubyHash$i_method_0_0$RUBYFRAMEDINVOKER$each19.gen:65535)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:299)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:117)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122)
    org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:156)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.IfNode.interpret(IfNode.java:117)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:138)
    org.jruby.javasupport.util.RuntimeHelpers$MethodMissingMethod.call(RuntimeHelpers.java:401)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:182)
    org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:367)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:286)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
    org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:327)
    org.jruby.runtime.BlockBody.call(BlockBody.java:78)
    org.jruby.runtime.Block.call(Block.java:89)
    org.jruby.RubyProc.call(RubyProc.java:224)
    org.jruby.internal.runtime.methods.ProcMethod.call(ProcMethod.java:62)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:182)
    org.jruby.RubyClass.finvoke(RubyClass.java:502)
    org.jruby.RubyObject.send(RubyObject.java:1437)
    org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen:65535)
    org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:266)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
    org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:199)
    org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:118)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:201)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:180)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:155)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:162)
    org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303)
    org.jruby.runtime.Block.yield(Block.java:194)
    org.jruby.RubyArray.eachCommon(RubyArray.java:1630)
    org.jruby.RubyArray.each(RubyArray.java:1637)
    org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:65535)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:299)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:117)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122)
    org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:201)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:180)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:319)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:157)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:162)
    org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:156)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
    org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:199)
    org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:118)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346)
    org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303)
    org.jruby.runtime.Block.yield(Block.java:194)
    org.jruby.RubyArray.eachCommon(RubyArray.java:1630)
    org.jruby.RubyArray.each(RubyArray.java:1637)
    org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:65535)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:299)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:117)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122)
    org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    C_3a__Programme_NetBeans_20_6_dot_9_ruby_nb_test_mediatorInvokermethod__6$RUBY$run_mediatorFixed0.call(C_3a__Programme_NetBeans_20_6_dot_9_ruby_nb_test_mediatorInvokermethod__6$RUBY$run_mediatorFixed0#run_mediator:65535)
    C_3a__Programme_NetBeans_20_6_dot_9_ruby_nb_test_mediatorInvokermethod__6$RUBY$run_mediatorFixed0.call(C_3a__Programme_NetBeans_20_6_dot_9_ruby_nb_test_mediatorInvokermethod__6$RUBY$run_mediatorFixed0#run_mediator:65535)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
    org.jruby.Ruby.runScript(Ruby.java:684)
    org.jruby.Ruby.runNormally(Ruby.java:567)
    org.jruby.Ruby.runFromMain(Ruby.java:413)
    org.jruby.Main.run(Main.java:286)
    org.jruby.Main.run(Main.java:128)
    org.jruby.Main.main(Main.java:97)

Finished in 0,761 seconds.
2 tests, 0 failures, 1 errors

Hi Nick,

the unit test is as easy as:

coding: utf-8

require ‘test_helper’

class ArtikelgruppeTest < ActiveSupport::TestCase

test “Lese Artikelgruppe 130” do
ar = ArtikelGruppe.find “130”
assert_equal “130”, ar.ArtGruppe
end

end

with my model:

class ArtikelGruppe < ActiveRecord::Base
set_table_name “Artikelgruppen”
set_primary_key “ArtGruppe”

has_many :Artikelstamm, :foreign_key => ‘Gruppe’
belongs_to :ArtikelTyp, :foreign_key => ‘ArtTyp’
end

Environment:

C:\Projekte\LagerInfo>jruby -v
jruby 1.5.0 (ruby 1.8.7 patchlevel 249) (2010-06-10 6586) (Java
HotSpot™ Client VM 1.6.0_18) [x86-java]

C:\Projekte\LagerInfo>gem list

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activerecord-jdbc-adapter (0.9.7 java)
activerecord-jdbcmysql-adapter (0.9.7 java)
activerecord-jdbcpostgresql-adapter (0.9.7 java)
activeresource (2.3.8)
activesupport (2.3.8)
columnize (0.3.1)
composite_primary_keys (2.3.5.1)
jdbc-mysql (5.0.4)
jdbc-postgres (8.4.701 java)
jruby-openssl (0.7)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
rcov (0.9.8 java)
rspec (1.3.0)
ruby-debug-base (0.10.3.2 java)
ruby-debug-ide (0.4.6)
rubygems-update (1.3.7)
sources (0.0.1)
test-unit (2.0.9)
will_paginate (2.3.14)

Nick S. wrote:

Can you share the code snippet that’s getting module_eval’d? The
parser is choking on something, it would be helpful to know what it is
so we can fix it or at a minimum generate a better error message.

Thanks,
/Nick

hi Klaus-Dieter,

looking at the error and your testcase, I would say you have “umlaute”
(or some other non ascii characters) in the database which are the one
which produce the problem. can that be ?

regards Kristian

On Mon, Jul 12, 2010 at 3:56 PM, Klaus-dieter Gundermann
[email protected] wrote:

  ar = ArtikelGruppe.find “130”
 set_primary_key “ArtGruppe”

activeresource (2.3.8)
rspec (1.3.0)

parser is choking on something, it would be helpful to know what it is
  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

       =
      q(--)p
      '
) (`
      /
     _(<  / )
   (
__|
/__)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Finally, one I can answer.

The marker for utf is incorrect. You should have:

_en_coding: utf-8

Not just “coding” but “encoding”. I have this in some Rake tasks that
load a MySQL database with Kanji/Kana characters, so /ein paar umlaute
/should be nothing compared to that.

It’s hard to find documentation on this. Here’s a link:

http://nuclearsquid.com/writings/ruby-1-9-encodings.html
http://yehudakatz.com/2010/05/05/ruby-1-9-encodings-a-primer-and-the-solution-for-rails/

For me, I didn’t have Kanji literals, but was processing them using
Nokogiri into MySQL, and it seemed to be a requirement that I have this
encoding to tell the runtime system to set the prevailing encoding to
UTF-8. This is a Ruby 1.9 feature.

Steve

On 7/12/2010 8:20 AM, kristian wrote:

a MySQL database with Kanji/Kana characters, so ein paar umlaute should be
regards Kristian
require ‘test_helper’

Environment:
actionpack (2.3.8)
jruby-openssl (0.7)
will_paginate (2.3.14)
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

OK, now I learned something new.

does this comment

coding: utf-8

defines the encoding of the file (I wonder a few times already how to
do this) as well the coding the ruby code is using ?!?

has it a similar effect as setting $KCODE = ‘u’ or $KCODE = ‘UTF-8’ in
my code ?

thanx, Kristian

On Mon, Jul 12, 2010 at 8:05 PM, Steve B. [email protected]
wrote:

On 7/12/2010 6:59 AM, kristian wrote:
[email protected] wrote:

class ArtikelGruppe < ActiveRecord::Base
jruby 1.5.0 (ruby 1.8.7 patchlevel 249) (2010-06-10 6586) (Java
activerecord-jdbcmysql-adapter (0.9.7 java)
rake (0.8.7)
Nick S. wrote:


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

       =
      q(--)p
      '
) (`
      /
     _(<  / )
   (
__|
/__)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

kristian wrote:

hi Klaus-Dieter,

looking at the error and your testcase, I would say you have “umlaute”
(or some other non ascii characters) in the database which are the one
which produce the problem. can that be ?

regards Kristian

Hi Kristian,

you are absolutely correct: There is data with umlaute in the database.
But why will the test run with JRuby 1.4 and fails with JRuby 1.5 ?

and reading the error message:
org.jcodings.specific.BaseUTF8Encoding.codeToMbcLength(BaseUTF8Encoding.java:80)
I thought Ruby 1.8.7 has no notion of “Encoding” its all US_ASCII ?

Regards

Klaus

hi Klaus-Dieter,

On Tue, Jul 13, 2010 at 1:50 PM, Klaus-dieter Gundermann
[email protected] wrote:

you are absolutely correct: There is data with umlaute in the database.
But why will the test run with JRuby 1.4 and fails with JRuby 1.5 ?

I do not really know only that there must be some changes concerning
the jcoding library.

and reading the error message:
 org.jcodings.specific.BaseUTF8Encoding.codeToMbcLength(BaseUTF8Encoding.java:80)

well the exception says you are using “UTF8” somewhere somehow.

with ruby 1.8.x I would try to use utf-8 through out. add
$KCode = “UTF-8”
in your code. make sure that your database uses utf-8 and that the
database connection uses utf-8 as well - I think there is an encoding
option with the AR connection config.

I thought Ruby 1.8.7 has no notion of “Encoding” its all US_ASCII ?

yes and no I guess. if your umlaut comes in it is not ascii I suppose
it is iso-8859-1/iso-8859-15 or utf-8. now ruby needs to know what to
do with these bytes when printing it to the screen or deciding the
size of string. that is done via the KCode setting.

another problem with ruby1.8.x is the file encoding which seems to be
no problem with you since there are just ascii characters.

regards Kristian


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

       =
      q(--)p
      '
) (`
      /
     _(<  / )
   (
__|
/__)


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs