More Info:
If I've traced this down correctly, the EJB Home Proxy is
generated in org/jboss/ejb/plugins/jrmp13/server/JRMPContainerInvoker
(getEJBHome) and I guess since the JNDI call doesn't come in over the
network or whatever, there's no serialization...?
Thanks,
Aaron
On Thu, 31 Aug 2000, Aaron Mulder wrote:
> Well, I went and verified that I have local optimizations turned
> off and I'm still getting the ClassCastException on the Proxy class in
> Tomcat. To recap: I followed the directions on the web page for
> integrating jBoss and Tomcat. When I look up a home, it fails:
>
> UserHome home = (UserHome)ctx.lookup("User");
>
> Results in:
>
> java.lang.ClassCastException: $Proxy9
>
> Now when I think about this, it makes sense that it's not affected
> by the local optimizations. All I'm doing is fetching something out of
> JNDI, and if I understand the optimizations correctly, they operate on the
> JRMP protocol that's used to pass bean calls along, and I haven't made any
> calls yet.
> So I guess this seems like some kind of problem with the JNDI
> implementation, or the "factory" or whatever that produces a client stub
> when you ask for a JNDI name. I'm not very familiar with that code - any
> thoughts would be appreciated. I believe it's a ClassLoader issue, since
> Sylvain said an interface with the correct name is actually in the Class
> object for the Proxy in question. I know the interface is in Tomcat's
> class loader, since Tomcat barfs unless you deploy your bean home and
> remote interfaces into its "classes" directory. And since jBoss creates
> a different ClassLoader for every JAR, the Proxy must be generated in the
> JAR ClassLoader, and then not serialized and deserialized when it gets
> passed into the Tomcat ClassLoader... right?
>
> Thanks,
> Aaron
>
>