You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom namespace marshalling using JAXB Glassfish results in property "org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper" is not supported
#306
Closed
Aravinda93 opened this issue
Mar 8, 2024
· 2 comments
I am using the Jakarta/Glassfish to marshall the Java objects into XML but during the marshalling I need to provide some of the custom namespaces to my Marshaller and JAXBContext. I referred the documentation and answer here to do the same but its resulting in the error:
Exception in thread "main" jakarta.xml.bind.JAXBException: property "org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper" is not supported
at org.glassfish.jaxb.runtime.v2.ContextFactory.createContext(ContextFactory.java:126)
at org.glassfish.jaxb.runtime.v2.ContextFactory.createContext(ContextFactory.java:246)
at org.glassfish.jaxb.runtime.v2.JAXBContextFactory.createContext(JAXBContextFactory.java:58)
at jakarta.xml.bind.ContextFinder.find(ContextFinder.java:324)
at jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:392)
at io.test.convert.MainXML.main(MainXML.java:27)
Following is the completed code I have: Child1.class:
this is a project for jakarta.xml.bind-api, the problem you seem to have is related to jaxb-runtime. The best would be to file issue there, in the runtime project's tracker and that is at https://github.com/eclipse-ee4j/jaxb-ri/issues
@lukasj Thanks for the guidence and sorry for posting the in the wrong repo.
As informed I have posted in the correct repo now, can you please have a look and provide some response? eclipse-ee4j/jaxb-ri#1795
I am using the
Jakarta/Glassfish
to marshall the Java objects into XML but during the marshalling I need to provide some of the custom namespaces to myMarshaller
andJAXBContext
. I referred the documentation and answer here to do the same but its resulting in the error:Following is the completed code I have:
Child1.class
:Parent.class
:CustomNamespacePrefixMapper.class
:MainXML.class
:Following is my
sampleXML.xml
:When I run I get the error:
How to provide the custom namespaces to the
JAXBContext/Marshaller
so it can be used during the marshalling of the Java objects to XML?Following are my dependencies:
The text was updated successfully, but these errors were encountered: