[infinispan-issues] [JBoss JIRA] (ISPN-6735) XML Serializer serializes the hashFunctionClass attribute to hash which later is not parsed

Anna Manukyan (JIRA) issues at jboss.org
Tue May 31 04:55:00 EDT 2016


Anna Manukyan created ISPN-6735:
-----------------------------------

             Summary: XML Serializer serializes the hashFunctionClass attribute to hash which later is not parsed
                 Key: ISPN-6735
                 URL: https://issues.jboss.org/browse/ISPN-6735
             Project: Infinispan
          Issue Type: Bug
          Components: Configuration
            Reporter: Anna Manukyan


When the 6.0 version config xml contains {{hashFunctionClass}} attribute on {{hash}} tag, then later the serialized xml is not parsed.

The following xml:
{code}
<namedCache name="dist_with_capacity_factors">
        <clustering mode="distribution">
            <stateTransfer timeout="120000" />
            <sync />
            <hash numOwners="3" numSegments="1000" capacityFactor="0" hashFunctionClass="org.infinispan.commons.hash.MurmurHash3" />
            <l1 enabled="true" lifespan="610000" />
        </clustering>
    </namedCache>
{code}

is serialized to:

{code}
<distributed-cache hash="org.infinispan.commons.hash.MurmurHash3" owners="3" segments="1000" capacity="0.0" mode="SYNC" name="dist_with_capacity_factors" statistics="false">
            <locking concurrency-level="100" acquire-timeout="1000"/>
            <transaction mode="NONE" reaper-interval="123" complete-timeout="3123"/>
            <state-transfer timeout="120000"/>
        </distributed-cache>
{code}

and the parsing of the serialized xml gives the following exception :
{code}
org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[162,182]
Message: Unexpected attribute 'hash' encountered

	at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:120)
	at org.infinispan.test.fwk.TestCacheManagerFactory.fromStream(TestCacheManagerFactory.java:117)
	at org.infinispan.test.fwk.TestCacheManagerFactory.fromXml(TestCacheManagerFactory.java:100)
	at org.infinispan.tools.ConfigurationConverterTest.testConversionAndSerializationFrom60(ConfigurationConverterTest.java:66)
	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:497)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
	at org.testng.SuiteRunner.run(SuiteRunner.java:254)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:122)
	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:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[162,182]
Message: Unexpected attribute 'hash' encountered
	at org.infinispan.configuration.parsing.ParseUtils.unexpectedAttribute(ParseUtils.java:54)
	at org.infinispan.configuration.parsing.Parser.parseCacheAttribute(Parser.java:1198)
	at org.infinispan.configuration.parsing.Parser.parseClusteredCacheAttribute(Parser.java:1845)
	at org.infinispan.configuration.parsing.Parser.parseDistributedCache(Parser.java:1969)
	at org.infinispan.configuration.parsing.Parser.parseContainer(Parser.java:587)
	at org.infinispan.configuration.parsing.Parser.readElement(Parser.java:114)
	at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:161)
	at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:141)
	at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:128)
	at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:115)
	... 31 more
{code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the infinispan-issues mailing list