-
Bug
-
Resolution: Done
-
Major
-
14.0.7.Final
-
None
The following XML:
<distributed-cache owners="2" mode="SYNC" statistics="false"> <security> <authorization /> </security> <encoding media-type="application/x-java-serialized-object" /> </distributed-cache>
Is serialized to JSON as:
{"myxmlcache":{"distributed-cache":{"owners":"2","mode":"SYNC","statistics":false,"encoding":{"media-type":"application/x-java-serialized-object"},"security":{"authorization":{"enabled":true,"roles":[]}}}}}
When attempting to parse ^ JSON, the CacheParser throws the following exception:
org.infinispan.commons.configuration.io.ConfigurationReaderException: Unexpected element 'roles' encountered[1,0]
at org.infinispan.configuration.parsing.ParseUtils.unexpectedElement(ParseUtils.java:41)
at org.infinispan.configuration.parsing.ParseUtils.requireNoContent(ParseUtils.java:160)
at org.infinispan.configuration.parsing.CacheParser.parseCacheAuthorization(CacheParser.java:357)
at org.infinispan.configuration.parsing.CacheParser.parseCacheSecurity(CacheParser.java:328)
at org.infinispan.configuration.parsing.CacheParser.parseCacheElement(CacheParser.java:451)
at org.infinispan.configuration.parsing.CacheParser.parseSharedStateCacheElement(CacheParser.java:226)
at org.infinispan.configuration.parsing.CacheParser.parseDistributedCache(CacheParser.java:1084)
at org.infinispan.configuration.parsing.CacheParser.readElement(CacheParser.java:122)
at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:209)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:187)
at org.infinispan.configuration.ConfigurationConversionTest.convert(ConfigurationConversionTest.java:43)
at org.infinispan.configuration.ConfigurationConversionTest.testAuthorizationRoles(ConfigurationConversionTest.java:30)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)