Class cast exception in PKeyRSA.java
------------------------------------

                 Key: JRUBY-3557
                 URL: http://jira.codehaus.org/browse/JRUBY-3557
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby 1.2
         Environment: jruby 1.2 on Mac OS X
            Reporter: Martin Englund
            Priority: Minor


Trying to get puppet running on jruby I got the following error, due to an 
import of javax.crypto.Cipher

Index: PKeyRSA.java
===================================================================
--- PKeyRSA.java        (revision 9524)
+++ PKeyRSA.java        (working copy)
@@ -298,7 +298,7 @@
         char[] passwd = null;
         String algo = null;
         if(args.length > 0 && !args[0].isNil()) {
-            algo = ((Cipher)args[0]).getAlgorithm();
+            algo = ((org.jruby.ext.openssl.Cipher)args[0]).getAlgorithm();
             if(args.length > 1 && !args[1].isNil()) {
                 passwd = args[1].toString().toCharArray();
             }

[mar...@mbp:puppet-0.24.8] 572$ puppetmasterd --no-daemonize
PKeyRSA.java:412:in `export': java.lang.ClassCastException: 
org.jruby.ext.openssl.Cipher cannot be cast to javax.crypto.Cipher
        from 
org/jruby/ext/openssl/PKeyRSA$i_method_0_0$RUBYINVOKER$export.gen:-1:in `call'
        from JavaMethod.java:624:in `call'
        from DynamicMethod.java:169:in `call'
        from CachingCallSite.java:293:in `cacheAndCall'
        from CachingCallSite.java:152:in `call'
        from CallTwoArgNode.java:59:in `interpret'
        from LocalAsgnNode.java:123:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from IfNode.java:112:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:125:in `call'
        from DefaultMethod.java:126:in `call'
        from CachingCallSite.java:253:in `cacheAndCall'
        from CachingCallSite.java:72:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:114:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:125:in `call'
        from DefaultMethod.java:126:in `call'
        from CachingCallSite.java:253:in `cacheAndCall'
        from CachingCallSite.java:72:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:114:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:125:in `call'
        from DefaultMethod.java:126:in `call'
        from CachingCallSite.java:253:in `cacheAndCall'
        from CachingCallSite.java:72:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from InstAsgnNode.java:91:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedBlock.java:192:in `evalBlockBody'
        from InterpretedBlock.java:143:in `yield'
        from Block.java:100:in `yield'
        from YieldNode.java:115:in `interpret'
        from ReturnNode.java:88:in `interpret'
        from IfNode.java:114:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:220:in `call'
        from DefaultMethod.java:171:in `call'
        from WrapperMethod.java:82:in `call'
        from CachingCallSite.java:303:in `cacheAndCall'
        from CachingCallSite.java:161:in `callBlock'
        from CachingCallSite.java:176:in `callIter'
        from CallTwoArgBlockNode.java:62:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:125:in `call'
        from DefaultMethod.java:126:in `call'
        from CachingCallSite.java:253:in `cacheAndCall'
        from CachingCallSite.java:72:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:114:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedMethod.java:125:in `call'
        from DefaultMethod.java:126:in `call'
        from CachingCallSite.java:253:in `cacheAndCall'
        from CachingCallSite.java:72:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:182:in `call'
        from DefaultMethod.java:153:in `call'
        from CachingCallSite.java:283:in `cacheAndCall'
        from CachingCallSite.java:121:in `callBlock'
        from CachingCallSite.java:126:in `call'
        from RubyClass.java:554:in `call'
        from DynamicMethod.java:152:in `call'
        from CachingCallSite.java:273:in `cacheAndCall'
        from CachingCallSite.java:112:in `call'
        from CallOneArgNode.java:57:in `interpret'
        from InstAsgnNode.java:91:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:182:in `call'
        from DefaultMethod.java:153:in `call'
        from CachingCallSite.java:283:in `cacheAndCall'
        from CachingCallSite.java:121:in `callBlock'
        from CachingCallSite.java:126:in `call'
        from RubyClass.java:554:in `call'
        from DynamicMethod.java:152:in `call'
        from CachingCallSite.java:273:in `cacheAndCall'
        from CachingCallSite.java:112:in `call'
        from CallOneArgNode.java:57:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedBlock.java:192:in `evalBlockBody'
        from InterpretedBlock.java:143:in `yield'
        from Block.java:100:in `yield'
        from RubyEnumerable.java:599:in `call'
        from CallBlock.java:82:in `yield'
        from Block.java:100:in `yield'
        from RubyHash.java:1014:in `visit'
        from RubyHash.java:546:in `visitAll'
        from RubyHash.java:1011:in `each'
        from org/jruby/RubyHash$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:-1:in 
`call'
        from RubyClass.java:332:in `finvoke'
        from RuntimeHelpers.java:373:in `invoke'
        from RubyEnumerable.java:67:in `callEach'
        from RubyEnumerable.java:596:in `collect'
        from 
org/jruby/RubyEnumerable$s_method_0_0$RUBYFRAMEDINVOKER$collect.gen:-1:in `call'
        from CachingCallSite.java:263:in `cacheAndCall'
        from CachingCallSite.java:81:in `callBlock'
        from CachingCallSite.java:86:in `call'
        from CallNoArgBlockNode.java:64:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:163:in `call'
        from DefaultMethod.java:144:in `call'
        from CachingCallSite.java:273:in `cacheAndCall'
        from CachingCallSite.java:112:in `call'
        from FCallOneArgNode.java:36:in `interpret'
        from LocalAsgnNode.java:123:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:112:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:182:in `call'
        from DefaultMethod.java:153:in `call'
        from CachingCallSite.java:283:in `cacheAndCall'
        from CachingCallSite.java:121:in `callBlock'
        from CachingCallSite.java:126:in `call'
        from RubyClass.java:554:in `call'
        from DynamicMethod.java:152:in `call'
        from CachingCallSite.java:273:in `cacheAndCall'
        from CachingCallSite.java:112:in `call'
        from puppetmasterd:239:in `rescue_4$RUBY$__rescue___6'
        from puppetmasterd:234:in `__file__'
        from puppetmasterd:-1:in `load'
        from Ruby.java:577:in `runScript'
        from Ruby.java:480:in `runNormally'
        from Ruby.java:354:in `runFromMain'
        from Main.java:229:in `run'
        from Main.java:110:in `run'
        from Main.java:94:in `main'

-- 
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


Reply via email to