New SplitPackageProcessor Warning

1,271 views
Skip to first unread message

David Hoffer

unread,
Aug 27, 2021, 4:11:44 PM8/27/21
to Quarkus Development mailing list
We get the following error and are wondering why is this considered a bad practice and what harm does it cause in Quarkus?  Java if perfectly fine with this so wondering why bad in Quarkus?

[WARNING] [io.quarkus.arc.deployment.SplitPackageProcessor] Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives:

-Dave


Max Rydahl Andersen

unread,
Aug 30, 2021, 7:21:22 AM8/30/21
to David Hoffer, Quarkus Development mailing list

We get the following error and are wondering why is this considered a bad
practice and what harm does it cause in Quarkus? Java if perfectly fine
with this so wondering why bad in Quarkus?

Since Java 9, with java modules Java have not been fine with it.

There two packages in different modules causes error/failure.

There were some other cases where this was problematic which relates to reflection and invoke virtual

so no, java ain't fine with it - its always been problematic; just not been as visible :)

[WARNING] [io.quarkus.arc.deployment.SplitPackageProcessor] Detected a split
package usage which is considered a bad practice and should be avoided.
Following packages were detected in multiple archives:

-Dave

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/049b1dd9-d1f4-4f64-92a3-e1c71675df58n%40googlegroups.com.

/max
https://xam.dk/about

Guillaume Smet

unread,
Aug 30, 2021, 7:26:06 AM8/30/21
to Andersen, Max, David Hoffer, Quarkus Development mailing list
Also you can configure it. See https://quarkus.io/guides/cdi-reference#arc-configuration-reference and quarkus.arc.ignore-split-packages.

David Hoffer

unread,
Aug 30, 2021, 11:16:15 AM8/30/21
to Guillaume Smet, Andersen, Max, Quarkus Development mailing list
Hum, still not clear if this is an issue or not in our use case.  I did see the quarkus.arc.ignore-split-packages property but that made me concerned that might be masking a true issue that we need to address.  I read up on https://github.com/quarkusio/quarkus/pull/18617 but that doesn't talk much about why it's a problem, only how Quarkus is going to scan and log findings.

I did readup a bit on Java 9 modules but we are not using those.  Ours is a JDK8 code base that was ported to JDK11 because we understand that JDK8 is at end-of-life both from a JDK updates perspective and that vendors such as Quarkus are dropping JDK8 going forward.

So since we are not using Java 9 the modules feature (or any post JDK8 feature) my understanding is Java is fine with using jars that contain some of the same package names.  Let me know if my understanding is incorrect and if Quakus really does have issues with split packages when not using modules.

-Dave

Stuart Douglas

unread,
Aug 30, 2021, 4:44:34 PM8/30/21
to David Hoffer, Guillaume Smet, Andersen, Max, Quarkus Development mailing list
So they are fine if they are all part of the same ClassLoader, very much not fine if they are loaded from different ones. For the JVM to consider a package to be the same it needs both the same name and the same ClassLoader, so if you have a split package loaded by different ClassLoaders then they will not have access to package private members, and an IllegalAccessError will be thrown.

From a Quarkus point of view this means that it is a real problem if you have hot reloadable and non hot reloadable code that is splitting packages, as these will be loaded in different class loaders. If all the packages are part of the same multi module maven app then this should be ok, if they are all part of some dependencies then this will be fine, if it is a mix of the two then very much not fine.

Either way, you are better off just not doing this, it just causes problems.

Stuart



David Hoffer

unread,
Aug 31, 2021, 10:12:35 AM8/31/21
to Stuart Douglas, Guillaume Smet, Andersen, Max, Quarkus Development mailing list
Thanks, that really helps.  Yes in our case we just use one class loader and yes they are all just some dependencies so we can share what was duplicate code across products.  As time allows we will migrate to using separate packages in these but not a problem at this point.

Thanks for the clarifications.

-Dave

You received this message because you are subscribed to a topic in the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quarkus-dev/L1w88Nq-6XQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cygNzMVpziueQGs6hLNAGeK463brPajeZbaNKUfBXhFhw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages