It was actually one of mine. I put a jar file under lib/ that I forgot had
the offending class packaged into it.



On Tue, May 12, 2020 at 5:13 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jonathan,
>
> On 5/8/20 15:03, Jonathan Yom-Tov wrote:
> > Got it! Using http://jhades.github.io/ it was quick and easy to
> > find out that the offending class was indeed loaded from two
> > different jar files. After I removed one of them casting worked
> > with no issues. I didn't know jar hell could result in
> > ClassCastException, but you learn something new every day.
>
> So what were the two libraries that were conflicting? Logging
> libraries should be REALLY obvious since they have a very good chance
> of colliding. Did some other library "helpfully" package log4j inside
> its own JAR file?
>
> - -chris
>
> > On Fri, May 8, 2020 at 9:29 PM Olaf Kock <tom...@olafkock.de>
> > wrote:
> >
> >>
> >> On 08.05.20 19:50, Christopher Schultz wrote:
> >>> Olaf,
> >>>
> >>> On 5/8/20 13:19, Olaf Kock wrote:
> >>>
> >>>> You might want to hunt down duplicate classes in the JAR
> >>>> files on your classpath. Worst case: unpack them all in
> >>>> temporary directories and check for occurrences of the
> >>>> filename. Make sure that one doesn't overwrite the other when
> >>>> unzipping.
> >>>
> >>> Or unpack them all and let the unzipper tell you if there are
> >>> any filename collisions.
> >>>
> >>> Someone has probably written a "classpath scanner" that will
> >>> just unzip everything and look for conflicts.
> >>
> >>
> >> I've gotten follow up questions on how to use those tools in the
> >> past. Key is to identify all the jars, less the options of the
> >> tool, but since then I've just reverted to mention the low-tech
> >> version, and am not even ashamed ;)
> >>
> >> That's not to say that I don't trust Jonathan to use a classpath
> >> scanner - it's just a low-tech-preference out of habit.
> >>
> >> Plus, due to this habit, I currently can't come up with a tool's
> >> name to look for :D
> >>
> >> Olaf
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl66rREACgkQHPApP6U8
> pFhqOBAApsaappSGDrveTxgVU4X2x0VKtZxCzMX8yZ4rSPaFvRi0rMp1bLlaV/sw
> ZaRAQLZbAF5dBgahU4AqKmEkPNw2SlncuykX1JZs//lCDqzaFrJ4Dbsw4YJ7cq+3
> 3jwV6LTS7XzFXOoCHShvvbbwsK2qTWE870TQwOSN+yCN0mTbZz3ah2qnKXoLWZvn
> qUOfYmtTRJTN8vBsR0BpRq2QXZ+uL565A4WLeX9j5jTWiZ5zDNsjN4h9/GHcKChM
> lKIwR8VVfGI+le4JHiW9kz0gukbe/gcvFNPnf5UpvpVZf4VYOQyuTV0gNYAO1QZ8
> CoZ9qNuAjO6aE4BW6PGeFCnDZ55/i6lVe8ZM69Z6WFum8jYOCi2wbuPyUmZqzTbX
> aXAe7OWHXrDgdGUIUFaOvvpMjbEbG/6TBH+VMAbLN3i4uFEQwmjP+9JFn3PSeyok
> ca/5ev99ExfqEOqpQgRddxjo8TBczZdchsUazvR0pcoEWzbQUPvZKN/lRnaCTkxn
> Gvx7co1mw9sGVHkYhktJNLvZE6KP48xaRZISWhCVsVX0LgpUwOyD37N1+wUYgqJT
> Zao62Za5GVVZrbD6+9HYBD3WhKwJwxvxICQ42diEitSxgdvRSTbuUbrREVfkiYgu
> 7OmlWx6y7aXEDgDS7DSBOiMW3/N93uGzOPL0gECQnBmKHLDKfU4=
> =ANY3
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to