tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: Johnzon - bugs or features?
Date Wed, 01 Jun 2016 09:04:59 GMT
Reading your mail I suspect you miss the main point of johnzon which is to
map java model to json as 1-1 as do any other mapper (jackson, genson,

This also means you can put all the JAXB annotations you want on your model
they will just get ignored by johnzon. Then I'm not sure if it is relevant
to answer your JAXB questions, assuming not.

About as mentionned we are finishing the migration to
the TLP and our site redeployment is not yet on the TLP domain so site is
not yet up to date (should be this or next week). is more up to date. It surely lacks
few things but explains the mapping. Feel free to do a PR on
if you think anything is missing.

Side note: johnzon is in production since years without troubles cause it
just do what everyone asked when we had jettison which was not json
friendly at all. I understand that during a migration it can hurt (that
said nothing prevents you to add jettison in your app and get back the old
behavior) but this change has been smooth for a lot of people.

Romain Manni-Bucau
@rmannibucau <> |  Blog
<> | Github <> |
LinkedIn <> | Tomitriber
<> | JavaEE Factory

2016-06-01 9:49 GMT+02:00 tam <>:

> I made the following observations during the migration to 7.0.0, caused by
> the change to Johnzon for JAXB. I am curious whether these are intentional,
> still bugs, or my fault:
> Modifying JAXB annotations
> It appears to me that modifications in my JAXB annotations (like
> @XmlRootElement) only take effect after restarting the server.
> Auto-deploying won't notice those changes. (Although it notices other
> annotation changes like Just reloading the app via the TomEE
> manager console doesn't work either. Is there a way to have those
> annotations processed at every deployment?
> JAXB annotations in inner classes
> For small JAXB-annotated DTOs that are only relevant for one web service
> operation, I'd like to define them as inner classes of the class using
> them.
> However, JAXB annotations appear not to be processed in an inner class. Is
> that right?
> Getters and setters of JAXB annotated classes
> Even if I declare @XmlAccessorType(XmlAccessType.FIELD), it appears that
> JAXB annotations only take effect if the class has getters and setters. (I
> didn't try with getters only or setters only.) In particular for the
> aforementioned DTO classes, these are superfluous. Any way to do without
> them?
> Nested objects don't get serialized
> An attribute
> where A is also JAXB annotated, doesn't lead to a nested JSON structure, no
> matter whether I put @XmlElement or @XmlElementWrapper in front or not. (I
> also tried with List instead of Set.) Are there any limitations yet, or any
> not yet documented annotations to write?
> Documentation of available options and their (de)serializing effect
> The change in wrapping (discussed in
> )
> and the failure concerning nested objects makes me suspicious of that
> Johnzon thing. How are we to know what it accepts and how it reacts to
> which
> annotation if it's nowhere documented? (The "documentation" in
> is a joke.) Unless there exists complete and
> reliable documentation of such a library, it should be thrown out of the
> application server, as it's obviously not mature yet for production
> environments.
> --
> View this message in context:
> Sent from the TomEE Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message