tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
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,
etc...).

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 johnzon.apache.org: 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).
http://johnzon.incubator.apache.org/ is more up to date. It surely lacks
few things but explains the mapping. Feel free to do a PR on
https://github.com/apache/incubator-johnzon/blob/master/src/site/markdown/index.md
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 <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-01 9:49 GMT+02:00 tam <tam@tamatzner.de>:

> 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 javax.ws.rs.) 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
>
> http://tomee-openejb.979440.n4.nabble.com/JsonGenerationException-after-migrating-to-7-0-0-tc4678684.html
> )
> 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
> http://johnzon.apache.org/ 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:
> http://tomee-openejb.979440.n4.nabble.com/Johnzon-bugs-or-features-tp4678708.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

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