java/java/mirah woe

Exception in thread “main” org.jruby.exceptions.RaiseException: (ArgumentError) Constructor invocation failed: tried to access method RubyFromJava.<init>()V from class org.jruby.proxy.RubyFromJava$Proxy0

 

meant “you tried to access a constructor of a java class that wasn’t public or wasn’t in the same package or something like that” (for me, scripting jruby, this meant “remove your initializer from the ruby class” or “make the parent class initializer protected access”

 

java check/detect integer/int/long overflow/underflow

look in jruby’s RubyFixnum.java for “additionOverflowed” and “subtractionOverflowed

    private static boolean additionOverflowed(long original, long other, long result) {
        return (~(original ^ other) & (original ^ result) & SIGN_BIT) != 0;
    }
    
    private static boolean subtractionOverflowed(long original, long other, long result) {
        return (~(original ^ ~other) & (original ^ result) & SIGN_BIT) != 0;
    }

mirah woe

c:\dev\ruby\stevia\lib>C:\dev\ruby\downloads\jruby\bin\jruby C:\dev\ruby\downloads\jruby\bin\mirah reproInference Error:Cannot find static method fib(int) on Reprorepro:5: Cannot find static method fib(int) on Repro     fib(a – 1) + fib(a – 2)

 

meant “your method is recursive so it needs to have both types declared–inferring a return type from recursive is hard, wouldn’t you agree?”

github git woe

ubuntu@ubuntu-VirtualBox:~/dev$ git clone https://rdp@github.com/rdp/mirah.git
Cloning into mirah…
Password:
error: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none while accessing https://rdp@github.com/rdp/mirah.git/info/refs

fatal: HTTP request failed

meant do this:

ubuntu@ubuntu-VirtualBox:~/dev$ git config –global –add http.sslVerify false

ref:

http://codeblue.umich.edu/index/issues/5

“work around”

java spring beans woe

            java.lang.RuntimeException: Error trying to access bean with name mungeParametersHandler

this meant “you declared your bean with type prototype, and for some reason spring has trouble instantiating it the first time–either use spring to enumerate all the types first, then it can be instantiated [for some bizarre reason], or change it to singleton [if said object is instance/thread safe I suppose...]