2 Replies Latest reply on Jan 23, 2015 9:52 AM by Marian Seitner

    Tons of WELD-001125: Illegal bean type warnings

    Marian Seitner Newbie

      Hi,

       

      I'm trying to integrate Weld 2.2.9 into a Maven-based "hello world"-style Dropwizard application and package everything as a fat jar using the maven-shade plugin. The application is running fine from within Eclipse without any unexpected warnings. In order to get the fat jar running I had to exclude some transitive dependencies to overcome ClassNotFoundExceptions and to exclude some packages from bean discovery. With that I got the application running but I see tons of warnings:

       

      WARN  [2015-01-23 03:15:31,493] org.jboss.weld.Bootstrap: WELD-001125: Illegal bean type javax.ws.rs.ext.MessageBodyWriter<com.google.common.base.Optional<?>> ignored on [EnhancedAnnotatedTypeImpl] public @Produces @Provider class io.dropwizard.jersey.guava.OptionalMessageBodyWriter

      WARN  [2015-01-23 03:15:31,620] org.jboss.weld.Bootstrap: WELD-001125: Illegal bean type jersey.repackaged.com.google.common.base.Function<java.lang.reflect.Constructor<?>, java.lang.Boolean> ignored on [EnhancedAnnotatedTypeImpl] static  class jersey.repackaged.com.google.common.util.concurrent.Futures$5

      WARN  [2015-01-23 03:15:31,659] org.jboss.weld.Bootstrap: WELD-001125: Illegal bean type interface com.fasterxml.jackson.databind.util.Converter<class java.lang.Object,java.lang.Iterable<?>> ignored on [EnhancedAnnotatedTypeImpl] static  class com.fasterxml.jackson.datatype.guava.GuavaSerializers$FluentConverter

      WARN  [2015-01-23 03:15:31,659] org.jboss.weld.Bootstrap: WELD-001125: Illegal bean type com.fasterxml.jackson.databind.util.StdConverter<java.lang.Object, java.lang.Iterable<?>> ignored on [EnhancedAnnotatedTypeImpl] static  class com.fasterxml.jackson.datatype.guava.GuavaSerializers$FluentConverter

      WARN  [2015-01-23 03:15:31,691] org.jboss.weld.Bootstrap: WELD-001125: Illegal bean type com.google.common.reflect.TypeToken.com.google.common.reflect.TypeToken$TypeCollector<com.google.common.reflect.TypeToken<?>> ignored on [EnhancedAnnotatedTypeImpl] static  class com.google.common.reflect.TypeToken$TypeCollector$1

      ...

       

      Application startup increased from ~3 seconds (Eclipse) to ~10 seconds (far jar). I assume Weld scans far more classes in the latter case although I don't understand why.


      In case it's of relevance: Dropwizard integrates Jersey so I included the cdi-hk2 bridge as explained here. When running the fat jar I also see a lot of warnings from Jersey (that do not appear when running from Eclipse):


      WARN  [2015-01-23 03:15:33,117] org.glassfish.jersey.internal.Errors: The following warnings have been detected: WARNING: Parameter 1 of type ch.qos.logback.core.pattern.Converter<E> from public void ch.qos.logback.core.pattern.CompositeConverter.setChildConverter(ch.qos.logback.core.pattern.Converter<E>) is not resolvable to a concrete type.

      WARNING: Parameter 1 of type ch.qos.logback.core.pattern.Converter<E> from public final void ch.qos.logback.core.pattern.Converter.setNext(ch.qos.logback.core.pattern.Converter<E>) is not resolvable to a concrete type.

      WARN  [2015-01-23 03:15:33,123] org.glassfish.jersey.internal.Errors: The following warnings have been detected: WARNING: Parameter 1 of type ch.qos.logback.core.pattern.Converter<E> from public void ch.qos.logback.core.pattern.CompositeConverter.setChildConverter(ch.qos.logback.core.pattern.Converter<E>) is not resolvable to a concrete type.

      WARNING: Parameter 1 of type ch.qos.logback.core.pattern.Converter<E> from public final void ch.qos.logback.core.pattern.Converter.setNext(ch.qos.logback.core.pattern.Converter<E>) is not resolvable to a concrete type.

      WARN  [2015-01-23 03:15:33,409] org.glassfish.jersey.internal.Errors: The following warnings have been detected: WARNING: Parameter 1 of type javax.validation.spi.ValidationProvider<?> from public final void org.hibernate.validator.internal.xml.ValidationBootstrapParameters.setProvider(javax.validation.spi.ValidationProvider<?>) is not resolvable to a concrete type.

      ...

       

      Any ideas what's going on here?