I had the oddest exception while trying to print to a zebra printer on mac os x with java. I've done this many times in the past and it always worked. Except now on this one machine. I was informed they recently updated their operating system, but I'm not sure that is the cause.
java.lang.ClassCastException: sun.print.UnixPrintService cannot be cast to sun.print.IPPPrintService
at sun.print.UnixPrintJob.<init>(UnixPrintJob.java:126)
at sun.print.UnixPrintService.createPrintJob(UnixPrintService.java:467)
I've found this bug that seems related, but it is on solaris. So I think I'm experiencing something different. JDK-8032227 ClassCastException in UnixPrintJob for ipp printer
Upgrading from Mojave to Catalina solved the problem.