You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Mark Struberg <st...@yahoo.de.INVALID> on 2021/03/07 17:41:40 UTC

More out-of-the-box Java16 friendliness?

Hi!

When testing OWB with Java16 I found that having do manually configure a DefiningClassService is probably not as user friendly as it should be.
Do we want to handle this more abstracted with e.g. a DefaultDefiningClassService?

We could move the Unsafe stuff all over to a separate UnsafeDefiningClassSerivce the DefaultDefiningClassService would then delegate to it or the ClassLoaderProxyService.

wdyt?
will prepare a ft branch for review.

LieGrue,
strub

Re: More out-of-the-box Java16 friendliness?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

If I get the proposal right it is about adding a facade which would be
skipped < java 9 and used if java > 9 (since it is not about java 16 but
java 9 where this impl becomes relevant).
I'm always using this:

org.apache.webbeans.spi.DefiningClassService =
org.apache.webbeans.service.ClassLoaderProxyService
# we are in flat classpath mode so capture the startup classloader,
avoids surprises at runtime when classloader is not app one at startup
org.apache.webbeans.spi.ApplicationBoundaryService =
org.apache.webbeans.corespi.se.SimpleApplicationBoundaryService

Guess we should be able to do better in both cases:
1. if the WBC classloader == system loader we can switch to this simple
impl instead of default one for ex
2. agree it would be nice to be able to use ClassLoaderProxyService by
default as soon as we are no more on java 8 but it breaks a few CDI things
like protected/package access so I think either we find a way to make it
work or it should stay a toggle as of today. Only thing we can enhance if
there is no unified solution is likely to switch to it when unsafe logic
fails and log a big warning it should have been overriden explicitly (and
writing in the error the property line to add and where).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 7 mars 2021 à 18:41, Mark Struberg <st...@yahoo.de.invalid> a
écrit :

> Hi!
>
> When testing OWB with Java16 I found that having do manually configure a
> DefiningClassService is probably not as user friendly as it should be.
> Do we want to handle this more abstracted with e.g. a
> DefaultDefiningClassService?
>
> We could move the Unsafe stuff all over to a separate
> UnsafeDefiningClassSerivce the DefaultDefiningClassService would then
> delegate to it or the ClassLoaderProxyService.
>
> wdyt?
> will prepare a ft branch for review.
>
> LieGrue,
> strub