1

I've got an issue while deploing with putting key value into the infinispan cache some object ISPN000559: Cannot marshall 'class org.infinispan.marshall.protostream.impl.MarshallableUserObject': org.w3c.dom.ls.LSException

from the stacktrace I see that it calls org.apache.xerces@2.12.0.SP03//org.apache.xml.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:518) from the deprecated class, but as I understand it should use xalan serializer 2.7.2 instead

when I trying to serialize it from our app, it uses the correct serializer using this code from xercesImpl-2.12.2 CoreDomImplementationImpl.java

public LSSerializer createLSSerializer() {
        try {
            Class serializerClass = ObjectFactory.findProviderClass(
                "org.apache.xml.serializer.dom3.LSSerializerImpl",
                ObjectFactory.findClassLoader(), true);
            return (LSSerializer) serializerClass.newInstance();
        }
        catch (Exception e) {}
        // Fall back to Xerces' deprecated serializer if 
        // the Xalan based serializer is unavailable.
        return new DOMSerializerImpl();
    }

we call it like this

    public static @Null
    String documentToString(@Null Document document) {
        if (document == null) {
            return null;
        }
        DOMImplementationLS domImplementation = (DOMImplementationLS) document.getImplementation();
        LSSerializer lsSerializer = domImplementation.createLSSerializer();

        String result = lsSerializer.writeToString(document);
      
        return result;
    }

please help me to understand why incorrect serializer is used while deploy and how to fix it; needed library xalan-2.7.2 is present in WEB-INF\lib\

orgWildflyVersion = '26.1.2.Final' infinispanVersion = '13.0.10.Final'

Victoria
  • 21
  • 4

0 Answers0