Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2042

module.xml in resteasy-jaxrs is missing dependency to microprofile-config-api

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.6.2.Final, 4.0.0.Beta6
    • 3.6.1.Final
    • jaxrs
    • None

      not sure if this is to be reported here or if it belongs to the wildfly integration:

      the module.xml of org.jboss.resteasy.resteasy-jaxrs in Wildfly 14.0.0.Final does not have a dependency to org.eclipse.microprofile.config.api, but if there are dependencies to it in the code, if you are using the microprofile-restclient as well.

      Code like this

      @Produces(MediaType.APPLICATION_JSON)
      @RegisterProvider(QuickQuoteResponseExceptionMapper.class)
      @Dependent
      public interface QuickQuoteService {
        @GET
        @Path("/quote.htm")
        Response retrieve(@QueryParam("symbols") String symbols, @QueryParam("output") String output);
      }
      
      with producer
      
      @Produces
        public QuickQuoteService createQuickQuoteService() {
          return RestClientBuilder.newBuilder().baseUrl(baseUrl).register(QuickQuoteResponseExceptionMapper.class)
              .build(QuickQuoteService.class);
        }
      

      fails at deployment because of

      Caused by: javax.enterprise.inject.CreationException
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      	at java.base/java.lang.Class.newInstance(Class.java:584)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:103)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:103)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:180)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.contexts.unbound.DependentContextImpl.get(DependentContextImpl.java:70)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:700)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:800)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.util.Beans.injectBoundFields(Beans.java:336)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:347)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:69)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:71)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:117)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:140)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:102)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
      	at deployment.stomp-test-v1.5.war//x1.stomp.control.QuoteRetriever$Proxy$_$$_WeldClientProxy.retrieveQuotes(Unknown Source)
      	at deployment.stomp-test-v1.5.war//x1.stomp.control.QuoteUpdater.updateQuotes(QuoteUpdater.java:75)
      	at deployment.stomp-test-v1.5.war//x1.stomp.control.QuoteUpdater.onSchedule(QuoteUpdater.java:65)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:50)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:61)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
      	at org.jboss.as.weld.common@14.0.1.Final//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:90)
      	at org.jboss.as.weld.common@14.0.1.Final//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:61)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:50)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:61)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.as.ejb3@14.0.1.Final//org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:49)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:40)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:53)
      	at org.jboss.as.ee@14.0.1.Final//org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.as.ejb3@14.0.1.Final//org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.as.ejb3@14.0.1.Final//org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
      	at org.jboss.invocation@1.5.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
      	at org.jboss.as.ejb3@14.0.1.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:237)
      	... 36 more
      Caused by: java.lang.NoClassDefFoundError: org/eclipse/microprofile/config/spi/ConfigProviderResolver
      	at org.jboss.resteasy.resteasy-jaxrs@3.6.1.Final//org.jboss.resteasy.client.microprofile.MicroprofileClientBuilder.<init>(MicroprofileClientBuilder.java:53)
      	at org.jboss.resteasy.resteasy-jaxrs@3.6.1.Final//org.jboss.resteasy.client.microprofile.MicroprofileClientBuilderResolver.newBuilder(MicroprofileClientBuilderResolver.java:12)
      	at org.eclipse.microprofile.restclient//org.eclipse.microprofile.rest.client.RestClientBuilder.newBuilder(RestClientBuilder.java:41)
      	at deployment.stomp-test-v1.5.war//x1.stomp.control.Resources.createQuickQuoteService(Resources.java:18)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.jboss.weld.core@3.0.5.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
      	... 93 more
      

      adding

      <module name="org.eclipse.microprofile.config.api"/>

      to module.xml seems to fix the problem

              rhn-support-asoldano Alessio Soldano
              by-tor2 Johannes Beck (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: