XML Schema 1.1 and apache xerces

This should cover W3C XML Schema, Relax NG and DTD related problems.
mgoik
Posts: 2
Joined: Sun Jan 15, 2017 2:58 pm

XML Schema 1.1 and apache xerces

Post by mgoik » Wed Feb 21, 2018 12:51 am

I found a subtle XML Schema validation difference between Oxygenxml IDE and the following xerces Maven artifact supporting XML schema 1.1:

Code: Select all

...
<dependency>
<groupId>org.opengis.cite.xerces</groupId>
<artifactId>xercesImpl-xsd11</artifactId>
<version>2.12-beta-r1667115</version>
</dependency>
The schema problem itself is not relevant but my intention is to keep the Oxygenxml IDE and related Java applications in sync. So I tried to follow topic11078.html#p31948 using:

Code: Select all

<repositories>
<repository>
<id>oxygenxml-repo</id>
<url>http://www.oxygenxml.com/maven</url>
</repository>
</repositories>
...
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-xercesImpl</artifactId>
<version>19.1.0.3</version>
</dependency>
...
This leaves me with:

Code: Select all

java.lang.NoClassDefFoundError: ro/sync/exml/validate/c/f

at org.apache.xerces.impl.dtd.XMLDTDValidator.<init>(Unknown Source)
at org.apache.xerces.impl.dtd.XMLNSDTDValidator.<init>(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.<init>(Unknown Source)
at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.<init>(Unknown Source)
at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.xerces.parsers.ObjectFactory.newInstance(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setFeature(Unknown Source)
at org.apache.logging.log4j.core.config.xml.XmlConfiguration.enableXInclude(XmlConfiguration.java:106)
at org.apache.logging.log4j.core.config.xml.XmlConfiguration.newDocumentBuilder(XmlConfiguration.java:84)
at org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:137)
at org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:44)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:472)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:442)
at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:254)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:419)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:426)
at de.hdm_stuttgart.mi.unitmarking.xsd.InstanceSetEvaluation.<clinit>(InstanceSetEvaluation.java:36)
at de.hdm_stuttgart.mi.sda1.exam.xsd.test.SchemaTest.testXmlInstanceSet(SchemaTest.java:19)
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:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: ro.sync.exml.validate.c.f
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more

Process finished with exit code 255
Am I missing some dependencies from https://www.oxygenxml.com/maven/com/oxygenxml ? Which one(s)?

alex_jitianu
Posts: 705
Joined: Wed Nov 16, 2005 11:11 am

Re: XML Schema 1.1 and apache xerces

Post by alex_jitianu » Thu Feb 22, 2018 1:31 pm

Hello,

We have a number of patches inside Xerces which call inner Oxygen code. Adding this dependency should fix the exception:

Code: Select all

		<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen</artifactId>
<version>19.1.0.3</version>
</dependency>
Best regards,
Alex

Post Reply