4 Replies Latest reply on Sep 28, 2017 10:22 AM by nmcgover

    Deploying to JBoss with latest version of Jackson

    nmcgover

      I am trying to deploy a war file to jboss with my own version of Jackson. However, jboss ignores the dependencies set in my pom and uses the default jackson lib that is several versions behind. I know I can use a jboss-deployment-structure.xml file to exclude the default jackson dependency from this stack overflow post https://stackoverflow.com/questions/46366031/missing-jackson-dependencies-in-jboss-eap-7/46390268#46390268, but it still does not have the latest version I need. Is there a way I can specify to jboss to just look in the lib folder inside my war file?

        • 1. Re: Deploying to JBoss with latest version of Jackson
          ctomc

          copy jar into the old module and than open module.xml and update reference to point to new jar

          • 2. Re: Deploying to JBoss with latest version of Jackson
            nmcgover

            I am not sure what you mean. This is for a maven project and I do not have a module.xml file.

            • 3. Re: Deploying to JBoss with latest version of Jackson
              jaikiran

              As far as I know, WildFly doesn't force/expose Jackson module on the deployments, so you should just be able to package a Jackson library version of your own in the .ear/lib or .war/WEB-INF/lib of your application and use it in a way you want to.

               

              If you are running into issues doing that, can you paste the entire exception stacktrace that you see, the snippet of the code from your application which triggers this and the exact version of WildFly that you are using?

              • 4. Re: Deploying to JBoss with latest version of Jackson
                nmcgover

                The error that I am getting is when I call the following line:

                 

                mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);

                 

                and the error that is thrown is:

                 

                13:18:26,170 ERROR java.lang.NoSuchFieldError: SNAKE_CASE

                 

                I am using WildFly Core 2.1.15.Final-redhat-1

                 

                And this is my jboss-deployment-structure.xml:

                 

                <jboss-deployment-structure>
                  <deployment>
                       <exclusions>
                            <module name="com.fasterxml.jackson.core.databind"/>
                       </exclusions>
                  </deployment>
                </jboss-deployment-structure>