title: Conflicting setter definitions for property \"currency\": javax.money.MonetaryAmountFactory
body: <p>I use <code>org.javamoney.moneta.Money</code> type in my REST endpoints. I have implemented <code>ParamConverterProvider</code>. When i deploy my war file in wildfly now i get this error [1]</p>
  
  <p>How can i overcome this issue?</p>
  
  <p>My sample implementation for Money type is;</p>
  
  <pre><code>import java.lang.annotation.Annotation;
  import java.lang.reflect.Type;
  import java.math.BigDecimal;
  import javax.money.Monetary;
  import javax.ws.rs.ext.ParamConverter;
  import javax.ws.rs.ext.ParamConverterProvider;
  import javax.ws.rs.ext.Provider;
  
  import org.javamoney.moneta.Money;
  
  @Provider
  public class MoneyConverterProvider  implements ParamConverterProvider {
  
      private final MoneyConverter converter = new MoneyConverter();
  
      @Override
      public &lt;T&gt; ParamConverter&lt;T&gt; getConverter(Class&lt;T&gt; rawType, Type genericType, Annotation[] annotations) {
          if (!rawType.equals(Money.class)) return null;
          return (ParamConverter&lt;T&gt;) converter; 
      }
  
      public class MoneyConverter implements ParamConverter&lt;Money&gt; {
  
          public Money fromString(String value) {
              if (value == null ||value.isEmpty()) return null; // change this for production
  
              return Money.of(new BigDecimal(value), Monetary.getCurrency("AUD"));
          }
  
          public String toString(Money value) {
              if (value == null) return "";
              return value.toString(); // change this for production
          }
      }
  
  }
  </code></pre>
  
  <p>[1]</p>
  
  <pre><code>10:35:41,056 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 185) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./test2dbwar: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./test2dbwar: java.lang.IllegalArgumentException: Conflicting setter definitions for property "currency": javax.money.MonetaryAmountFactory#setCurrency(1 params) vs javax.money.MonetaryAmountFactory#setCurrency(1 params)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
  Caused by: java.lang.IllegalArgumentException: Conflicting setter definitions for property "currency": javax.money.MonetaryAmountFactory#setCurrency(1 params) vs javax.money.MonetaryAmountFactory#setCurrency(1 params)
      at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getSetter(POJOPropertyBuilder.java:293)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:246)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:127)
      at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:106)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:71)
      at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:342)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:127)
      at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:106)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:71)
      at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:342)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:127)
      at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:106)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:71)
      at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:342)
      at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:127)
      at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:106)
      at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:71)
      at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
      at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
      at io.swagger.util.ParameterProcessor.applyAnnotations(ParameterProcessor.java:175)
      at io.swagger.jaxrs.Reader.getParameters(Reader.java:914)
      at io.swagger.jaxrs.Reader.parseMethod(Reader.java:852)
      at io.swagger.jaxrs.Reader.read(Reader.java:293)
      at io.swagger.jaxrs.Reader.read(Reader.java:145)
      at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:223)
      at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:204)
  </code></pre>