Second approach sounds fine except then every PojoCache (and also TreeCache) calls from Tomcat will need to register with the marshalling classloader first? Well, PojoCache APIs are limited but not TreeCache though.
Most of the time you won't need this since:
1. You don't need to set the region marshaller
2. Only replication layer needs to be aware of the region class loader.
What we need is an AOP classloader advice that we can turn it on only when needed.
Any application that needs to replicate classes that aren't visible to the CL that loaded jboss-cache.jar will need to register a classloader anyway; otherwise replication won't work.
I believe the only API where this is an issue is getObject() -- AFAIK that's the only one that creates new instances of user classes.