4 Replies Latest reply on Jun 28, 2015 2:29 AM by Philippe Marschall

    Problems with server jar dependencies vs EAR dependencies

    Thomas Nakken Newbie

      Hi

       

      We have a application which dependes on jodatime 2.3. It looks like Wildly 8.2 loads jodatime 1.6 into the system classpath (by modules).

      Does someone know how we can force our application to use jodatime 2.3 and not jodatime 1.6 loaded by wildly?

      Today we pack jodatime 2.3 into the EAR but jodatime 1.6 is loaded first by wildfly and then used.

        • 1. Re: Problems with server jar dependencies vs EAR dependencies
          Morty Tenenbaum Newbie

          Wildfly bundled module which load by default can be excluded with a jboss-deployment-structure file.

          i.e..  my.ear\META-INF\jboss-deployment-structure.xml

          This specifies exclusions for the ear.

          e.g.

          ...

          <exclusions>

              <module name="org.apache.log4j" /> 

                  </exclusions>

           

          If this conflicts with a .war as well then you add a sub-deployment exclusion as well.

          1 of 1 people found this helpful
          • 2. Re: Problems with server jar dependencies vs EAR dependencies
            Thomas Nakken Newbie

            Hi

             

            Tried that, but it looks like it's not picked up by the server. My file in the EAR looks like:

            <?xml version="1.0" encoding="UTF-8"?>
            <jboss-deployment-structure>
              <deployment>
              <exclusions>
              <module name="org.joda.time"/>
              </exclusions>
              </deployment>
            </jboss-deployment-structure>


            Does this looks ok?

            • 3. Re: Problems with server jar dependencies vs EAR dependencies
              Morty Tenenbaum Newbie

              Do you see anything in the log as it's coming up that it recognizes the jboss-deployment-structure file at all?

              I know the example which I followed to do this on JBoss7.1.1 had a second line of

              <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

               

              which I had to modify to 1.1 to get it to work.  So you may need this line or a variation on the version number at the end of the line to match yours.

               

              Then there's the sub-deployment part which you'll need if you have a war which I mentioned.

               

              But first try and get the file to be recognized.

              • 4. Re: Problems with server jar dependencies vs EAR dependencies
                Philippe Marschall Expert

                Thomas Nakken wrote:

                 

                Hi

                 

                We have a application which dependes on jodatime 2.3. It looks like Wildly 8.2 loads jodatime 1.6 into the system classpath (by modules).

                No, only the modules.jar is in the system classpath. What you mean is the class loader.

                Thomas Nakken wrote:

                 

                Today we pack jodatime 2.3 into the EAR but jodatime 1.6 is loaded first by wildfly and then used.

                Can you find out which module that is? This should not happen at all.