Skip to content
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

WildFly broken since switched to metosin/muuntaja #300

Closed
benwhorwood opened this issue Jul 24, 2017 · 7 comments
Closed

WildFly broken since switched to metosin/muuntaja #300

benwhorwood opened this issue Jul 24, 2017 · 7 comments

Comments

@benwhorwood
Copy link

It appears as though WildFly has been broken by changes from b1fe4e3 (switched to metosin/muuntaja )...

(Please note I've abbreviated the stack trace below.)

#error {
 :cause com.fasterxml.jackson.databind.util.LRUMap cannot be cast to java.util.LinkedHashMap
 :via
 [{:type java.lang.ClassCastException
   :message com.fasterxml.jackson.databind.util.LRUMap cannot be cast to java.util.LinkedHashMap
   :at [muuntaja.parse$fast_memoize$fn__3241 doInvoke parse.clj 13]}]
 :trace
 [[muuntaja.parse$fast_memoize$fn__3241 doInvoke parse.clj 13]
  [clojure.lang.RestFn invoke RestFn.java 408]
  [muuntaja.core$_negotiate_request invokeStatic core.clj 336]
  [muuntaja.core$_negotiate_request invoke core.clj 335]
  [muuntaja.core$negotiate_request invokeStatic core.clj 374]
  [muuntaja.core$negotiate_request invoke core.clj 372]
  [muuntaja.core$format_request invokeStatic core.clj 387]
  [muuntaja.core$format_request invoke core.clj 385]
  [muuntaja.middleware$wrap_format$fn__3855 invoke middleware.clj 71]
}

As a temporary measure I have undone the changes from b1fe4e3 in my project's middleware namespace (essentially switched back to using ring.middleware.format/wrap-restful-format).

Tested against the following versions:

  • WildFly 10.1.0 Final
  • WildFly 9.0.2 Final
  • WildFly 9.0.1 Final

Stock deployment (deployed as WAR) using OpenJDK 1.8.0_131 on Debian Stretch, e.g. http://forgezilla.com/installing-wildfly-10-on-debianubuntu/

Can reproduce using:

$ lein new luminus wftest
$ cd wftest
$ lein immutant war

Then upload WAR to /path/to/wildfly/standalone/deployments.

@yogthos
Copy link
Member

yogthos commented Jul 24, 2017

@ikitommi sounds like it might be a bug in muuntaja?

@ikitommi
Copy link
Contributor

Hi. Muuntaja depends on newer version on Jackson than WildFly ships with, causing the issue. Quick fix: https://stackoverflow.com/questions/37591081/wildfly-10-deploy-an-application-with-newer-version-of-jackson

Real fix should be applied in Muuntaja itself: metosin/muuntaja#53

@ikitommi
Copy link
Contributor

Could you try with [metosin/muuntaja "0.3.2-20170725.052408-1"].

@benwhorwood
Copy link
Author

benwhorwood commented Jul 25, 2017

Hi, many thanks for the quick responses!

@ikitommi I can confirm that replacing [metosin/muuntaja "0.3.1"] with [metosin/muuntaja "0.3.2-20170725.052408-1"] in project.clj fixes the problem; the WAR file produced by lein immutant war runs without issue on WildFly 10.1.0 Final.

I would assume that all other referenced WildFly versions work as well due to the rectified Jackson dependency, but would be happy to try them if you would like me to?

@ikitommi
Copy link
Contributor

Hi, pushed out [metosin/muuntaja "0.3.2"] with the fix. There is no dependency to Jackson Databind anymore, so it should work with all versions.

@yogthos
Copy link
Member

yogthos commented Jul 25, 2017

Thanks for the quick turnaround, just pushed out a new template with the updated version. 👍

@yogthos yogthos closed this as completed Jul 25, 2017
@benwhorwood
Copy link
Author

benwhorwood commented Jul 25, 2017

@ikitommi and @yogthos, thank you both for such a quick response and also for the projects in general, great work!

I have just done a test deployment with stock project generated from 2.9.11.71 and can confirm that everything works correctly with WildFly 10.1.0 out of the box.

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