Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-2015

old version of org.wildfly.swarm:config-api-runtime gets pulled in transitively in certain situations

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.1.0.Final
    • Component/s: None
    • Labels:
      None

      Description

      All the various Config API projects pull in the WildFly Config API Runtime:

      All of them refer to an old version.

      It can easily happen that the application pom.xml has a dependency on something that brings MP Config / Keycloak / NoSQL / Teiid Config API earlier than a dependency on something that would bring the core WildFly Config API. In such case, an old version of WildFly Config API Runtime wins over the correct one, resulting in exceptions like this:

      Error getting subresources for EJBFraction
      java.lang.RuntimeException: Failed to adopt value java.util.Map
              at org.wildfly.swarm.config.runtime.invocation.EntityAdapter.fromEntity(EntityAdapter.java:347)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.appendNode(Marshaller.java:33)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.marshalSubresources(Marshaller.java:129)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.appendNode(Marshaller.java:38)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.marshal(Marshaller.java:23)
              at org.wildfly.swarm.container.runtime.marshal.SubsystemMarshaller.marshal(SubsystemMarshaller.java:59)
              at org.wildfly.swarm.container.runtime.marshal.SubsystemMarshaller$Proxy$_$$_WeldClientProxy.marshal(Unknown Source)
              at org.wildfly.swarm.container.runtime.marshal.DMRMarshaller.marshal(DMRMarshaller.java:70)
              at org.wildfly.swarm.container.runtime.marshal.DMRMarshaller$Proxy$_$$_WeldClientProxy.marshal(Unknown Source)
              at org.wildfly.swarm.container.runtime.RuntimeServer.start(RuntimeServer.java:194)
              at org.wildfly.swarm.container.runtime.RuntimeServer$Proxy$_$$_WeldClientProxy.start(Unknown Source)
              at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:159)
              at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
              at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
              at org.wildfly.swarm.Swarm.start(Swarm.java:398)
              at org.wildfly.swarm.Swarm.main(Swarm.java:742)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
              at org.wildfly.swarm.bootstrap.Main.run(Main.java:132)
              at org.wildfly.swarm.bootstrap.Main.main(Main.java:85)
      Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
              at org.wildfly.swarm.config.runtime.invocation.MapTypeAdapter.toDmr(MapTypeAdapter.java:22)
              at org.wildfly.swarm.config.runtime.invocation.EntityAdapter.fromEntity(EntityAdapter.java:341)
              ... 22 more
      Error getting subresources for Workmanager
      java.lang.RuntimeException: Failed to adopt value java.util.Map
              at org.wildfly.swarm.config.runtime.invocation.EntityAdapter.fromEntity(EntityAdapter.java:347)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.appendNode(Marshaller.java:33)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.marshalSubresources(Marshaller.java:129)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.appendNode(Marshaller.java:38)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.marshalSubresources(Marshaller.java:129)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.appendNode(Marshaller.java:38)
              at org.wildfly.swarm.config.runtime.invocation.Marshaller.marshal(Marshaller.java:23)
              at org.wildfly.swarm.container.runtime.marshal.SubsystemMarshaller.marshal(SubsystemMarshaller.java:59)
              at org.wildfly.swarm.container.runtime.marshal.SubsystemMarshaller$Proxy$_$$_WeldClientProxy.marshal(Unknown Source)
              at org.wildfly.swarm.container.runtime.marshal.DMRMarshaller.marshal(DMRMarshaller.java:70)
              at org.wildfly.swarm.container.runtime.marshal.DMRMarshaller$Proxy$_$$_WeldClientProxy.marshal(Unknown Source)
              at org.wildfly.swarm.container.runtime.RuntimeServer.start(RuntimeServer.java:194)
              at org.wildfly.swarm.container.runtime.RuntimeServer$Proxy$_$$_WeldClientProxy.start(Unknown Source)
              at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:159)
              at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
              at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
              at org.wildfly.swarm.Swarm.start(Swarm.java:398)
              at org.wildfly.swarm.Swarm.main(Swarm.java:742)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
              at org.wildfly.swarm.bootstrap.Main.run(Main.java:132)
              at org.wildfly.swarm.bootstrap.Main.main(Main.java:85)
      Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
              at org.wildfly.swarm.config.runtime.invocation.MapTypeAdapter.toDmr(MapTypeAdapter.java:22)
              at org.wildfly.swarm.config.runtime.invocation.EntityAdapter.fromEntity(EntityAdapter.java:341)
              ... 24 more
      

      If you look at the source code of the new Config API Runtime, the stack trace doesn't make any sense. However, mvn dependency:tree reveals the truth – it's the old Config API Runtime that throws this exception.

      The problem is that the old Config API Runtime shouldn't be present at all.

      Not sure how to fix that.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lthon Ladislav Thon
                  Reporter:
                  lthon Ladislav Thon
                • Votes:
                  8 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: