I have two ears deployed in the default server of JBoss 6.1. One of the ears (call it service.ear) provides a service to retrieve data from an external source and to translate it to a different structure. The other ear (call it client.ear) utilizes this service. As a result, the client ear contains the class definition the service ear translates the data to. Additionally, the jars that contains the translated data structure class is deployed as an EJB in both the client and service ears.
Naturally, this is causing problems. I am getting the dreaded "expected class Data but got class Data" exception. I've tried many configurations of jboss-classloading.xml and jboss-classloading-domain.xml, but the only thing that I can get to work is the "sledgehammer" jboss-classloading configuration:
As you can imagine, I really don't want this configuration. Can someone provide to me sample files that I need to place in my various ear files that will prevent this error from occurring? I've tried giving each ear their own domain, setting import-all to false, and parent-first to false, but none of those appear to resolve the issue. I've also tried adding jboss-classloading-domain.xml, but I don't understand that well enough.
Thank you for the quick response, Ales. Later in the evening, that idea occurred to me, and it does work. Fortunately, I don't have to worry about different versions of software embedded into these ears, so this solution should be sufficient in this case. In the future, if I do have to worry about different versions of software, do you know how I would be able to completely isolate the ears from each other?
In the future, if I do have to worry about different versions of software, do you know how I would be able to completely isolate the ears from each other?
.ears are fully isolated by default in AS6.
To have both, some shared bits and some "isolated" (hidden from the other),
you would have to put more effort into CL domain creation / filtering.