Ilia Basin (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjgzZmUwNGVk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16373?atlOrigin=eyJpIjoiYjgzZm...
) HHH-16373 (
https://hibernate.atlassian.net/browse/HHH-16373?atlOrigin=eyJpIjoiYjgzZm...
) NPE when trying to marshal null AccessType in JaxbEntityMappings (
https://hibernate.atlassian.net/browse/HHH-16373?atlOrigin=eyJpIjoiYjgzZm...
)
Change By: Ilia Basin (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
I used {{hibernate.transform_hbm_xml.enabled}} to convert a legacy {{.hbm.xml}} to the
modern format and then tried to dump it as XML to standard output.
I used {{org.glassfish.jaxb:jaxb-runtime:4.0.2}}
{code:java}JaxbEntityMappings obj = ...
jaxbContext = JAXBContext.newInstance(JaxbEntityMappings.class);
final Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(obj, System.out);{code}
Got this error:
{ \{noformat} }
Caused by: java.lang.NullPointerException
at
org.hibernate.boot.jaxb.mapping.marshall.AccessTypeMarshalling.toXml(AccessTypeMarshalling.java:22)
at org.hibernate.boot.jaxb.mapping.Adapter1.marshal(Adapter1.java:17)
at org.hibernate.boot.jaxb.mapping.Adapter1.marshal(Adapter1.java:7)
at
org.glassfish.jaxb.runtime.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:46)
... 23 more
{ \{noformat} }
Same problem with the class {{FetchTypeMarshalling}}
I think a null check is needed in {{toXml()}}
(
https://hibernate.atlassian.net/browse/HHH-16373#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16373#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:ac3e918 )