Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-763

Persisting an empty list [] gets read as a list with empty string [""] resulting in IllegalArgumentException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.0.0.CR7, 2.0.0.Alpha5
    • 1.0.0.CR6, 2.0.0.Alpha4
    • Management
    • None

      In short, the default AttributeParser/AttributeMarshaller for list attributes do not handle empty lists in a symmetric fashion.
      e.g. if I persist an empty list to xml, and read it back again, using the default parser/marshaller, I should get back an empty list. Instead I get back a list of size 1 containing an empty string.

      Affects at least infinispan aliases and modcluster proxies...

      (20:09:22) rhusar: pferraro: https://gist.github.com/rhusar/5eef22d7a6479f042a5d#file-gistfile1-txt-L23
      (20:09:34) rhusar: pferraro: if i write an empy list, read it back -> empty list
      (20:09:57) rhusar: pferraro: if i use the default writeAttribute, reload, read it back and i have a list of size 1 containing empty String..
      (20:23:23) rhusar: pferraro: alright, this is also "broken" in the infiinispan subsystem aliases

      (20:23:24) rhusar: pferraro: 20:22:55,775 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool – 40) WFLYCTL0013: Operation ("add") failed - address: ([
      (20:23:24) rhusar: ("subsystem" => "infinispan"),
      (20:23:24) rhusar: ("cache-container" => "hibernate")
      (20:23:24) rhusar: ]): java.lang.IllegalArgumentException: Empty name segment is not allowed for infinispan
      (20:23:24) rhusar: at org.jboss.msc.service.ServiceName.of(ServiceName.java:90)
      (20:23:24) rhusar: at org.jboss.msc.service.ServiceName.append(ServiceName.java:117)
      (20:23:24) rhusar: at org.wildfly.clustering.infinispan.spi.service.CacheContainerServiceName$1.getServiceName(CacheContainerServiceName.java:35)
      (20:23:24) rhusar: at org.jboss.as.clustering.infinispan.subsystem.CacheContainerBuilder.build(CacheContainerBuilder.java:79)
      (20:23:24) rhusar: at org.jboss.as.clustering.infinispan.subsystem.CacheContainerAddHandler.installRuntimeServices(CacheContainerAddHandler.java:165)
      (20:23:24) rhusar: at org.jboss.as.clustering.infinispan.subsystem.CacheContainerAddHandler.performRuntime(CacheContainerAddHandler.java:82)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractAddStepHandler.performRuntime(AbstractAddStepHandler.java:309)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:130)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:822)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:620)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:373)
      (20:23:24) rhusar: at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:349)
      (20:23:24) rhusar: at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:359)
      (20:23:24) rhusar: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      (20:23:24) rhusar: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      (20:23:24) rhusar: at java.lang.Thread.run(Thread.java:745)
      (20:23:24) rhusar: at org.jboss.threads.JBossThread.run(JBossThread.java:320)

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: