XML unmarshal error in ServerTest.java

97 views
Skip to first unread message

Antoine Morel

unread,
Jul 16, 2018, 11:07:49 AM7/16/18
to simplenlg
Hello all, 

When i'm lauching the 
ServerTest.java of SimpleNLG, it raises the following error :

simplenlg.xmlrealiser.XMLRealiserException: XML unmarshal error
    at simplenlg.xmlrealiser.UnWrapper.getNLGSpec(UnWrapper.java:95)
    at simplenlg.xmlrealiser.XMLRealiser.getRequest(XMLRealiser.java:201)
    at simplenlg.server.RealisationRequest.doRealisation(RealisationRequest.java:137)
    at simplenlg.server.RealisationRequest.run(RealisationRequest.java:92)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: javax.xml.bind.JAXBException
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:241)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:477)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:656)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:599)
    at simplenlg.xmlrealiser.UnWrapper.getNLGSpec(UnWrapper.java:85)
    ... 4 more
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    at javax.xml.bind.ContextFinder.safeLoadClass(ContextFinder.java:594)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:239)
    ... 8 more
Realisation: Exception: XML unmarshal error 


I tried with several version of JAXB (2.3.0, 2.2.12 and 2.2.0) but the error is the same.
I also tried to modify XML headers in simpleNLG (Inspired by https://groups.google.com/forum/#!topic/simplenlg/Zv2uMH12fds) but it did not work.

I can launch the server by running SimpleServer.java, but when i try to use it (for example with the python librairy nlglib : https://github.com/roman-kutlak/nlglib), it raises the same error.

Thanks

Antoine Morel

Saad Mahamood

unread,
Jul 16, 2018, 11:11:06 AM7/16/18
to simp...@googlegroups.com
Hi Antoine,

Which version of Java are you using? If I remember correctly Java 1.9 and higher will cause this error due to changes in the standard Java library as part of project jigsaw.

These are issues I will need to fix, once I have some free time to address them.

Many Thanks,

Saad Mahamood.

--
You received this message because you are subscribed to the Google Groups "simplenlg" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplenlg+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antoine Morel

unread,
Jul 16, 2018, 11:16:29 AM7/16/18
to simplenlg
Thanks for your answer,

Indeed, I'm using java 10.0.1. 
Reply all
Reply to author
Forward
0 new messages