Hi Paul, Thank you for the great feedback and for the tips. Maybe you would like to contribute a couple of samples that showcase these changes?
If you find an issue with M2, please report it back :) Cheers, Roberto > On 6 Feb 2019, at 21:12, Paul Carter-Brown <paul.carter-br...@jini.guru> > wrote: > > Just a quick thanks to the TomEE team. We have successfully migrated about > 5 of our different projects from 7.0.4 to 8.0.0-M2 and it went pretty > smoothly. Things seem to be running nicely and we're loving JSON-B as > compared to having to use implementation specific JSON annotations. > > The biggest changes we needed to make: > > - Changing Johnzon specific annotations to JSONB > - Registering our own adapters for ZonedDateTime conversions in JSONB > and creating a custom PropertyVisibilityStrategy to process protected > fields (our POJO's are generated from XSD's using JAXB and the have a > getter for fields which are lists and no associated setter. So to populate > these objects from JSON we needed to make the protected fields get processed > > public class JsonbConfiguration implements ContextResolver<Jsonb> { > > private Jsonb jsonb; > > public JsonbConfiguration() { > JsonbConfig config = new JsonbConfig() > .withPropertyVisibilityStrategy(new > PropertyVisibilityStrategy() { > @Override > public boolean isVisible(Field field) { > return Modifier.isPublic(field.getModifiers()) > || > Modifier.isProtected(field.getModifiers()); > } > > @Override > public boolean isVisible(Method method) { > return Modifier.isPublic(method.getModifiers()); > } > }) > .withAdapters(new ZonedDateTimeAdapter()); > > jsonb = JsonbBuilder.create(config); > } > > @Override > public Jsonb getContext(Class<?> type) { > return jsonb; > } > } > > - We noticed a change in CXF jax-rs client behaviour. Before we could > call builder.header and add a header, and later call builder.headers to add > more headers and it would still have our header we added with > builder.header. It seems like now it obeys the spec and calling > builder.headers clears out any previous headers we added. This change had > us foxed for a while. > - Another slightly strange CXF change was that calling: > Invocation.Builder builder = webTarget.request(MediaType.APPLICATION_JSON); > and then adding headers with builder.headers would end up with the Accept > header being "*/*". It didnt used to do that. So we needed to change: > > Invocation.Builder builder = > webTarget.request(MediaType.APPLICATION_JSON); > if (headers != null) { > builder = builder.headers(headers); > } > > > TO: > > Invocation.Builder builder = webTarget.request(); > if (headers != null) { > builder = builder.headers(headers); > } > builder.accept(MediaType.APPLICATION_JSON); > > > - The latest Tomcat CORS filter needed this added to the config or else > all POSTS from browsers would result in a 403: > > <init-param> > <param-name>cors.allowed.origins</param-name> > <param-value>*</param-value> > </init-param> > > > Once we had worked through those changes we were all good. > > Thanks again and keep up the excellent work! > > Paul Carter-Brown > Director > Jini Guru > m: +27 (0) 83 442 7179 <+27834427179> > a: 1st Floor, Golf House, Design Quarter, Cnr. William Nicol and Leslie > Johannesburg, South Africa > w: jini.guru e: p...@jini.guru > > Disclaimer: This message and/or attachment(s) may contain > privileged, confidential and/or personal information. If you are not the > intended recipient you may not disclose or distribute any of > the information contained within this message. In such case you must > destroy this message and inform the sender of the error. Jini Guru may not > accept liability for any errors, omissions, information and viruses > contained in the transmission of this message. Any opinions, conclusions > and other information contained within this message not related to Jini > Guru official business is deemed to be that of the individual only and is > not endorsed by Jini Guru. > > > > On Tue, Feb 5, 2019 at 2:28 AM Roberto Cortez <radcor...@yahoo.com.invalid> > wrote: > >> No worries :) >> >>> On 4 Feb 2019, at 11:28, Paul Carter-Brown <paul.carter-br...@jini.guru> >> wrote: >>> >>> Yip false alarm. In 7.0.4 I had my own version of Johnzon libs that >> handled >>> binding of Java 8 dates/times. For 8.0.0 I changed my docker script to no >>> longer add these but forgot to remove the step where I deleted all >>> johnson libs from tomee/libs ;-( >>> >>> >>> Paul Carter-Brown >>> Director >>> Jini Guru >>> m: +27 (0) 83 442 7179 <+27834427179> >>> a: 1st Floor, Golf House, Design Quarter, Cnr. William Nicol and Leslie >>> Johannesburg, South Africa >>> w: jini.guru e: p...@jini.guru >>> >>> Disclaimer: This message and/or attachment(s) may contain >>> privileged, confidential and/or personal information. If you are not the >>> intended recipient you may not disclose or distribute any of >>> the information contained within this message. In such case you must >>> destroy this message and inform the sender of the error. Jini Guru may >> not >>> accept liability for any errors, omissions, information and viruses >>> contained in the transmission of this message. Any opinions, conclusions >>> and other information contained within this message not related to Jini >>> Guru official business is deemed to be that of the individual only and is >>> not endorsed by Jini Guru. >>> >>> >>> >>> On Mon, Feb 4, 2019 at 12:44 PM Roberto Cortez >> <radcor...@yahoo.com.invalid> >>> wrote: >>> >>>> Ok, so false alarm? :) >>>> >>>>> On 4 Feb 2019, at 07:55, Paul Carter-Brown <paul.carter-br...@jini.guru >>> >>>> wrote: >>>>> >>>>> Sorry, please ignore this. My bad. >>>>> >>>>> Paul Carter-Brown >>>>> Director >>>>> Jini Guru >>>>> m: +27 (0) 83 442 7179 <+27834427179> >>>>> a: 1st Floor, Golf House, Design Quarter, Cnr. William Nicol and Leslie >>>>> Johannesburg, South Africa >>>>> w: jini.guru e: p...@jini.guru >>>>> >>>>> Disclaimer: This message and/or attachment(s) may contain >>>>> privileged, confidential and/or personal information. If you are not >> the >>>>> intended recipient you may not disclose or distribute any of >>>>> the information contained within this message. In such case you must >>>>> destroy this message and inform the sender of the error. Jini Guru may >>>> not >>>>> accept liability for any errors, omissions, information and viruses >>>>> contained in the transmission of this message. Any opinions, >> conclusions >>>>> and other information contained within this message not related to Jini >>>>> Guru official business is deemed to be that of the individual only and >> is >>>>> not endorsed by Jini Guru. >>>>> >>>>> >>>>> >>>>> On Sun, Feb 3, 2019 at 6:42 PM Paul Carter-Brown >>>>> <paul.carter-br...@jini.guru> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I'm giving TomEE8.0.0-M2 a try with an EAR that works fine on 7.0.4 >>>>>> >>>>>> When the server boots the TomEE logs show this and the jax-rs >> services i >>>>>> have are not deployed. Running JDK 1.8u181 on Linux. >>>>>> >>>>>> Any ideas on where to start? >>>>>> >>>>>> 2019/02/03 16:09:28.652 INFO >>>>>> [main][org.apache.openejb.server.ServiceManager.initServer] # Creating >>>>>> ServerService(id=cxf-rs) >>>>>> 2019/02/03 16:09:28.850 SEVERE >>>>>> [main][org.apache.openejb.server.ServiceManager.initServer] # >>>>>> service.instantiation.err >>>>>> Exception Class: java.lang.NoClassDefFoundError >>>>>> ##### Exception Stacktrace Start ##### >>>>>> java.lang.NoClassDefFoundError: >>>>>> org/apache/johnzon/jaxrs/jsonb/jaxrs/JsonbJaxrsProvider >>>>>> at java.lang.ClassLoader.defineClass1(Native Method) >>>>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:763) >>>>>> at >>>>>> >> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) >>>>>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) >>>>>> at java.net.URLClassLoader.access$100(URLClassLoader.java:74) >>>>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:369) >>>>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:363) >>>>>> at java.security.AccessController.doPrivileged(Native Method) >>>>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:362) >>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >>>>>> at java.lang.Class.forName0(Native Method) >>>>>> at java.lang.Class.forName(Class.java:348) >>>>>> at >>>>>> >>>> >> org.apache.openejb.server.cxf.rs.CxfRSService.initCxfProviders(CxfRSService.java:240) >>>>>> at >>>>>> >>>> >> org.apache.openejb.server.cxf.rs.CxfRSService.init(CxfRSService.java:213) >>>>>> at >>>>>> >>>> >> org.apache.openejb.server.ServiceManager.initServer(ServiceManager.java:166) >>>>>> at >>>>>> >>>> >> org.apache.openejb.server.ServiceManager.initServers(ServiceManager.java:91) >>>>>> at >>>>>> >>>> >> org.apache.openejb.server.SimpleServiceManager.init(SimpleServiceManager.java:149) >>>>>> at >>>>>> >> org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:279) >>>>>> at >>>>>> >>>> >> org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169) >>>>>> at >>>>>> >>>> >> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) >>>>>> at >>>>>> >>>> >> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) >>>>>> at >>>>>> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137) >>>>>> at org.apache.catalina.startup.Catalina.load(Catalina.java:633) >>>>>> at org.apache.catalina.startup.Catalina.load(Catalina.java:656) >>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>>> at >>>>>> >>>> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >>>>>> at >>>>>> >>>> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>>>>> at java.lang.reflect.Method.invoke(Method.java:498) >>>>>> at >> org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306) >>>>>> at >> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491) >>>>>> Caused by: java.lang.ClassNotFoundException: >>>>>> org.apache.johnzon.jaxrs.jsonb.jaxrs.JsonbJaxrsProvider >>>>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:382) >>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >>>>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >>>>>> ... 31 more >>>>>> ##### Exception Stacktrace End ##### >>>>>> >>>>>> >>>>>> >>>>>> Paul Carter-Brown >>>>>> Director >>>>>> Jini Guru >>>>>> m: +27 (0) 83 442 7179 <+27834427179> >>>>>> a: 1st Floor, Golf House, Design Quarter, Cnr. William Nicol and >> Leslie >>>>>> Johannesburg, South Africa >>>>>> w: jini.guru e: p...@jini.guru >>>>>> >>>>>> Disclaimer: This message and/or attachment(s) may contain >>>>>> privileged, confidential and/or personal information. If you are not >> the >>>>>> intended recipient you may not disclose or distribute any of >>>>>> the information contained within this message. In such case you must >>>>>> destroy this message and inform the sender of the error. Jini Guru may >>>> not >>>>>> accept liability for any errors, omissions, information and viruses >>>>>> contained in the transmission of this message. Any opinions, >> conclusions >>>>>> and other information contained within this message not related to >> Jini >>>>>> Guru official business is deemed to be that of the individual only and >>>> is >>>>>> not endorsed by Jini Guru. >>>>>> >>>>>> >>>> >>>> >> >>