java.lang.ClassCastException: org.jruby.RubyStringIO cannot be cast to org.jruby.RubyTempfile

Google Groups | Tim Inman | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Image Service / Image Upload Sample Works Intermittently

    Google Groups | 6 years ago | Tim Inman
    java.lang.ClassCastException: org.jruby.RubyStringIO cannot be cast to org.jruby.RubyTempfile

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.jruby.RubyStringIO cannot be cast to org.jruby.RubyTempfile

      at org.jruby.RubyTempfile.open()
    2. JRuby Main Maven Artifact
      RubyTempfile.open
      1. org.jruby.RubyTempfile.open(RubyTempfile.java:260)
      1 frame
    3. org.jruby.rack
      RackBaseInput$i_method_0_0$RUBYINVOKER$rewind.call
      1. org.jruby.rack.input.RackRewindableInput.createTempfile(RackRewindableInput.java:221)
      2. org.jruby.rack.input.RackRewindableInput.access$100(RackRewindableInput.java:35)
      3. org.jruby.rack.input.RackRewindableInput$RubyTempfileRackInput.<init>(RackRewindableInput.java:179)
      4. org.jruby.rack.input.RackRewindableInput$RubyTempfileRackInput.<init>(RackRewindableInput.java:177)
      5. org.jruby.rack.input.RackRewindableInput.getDelegateInput(RackRewindableInput.java:202)
      6. org.jruby.rack.input.RackBaseInput.rewind(RackBaseInput.java:78)
      7. org.jruby.rack.input.RackBaseInput$i_method_0_0$RUBYINVOKER$rewind.call(org/jruby/rack/input/RackBaseInput$i_method_0_0$RUBYINVOKER$rewind.gen:65535)
      7 frames
    4. JRuby Main Maven Artifact
      JavaEmbedUtils$1.callMethod
      1. org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
      2. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
      3. org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
      4. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      5. org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      6. org.jruby.ast.IfNode.interpret(IfNode.java:117)
      7. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      8. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      9. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      10. org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
      11. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
      12. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      13. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      14. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      15. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      16. org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
      17. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
      18. org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
      19. org.jruby.ast.AttrAssignTwoArgNode.interpret(AttrAssignTwoArgNode.java:36)
      20. org.jruby.ast.IfNode.interpret(IfNode.java:111)
      21. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      22. org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      23. org.jruby.ast.IfNode.interpret(IfNode.java:117)
      24. org.jruby.ast.IfNode.interpret(IfNode.java:119)
      25. org.jruby.ast.IfNode.interpret(IfNode.java:119)
      26. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      27. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
      28. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:158)
      29. org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
      30. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
      31. org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
      32. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      33. org.jruby.ast.OrNode.interpret(OrNode.java:94)
      34. org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
      35. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      36. org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      37. org.jruby.ast.IfNode.interpret(IfNode.java:117)
      38. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      39. org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      40. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      41. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      42. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
      43. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      44. org.jruby.ast.ToAryNode.interpret(ToAryNode.java:69)
      45. org.jruby.ast.MultipleAsgnNode.interpret(MultipleAsgnNode.java:127)
      46. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      47. org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
      48. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      49. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      50. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
      51. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      52. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      53. org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
      54. org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:294)
      55. org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:228)
      56. org.jruby.runtime.Block.yieldSpecific(Block.java:99)
      57. org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
      58. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      59. org.jruby.ast.IfNode.interpret(IfNode.java:119)
      60. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      61. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:160)
      62. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:166)
      63. org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:115)
      64. org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:132)
      65. org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
      66. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      67. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      68. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      69. org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
      70. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      71. org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      72. org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
      73. org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
      74. org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:174)
      75. org.jruby.RubyClass.finvoke(RubyClass.java:667)
      76. org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:452)
      77. org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:332)
      78. org.jruby.javasupport.JavaEmbedUtils$1.callMethod(JavaEmbedUtils.java:143)
      78 frames
    5. JRuby-Rack
      RackFilter.doFilter
      1. org.jruby.rack.DefaultRackApplication.__call(DefaultRackApplication.java:68)
      2. org.jruby.rack.DefaultRackApplication.call(DefaultRackApplication.java:42)
      3. org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:29)
      4. org.jruby.rack.RackFilter.doFilter(RackFilter.java:63)
      4 frames
    6. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      1 frame
    7. com.google.appengine
      ServeBlobFilter.doFilter
      1. com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
      1 frame
    8. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      1 frame
    9. Google AppEngine
      TransactionCleanupFilter.doFilter
      1. com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      1 frame
    10. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      1 frame
    11. AppEngine Testing
      StaticFileFilter.doFilter
      1. com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
      1 frame
    12. Jetty Server
      WebAppContext.handle
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      2. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      3. org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      4. org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      5. org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      6. org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      6 frames
    13. com.google.apphosting
      DevAppEngineWebAppContext.handle
      1. com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
      1 frame
    14. Jetty Server
      HandlerWrapper.handle
      1. org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      1 frame
    15. AppEngine Testing
      JettyContainerService$ApiProxyHandler.handle
      1. com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
      1 frame
    16. Jetty Server
      SelectChannelEndPoint.run
      1. org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      2. org.mortbay.jetty.Server.handle(Server.java:326)
      3. org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      4. org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      5. org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      6. org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      7. org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      8. org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      8 frames
    17. Jetty Util
      QueuedThreadPool$PoolThread.run
      1. org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      1 frame