Page 1 of 1
JAXBException namespacePrefixMapper is null

Posted:
Sun Jul 28, 2019 10:33 pm
by borja
Hi,
This is first time i'm using docx4j with MAVEN. Im following the instructions on getting started guide. (java version 1.8 and OpenJDK 13)
So, Im using OpenJDK 13 i think i cannot use JAXB internal (is this right?), anyway i tried and i get a class not found exception of com.sun.xml.internal.bind.v2.ContextFactory
Because of this, Im trying now reference implementation. I tried versions 8.1.0, 8.1.1 and 11.1.0 and i get this error:
javax.xml.bind.JAXBException: namespacePrefixMapper is null
So im unable to get docx4j working with maven.
Any help?
Thanks
Re: JAXBException namespacePrefixMapper is null

Posted:
Mon Jul 29, 2019 12:25 am
by borja
I changed my JDK version to 8 and using jaxb-internal i get same error javax.xml.bind.JAXBException: namespacePrefixMapper is null
I read in other thread that you plan to release 8.1.2 version to fix this issue next week. But im not using any kind of multithreading here.
Re: JAXBException namespacePrefixMapper is null

Posted:
Tue Jul 30, 2019 7:31 am
by jason
What are your Maven dependencies?
Re: JAXBException namespacePrefixMapper is null

Posted:
Wed Jul 31, 2019 3:12 am
by borja
Hi Jason,
Now, i only have:
- Code: Select all
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-JAXB-Internal</artifactId>
<version>8.1.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
The others are related to spring boot. Anyway im going to wait until next release and see if it works.
Is there compatibility issues with OpenJDK? Because other times i used docx4j i always used oracle.
Thank you!
Re: JAXBException namespacePrefixMapper is null

Posted:
Wed Jul 31, 2019 6:20 pm
by jason
Those deps look good.
8.1.2 is out now, so please try it and let us know whether it helps.
OpenJDK is generally fine.
Re: JAXBException namespacePrefixMapper is null

Posted:
Thu Aug 01, 2019 7:35 am
by borja
Hi,
I checked the new release. I get a different error, but seems to be a problem related to my environment. Because i have synced the project to other computer and it works perfectly well.
I get this error:
org.docx4j.openpackaging.exceptions.Docx4JException: Error marshalling Content_Types
Using Pop!_OS 19.04
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.19.04.2-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
In the other computer that it works im using Debian 9 but don't remember what version of JDK, but im sure its oracle and not OpenJDK. This could be the problem?
Thank you
Re: JAXBException namespacePrefixMapper is null

Posted:
Sat Aug 03, 2019 6:36 am
by jason
What's the complete stack trace? What code triggers it? Does it happen with a simple Hello World.docx?
Re: JAXBException namespacePrefixMapper is null

Posted:
Tue Aug 06, 2019 5:01 am
by borja
Sorry for delay. I will try to provide you this info and do some tests.