Hi!
Kevin Lewis wrote:
> Okay, I've created my bindings in the same way as the Container does.
>
> However, it doesn't seem that the class loader that loads the
> application is the same one available when doing lookups (I printed
> their references).
Is any of them an AdaptiveClassloader? During the request it definitely
should be. They might have forgotten it during init.
Aren't you able to access the classloader for the app somehow? If so
then set it before doing the bindings.
> I then saved off the class loader and restored it with an interceptor
> (pretty scary stuff). Now I get a class cast exception; probably
> because the classes are being loaded by different class loaders.
>
> I think this goes to a deeper problem. I think using the JNP naming
> service remotely (which this is effectively doing if it is going over a
> socket), will always cause these class cast exceptions.
The JNP you are using is not remote. It is purely local (i.e. "java:" is
local). However, the stuff you bind in there could be remote, i.e. the
EJB home.
> I'm thinking I need to hook into the naming system in a different way.
You should be fine if you can make sure that the context classloader is
set properly before you make your bindings.
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com