jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-1206

Form's with enctype="multipart/form-data" fail in JRuby/Rails

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.0
  • Fix Version/s: JRuby 1.0.1, JRuby 1.1b1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows Vista Business, JDK 1.6

Description

Form's with enctype="multipart/form-data" fail in JRuby/Rails

127.0.0.1 - - [16/Jul/2007:01:34:56 PDT] "GET /upload HTTP/1.1" 200 483

  • -> /upload
    #<NativeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -530>
    ["String.java:398:in `java.lang.String.checkBounds'", "String.java:443:in `java.lang.String.<init>'", "ByteList.java:541:in `org.jruby.util.ByteList.toString'", "ByteList.java:524:in `org.jruby.util.ByteList.toString'", "RubyString.java:345:in `org.jruby.RubyString.toString'", "RubyRegexp.java:419:in `org.jruby.RubyRegexp.match'", "RubyRegexp.java:436:in `org.jruby.RubyRegexp.match_m'", "null:-1:in `org.jruby.RubyRegexpInvokermatch_m1.call'", "FastInvocationCallback.java:49:in `org.jruby.runtime.callback.FastInvocationCallback.execute'", "SimpleCallbackMethod.java:81:in `org.jruby.internal.runtime.methods.SimpleCallbackMethod.call'", "EvaluationState.java:568:in `org.jruby.evaluator.EvaluationState.callNode'", "EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:270:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1706:in `org.jruby.evaluator.EvaluationState.untilNode'", "EvaluationState.java:378:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "Block.java:220:in `org.jruby.runtime.Block.yield'", "Block.java:186:in `org.jruby.runtime.Block.yield'", "RubyKernel.java:913:in `org.jruby.RubyKernel.loop'", "null:-1:in `org.jruby.RubyKernelInvokerSloop0.call'", "InvocationCallback.java:49:in `org.jruby.runtime.callback.InvocationCallback.execute'", "FullFunctionCallbackMethod.java:78:in `org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "RubyObject.java:564:in `org.jruby.RubyObject.callMethod'", "EvaluationState.java:1030:in `org.jruby.evaluator.EvaluationState.fCallNode'", "EvaluationState.java:253:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:1023:in `org.jruby.evaluator.EvaluationState.fCallNode'", "EvaluationState.java:253:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1219:in `org.jruby.evaluator.EvaluationState.instAsgnNode'", "EvaluationState.java:280:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:1023:in `org.jruby.evaluator.EvaluationState.fCallNode'", "EvaluationState.java:253:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "RubyObject.java:564:in `org.jruby.RubyObject.callMethod'", "RubyObject.java:449:in `org.jruby.RubyObject.callMethod'", "RubyClass.java:287:in `org.jruby.RubyClass.newInstance'", "null:-1:in `org.jruby.RubyClassInvokernewInstancexx1.call'", "InvocationCallback.java:49:in `org.jruby.runtime.callback.InvocationCallback.execute'", "FullFunctionCallbackMethod.java:78:in `org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:568:in `org.jruby.evaluator.EvaluationState.callNode'", "EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:2190:in `org.jruby.evaluator.EvaluationState.setupArgs'", "EvaluationState.java:549:in `org.jruby.evaluator.EvaluationState.callNode'", "EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1518:in `org.jruby.evaluator.EvaluationState.rescueNode'", "EvaluationState.java:350:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:1023:in `org.jruby.evaluator.EvaluationState.fCallNode'", "EvaluationState.java:253:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:270:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:984:in `org.jruby.evaluator.EvaluationState.ensureNode'", "EvaluationState.java:247:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:568:in `org.jruby.evaluator.EvaluationState.callNode'", "EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:568:in `org.jruby.evaluator.EvaluationState.callNode'", "EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1518:in `org.jruby.evaluator.EvaluationState.rescueNode'", "EvaluationState.java:350:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:984:in `org.jruby.evaluator.EvaluationState.ensureNode'", "EvaluationState.java:247:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1770:in `org.jruby.evaluator.EvaluationState.whileNode'", "EvaluationState.java:387:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "DefaultMethod.java:135:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'", "DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'", "EvaluationState.java:1023:in `org.jruby.evaluator.EvaluationState.fCallNode'", "EvaluationState.java:253:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:531:in `org.jruby.evaluator.EvaluationState.blockNode'", "EvaluationState.java:201:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:1518:in `org.jruby.evaluator.EvaluationState.rescueNode'", "EvaluationState.java:350:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:984:in `org.jruby.evaluator.EvaluationState.ensureNode'", "EvaluationState.java:247:in `org.jruby.evaluator.EvaluationState.evalInternal'", "EvaluationState.java:164:in `org.jruby.evaluator.EvaluationState.eval'", "Block.java:220:in `org.jruby.runtime.Block.yield'", "Block.java:174:in `org.jruby.runtime.Block.call'", "RubyProc.java:173:in `org.jruby.RubyProc.call'", "RubyProc.java:148:in `org.jruby.RubyProc.call'", "RubyNativeThread.java:73:in `org.jruby.internal.runtime.RubyNativeThread.run'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in `loop'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/1.8/cgi.rb:1067:in `read_multipart'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in `initialize_query'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:33:in `initialize'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:118:in `new'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:118:in `handle_dispatch'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:81:in `service'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'", "C:/Apps/netbeans/NetBeans 6.0M10/ruby1/jruby-1.0/lib/ruby/1.8/webrick/server.rb:95:in `start'"]
    [2007-07-16 01:35:06] ERROR `/upload/done' not found.
    127.0.0.1 - - [16/Jul/2007:01:35:06 PDT] "POST /upload/done HTTP/1.1" 404 281
    http://localhost:3000/upload -> /upload/done
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    done.rhtml
    16/Jul/07 3:37 AM
    0.1 kB
    Selva Sarangan
  2. File
    index.rhtml
    16/Jul/07 3:37 AM
    0.5 kB
    Selva Sarangan
  3. Hide
    Zip Archive
    sandbox.zip
    07/Aug/07 4:08 PM
    463 kB
    Bill Walton
    1. File
      sandbox/app/controllers/application.rb 0.3 kB
    2. File
      sandbox/app/.../upload_controller.rb 0.8 kB
    3. File
      sandbox/app/.../application_helper.rb 0.1 kB
    4. File
      sandbox/app/helpers/upload_helper.rb 0.0 kB
    5. File
      sandbox/app/.../provider_attachment.rb 0.3 kB
    6. File
      sandbox/app/views/layouts/upload.rhtml 0.5 kB
    7. File
      sandbox/app/views/upload/edit.rhtml 0.2 kB
    8. File
      sandbox/app/views/upload/list.rhtml 0.6 kB
    9. File
      sandbox/app/views/upload/new.rhtml 0.2 kB
    10. File
      sandbox/app/views/upload/show.rhtml 0.2 kB
    11. File
      sandbox/app/views/upload/_form.rhtml 0.4 kB
    12. File
      sandbox/config/boot.rb 2 kB
    13. File
      sandbox/config/database.yml 0.9 kB
    14. File
      sandbox/config/environment.rb 2 kB
    15. File
      sandbox/config/.../development.rb 0.9 kB
    16. File
      sandbox/config/.../production.rb 0.7 kB
    17. File
      sandbox/config/environments/test.rb 0.8 kB
    18. File
      sandbox/config/routes.rb 0.9 kB
    19. File
      sandbox/db/create.sql 0.3 kB
    20. File
      sandbox/doc/README_FOR_APP 0.2 kB
    21. Text File
      sandbox/log/development.log 1.12 MB
    22. Text File
      sandbox/log/production.log 0.0 kB
    23. Text File
      sandbox/log/server.log 0.0 kB
    24. Text File
      sandbox/log/test.log 0.0 kB
    25. Text File
      sandbox/nbproject/private/rake-t.txt 3 kB
    26. File
      sandbox/nbproject/project.properties 0.0 kB
    27. XML File
      sandbox/nbproject/project.xml 0.3 kB
    28. File
      sandbox/public/.htaccess 1 kB
    29. HTML File
      sandbox/public/404.html 0.9 kB
    30. HTML File
      sandbox/public/500.html 0.9 kB
    Showing 30 of 70 items Download Zip
    Show
    Zip Archive
    sandbox.zip
    07/Aug/07 4:08 PM
    463 kB
    Bill Walton
  4. File
    string_sub_test.rb
    20/Jul/07 2:19 PM
    0.8 kB
    kennyj
  5. File
    upload_controller.rb
    16/Jul/07 3:37 AM
    0.1 kB
    Selva Sarangan
  1. mysql_problem.gif
    9 kB
    08/Aug/07 9:11 PM

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Dan Sketcher added a comment - 18/Jul/07 10:38 AM

For me, when I invoke under Jetty (JDK 1.5.0_12, win32, JRuby 1.0 with a file form field:

2007-07-18 16:38:34.824:/touchrails:INFO: rails: Failed to invoke rails
from file:/C:/development/touchrails/tmp/war/WEB-INF/lib/jruby-complete-1.0.jar!/cgi.rb:1067:in `read_multipart'
from C:/development/touchrails/tmp/war/WEB-INF/gems/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in
`initialize_query'
from file:/C:/development/touchrails/tmp/war/WEB-INF/lib/jruby-complete-1.0.jar!/cgi.rb:2274:in `initialize'
from <script>:0

2007-07-18 16:38:34.824::WARN: EXCEPTION
javax.servlet.ServletException: Failed to invoke rails, please see the log for more details
at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151)
at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102)
at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
2007-07-18 16:38:35.027::WARN: /touchrails/product/confirm/standard/5433:
javax.servlet.ServletException: Failed to invoke rails, please see the log for more details
at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151)
at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102)
at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
2007-07-18 16:38:35.230::WARN: /touchrails/product/confirm/standard/5433
javax.servlet.ServletException: Failed to invoke rails, please see the log for more details
at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151)
at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102)
at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

This error does not happen if the form is multipart but has no multipart content.

Dan

Show
Dan Sketcher added a comment - 18/Jul/07 10:38 AM For me, when I invoke under Jetty (JDK 1.5.0_12, win32, JRuby 1.0 with a file form field: 2007-07-18 16:38:34.824:/touchrails:INFO: rails: Failed to invoke rails from file:/C:/development/touchrails/tmp/war/WEB-INF/lib/jruby-complete-1.0.jar!/cgi.rb:1067:in `read_multipart' from C:/development/touchrails/tmp/war/WEB-INF/gems/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in `initialize_query' from file:/C:/development/touchrails/tmp/war/WEB-INF/lib/jruby-complete-1.0.jar!/cgi.rb:2274:in `initialize' from <script>:0 2007-07-18 16:38:34.824::WARN: EXCEPTION javax.servlet.ServletException: Failed to invoke rails, please see the log for more details at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151) at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102) at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) 2007-07-18 16:38:35.027::WARN: /touchrails/product/confirm/standard/5433: javax.servlet.ServletException: Failed to invoke rails, please see the log for more details at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151) at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102) at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) 2007-07-18 16:38:35.230::WARN: /touchrails/product/confirm/standard/5433 javax.servlet.ServletException: Failed to invoke rails, please see the log for more details at org.jruby.webapp.AbstractRailsServlet.serviceRequest(AbstractRailsServlet.java:151) at org.jruby.webapp.AbstractRailsServlet.service(AbstractRailsServlet.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.jruby.webapp.FileServlet.doGet(FileServlet.java:102) at org.jruby.webapp.FileServlet.doPost(FileServlet.java:153) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) This error does not happen if the form is multipart but has no multipart content. Dan
Hide
Permalink
kennyj added a comment - 20/Jul/07 11:53 AM

(sorry, my poor english)

I have same problem.. (tomcat, jdk1.5.0_12, windows, vista business, jruby 1.0.0)

I searched for this problem a little.

in cgi.rb
...
buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do
body.print $1
...

$1 was file content. but, $1.size was wrong

regular expression's bug??

Show
kennyj added a comment - 20/Jul/07 11:53 AM (sorry, my poor english) I have same problem.. (tomcat, jdk1.5.0_12, windows, vista business, jruby 1.0.0) I searched for this problem a little. in cgi.rb ... buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do body.print $1 ... $1 was file content. but, $1.size was wrong regular expression's bug??
Hide
Permalink
kennyj added a comment - 20/Jul/07 12:08 PM

umuuu...

sorry.
'$1' was not (whole) file contet.
'body' was whole file content.

body.size was correct size !

Show
kennyj added a comment - 20/Jul/07 12:08 PM umuuu... sorry. '$1' was not (whole) file contet. 'body' was whole file content. body.size was correct size !
Hide
Permalink
kennyj added a comment - 20/Jul/07 2:18 PM

hi!

The size seems to have made a mistake still.

i make testcase (string_sub_test.rb)

cruby(1.8.5) 100% success
jruby faulure!

Show
kennyj added a comment - 20/Jul/07 2:18 PM hi! The size seems to have made a mistake still. i make testcase (string_sub_test.rb) cruby(1.8.5) 100% success jruby faulure!
Hide
Permalink
Rem vd H added a comment - 27/Jul/07 4:10 AM

Same issue on a mac. Only in the case of uploading binary files (jpg's in my case) txt files seem to upload correctly. This corresponds to the testcase.

Show
Rem vd H added a comment - 27/Jul/07 4:10 AM Same issue on a mac. Only in the case of uploading binary files (jpg's in my case) txt files seem to upload correctly. This corresponds to the testcase.
Hide
Permalink
Bill Walton added a comment - 07/Aug/07 4:08 PM

sandbox Rails app to demonstrate the problem.

Show
Bill Walton added a comment - 07/Aug/07 4:08 PM sandbox Rails app to demonstrate the problem.
Hide
Permalink
Charles Oliver Nutter added a comment - 07/Aug/07 5:26 PM

Thanks for the sandbox Bill...we'll take a look at it and see what's up. It's certainly a bug, but hopefully not a hard one.

Show
Charles Oliver Nutter added a comment - 07/Aug/07 5:26 PM Thanks for the sandbox Bill...we'll take a look at it and see what's up. It's certainly a bug, but hopefully not a hard one.
Hide
Permalink
Thomas E Enebo added a comment - 07/Aug/07 9:39 PM

Largish uploaded files are broken because of JRUBY-1261 (int overflow issues with strings).

I am still triaging the second problem...but I can see that we are chomping one character too many in the regular expressions during multipart processing.

Change /Content-..../ to /ontent-..../ and smaller attachments load in the above provided file (this is against 1.0). Hopefully I will narrow this down more before I sign off for the evening.

Show
Thomas E Enebo added a comment - 07/Aug/07 9:39 PM Largish uploaded files are broken because of JRUBY-1261 (int overflow issues with strings). I am still triaging the second problem...but I can see that we are chomping one character too many in the regular expressions during multipart processing. Change /Content-..../ to /ontent-..../ and smaller attachments load in the above provided file (this is against 1.0). Hopefully I will narrow this down more before I sign off for the evening.
Hide
Permalink
Thomas E Enebo added a comment - 07/Aug/07 10:15 PM

I suspect kennyj analysis is better than mine, but I will show the case I generated (which is mostly the same as his first comments in this issue).

buf = <<-EOF
<html version="3.0"><head><title>C&#65533;ES&#65533;TINA: Vs&#65533;eobecné Vy&#338;razy</title></head><frameset cols="77%,23%">
<frame src="cze%20Files/cze-list.html" name="LIST">
<frame src="cze%20Files/Flags.html">
</frameset>
<noframes>
<meta http-equiv="Refresh" Content="2;
URL="http://www.cusd.claremont.edu/~tkroll/EastEur/cze-list.html">
</noframes>

</html>
-----------------------------2108419687582020262226531349
Content-Disposition: form-data; name="commit"

Upload file
-----------------------------2108419687582020262226531349--
EOF

boundary = "-----------------------------2108419687582020262226531349"
quoted_boundary = Regexp.quote(boundary, "n")
buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do
  puts "2: #{$2}"
  
  ""
end

p buf

The specific content is fairly important too. Ola? Are you our hero?

Show
Thomas E Enebo added a comment - 07/Aug/07 10:15 PM I suspect kennyj analysis is better than mine, but I will show the case I generated (which is mostly the same as his first comments in this issue).
buf = <<-EOF
<html version="3.0"><head><title>C&#65533;ES&#65533;TINA: Vs&#65533;eobecné Vy&#338;razy</title></head><frameset cols="77%,23%">
<frame src="cze%20Files/cze-list.html" name="LIST">
<frame src="cze%20Files/Flags.html">
</frameset>
<noframes>
<meta http-equiv="Refresh" Content="2;
URL="http://www.cusd.claremont.edu/~tkroll/EastEur/cze-list.html">
</noframes>

</html>
-----------------------------2108419687582020262226531349
Content-Disposition: form-data; name="commit"

Upload file
-----------------------------2108419687582020262226531349--
EOF

boundary = "-----------------------------2108419687582020262226531349"
quoted_boundary = Regexp.quote(boundary, "n")
buf = buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{quoted_boundary}([\r\n]{1,2}|--)/n) do
  puts "2: #{$2}"
  
  ""
end

p buf
The specific content is fairly important too. Ola? Are you our hero?
Hide
Permalink
Charles Oliver Nutter added a comment - 08/Aug/07 7:51 AM

My output using trunk for Tom's case matches Ruby 1.8.6.

Show
Charles Oliver Nutter added a comment - 08/Aug/07 7:51 AM My output using trunk for Tom's case matches Ruby 1.8.6.
Hide
Permalink
Thomas E Enebo added a comment - 08/Aug/07 10:30 AM

Then this part was fixed on trunk and needs to be backported to 1.0. So that just leaves the overflow bug for 1.0 to support this. For trunk we need to figure out what regressed for pure Ruby mysql driver.

Show
Thomas E Enebo added a comment - 08/Aug/07 10:30 AM Then this part was fixed on trunk and needs to be backported to 1.0. So that just leaves the overflow bug for 1.0 to support this. For trunk we need to figure out what regressed for pure Ruby mysql driver.
Hide
Permalink
Bill Walton added a comment - 08/Aug/07 9:11 PM

ethereal summary of network traffic prior to timeout

Show
Bill Walton added a comment - 08/Aug/07 9:11 PM ethereal summary of network traffic prior to timeout
Hide
Permalink
Thomas E Enebo added a comment - 10/Aug/07 5:03 PM

All known issues with this bug have been fixed. Works on both 1.0 branch and trunk.

Show
Thomas E Enebo added a comment - 10/Aug/07 5:03 PM All known issues with this bug have been fixed. Works on both 1.0 branch and trunk.

People

  • Assignee:
    Thomas E Enebo
    Reporter:
    Selva Sarangan
Vote (4)
Watch (5)

Dates

  • Created:
    16/Jul/07 3:37 AM
    Updated:
    22/Dec/07 6:28 AM
    Resolved:
    10/Aug/07 5:03 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.