Problem with the old version of xercesImpl.jar
Hello,
As i am working with reading and writing of XML file and i am using classes available under the package org.w3c.dom.*. MPS have xercesImpl.jar available under lib folder which is getting loaded when i start MPS. Cause of this i am getting NoSuchMethodException for the code as below.
DOMImplementationLSdomImplementation=(DOMImplementationLS)doc.getImplementation();
LSSerializerlsSerializer=domImplementation.createLSSerializer();
When i use xercesImpl-2.6.1.jar specific to my Solution the problem resolves. Is there any specific reason ,
MPS using a older version of xercesImpl? I guises many will be using org.w3c.dom.*(As comes with JDK) and availability of xercesImpl.jar in the lib folder is problematic, unless MPS changes the current class loader implementation.
As i can see many issues are logged related to the same:
eg: https://mps-support.jetbrains.com/hc/en-us/community/posts/206614495-Java-Class-Cast-Exception-in-MPS-Class-Loader-Issue-
Please share if anybody have information about this.
Thanks & Regards,
Sanjit Kumar Mishra
Please sign in to leave a comment.
I have also experienced this issue. I have used the ClassLoader trick as a workaround but I definitely think this issue should be solved.
@Federico Tomassetti: ClassLoader trick does not work always example:
//////////////////////////// CODE COMENT //////////////////////////////
//This coding is correct but will not work with current MPS//
//////////////////////////////////////////////////////////////////////////////////////
Following works for me on MPS 3.3.5
@m sch95: Yes this is the class loader trick to avoid Class cast exception but there are other problems as i discussed in my question and one of the comment related to xercesImpl.jar implementation in MPS.