I have written a language that generates a small java program from a concept. This program uses Apache Jena to perform a SPARQL query on a Web Ontology Language (OWL) file. So far so good. When I generate the Java source everything is fine and when I run the generated source my query is executed and the result returned.
So far so good.
Now I tried to embed this functionality into a MPS plugin since I would like to have a window that can browse a OWL file and display information from it in MPS.
I have created a plugin solution for this with the following files:
What I want to achive:
- standalone plugin descriptor
- baselanguage class subclassing JPanel (it's just a JPanel containing a label and a button)
- action file to open my tool
- group file that adds my action to the IDEAMainMenu bar
- tool file for instancing my JPanel subclass in MPS
The SPARQL query should be performed when I click on the button and the result should get displayed in the label of my Panel. What actually happens:
The plugin is added to MPS at runtime and I can open my custom window with my label and button. But when I hit the button to perform the SPARQL query I get the following exception:DVFactoryException DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.: DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
Here is the Stacktrace:
My current guess is that the apache xerces lib provided with MPS is loaded in the classpath before the xerces version provided by apache jena is loaded. Therefore a wrong xerces class is used when executing the SPARQL query.
Does somebody have a hint how this can be solved?