Skip to content

WrongMethodTypeException after upgrading to Jruby 9.4.12.0 #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StockRover opened this issue Apr 17, 2025 · 5 comments
Closed

WrongMethodTypeException after upgrading to Jruby 9.4.12.0 #272

StockRover opened this issue Apr 17, 2025 · 5 comments

Comments

@StockRover
Copy link

After upgrading from JRuby 9.2.20.1 and running inside Apache Tomcat any file upload form fails with this error

17-Apr-2025 15:13:17.565 INFO [main] org.apache.catalina.core.ApplicationContext.log jruby 9.4.12.0 (3.1.4) 2025-02-11 f4ab75096a OpenJDK 64-Bit Server VM 24.0.1+9-30 on 24.0.1+9-30 +jit [x86_64-mswin32]
17-Apr-2025 15:13:17.566 INFO [main] org.apache.catalina.core.ApplicationContext.log using a shared (thread-safe) runtime
17-Apr-2025 15:14:46.718 INFO [https-openssl-nio-443-exec-3] org.apache.catalina.core.ApplicationContext.log resetting rack response due exception
17-Apr-2025 15:14:47.705 SEVERE [https-openssl-nio-443-exec-3] org.apache.catalina.core.ApplicationContext.log error app failed to handle exception: java.lang.invoke.WrongMethodTypeException: handle's method type (RubyString,ByteList,int)int but found (ByteList,int)int
org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `bytesize' for Rack::Utils:Module
at RUBY.call(uri:classloader:/jruby/rack/error_app/show_status.rb:30)
at org.jruby.rack.ext.Servlet.call(org/jruby/rack/ext/Servlet.java:86)

I wouldn't be surprised if the bug is some misconfiguration on my end but I have no idea where to look. I've tried with rack versions 1.1.21 and 1.2.2.

@headius
Copy link
Member

headius commented Apr 18, 2025

Perhaps it is now finding a different version of the class in classpath?

@chadlwilson
Copy link
Contributor

chadlwilson commented Apr 18, 2025

This was fixed in #252 but still not released. 1.2.2 is not stable IMHO. 1.1.21 might be OK, but probably depends which Rack version you're trying to load with it.

We need a 1.2.3 or 1.3.0 release off master, really.

@StockRover
Copy link
Author

Until a new release is ready is there any way to monkey patch my environment to work around this issue? I tried the patch posted here without success
websocket-rails/websocket-rails#423

@StockRover
Copy link
Author

Nevermind, I did find a 1.2.2 jar was lingering on Tomcat. Once I truly ran 1.1.21 it succeeded.

@chadlwilson
Copy link
Contributor

chadlwilson commented Apr 18, 2025

If you consume jruby-rack via jar and you're interested in trialing with a temporary fork to give feedback you could have a go with https://github.com/gocd-contrib/jruby-rack (1.2.3.9 is basically the same as master here with #273 merged).

Probably not a good idea to depend on it for production but it'd help us figure out if there are other 1.2.x issues to solve in different servlet environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants