I guess I wasn't clear enough.
I didn't put them in all of those places at the same time. In subsequent
startups of jBoss I had them in only one of the places mentioned in my earlier
email.
Kevin's advice worked. The ejb (or at least the remote and home interfaces)
need to be in the system classpath (don't put them in WEB-INF/lib or
WEB-INB/classes). In other words add the jar or classes directory to your
classpath in the run.sh (or run.bat) file. I thought I had tried this before,
but it didn't work. Anyway, it *does* work now.
If you put your ejb in one of the WEB-INF places then Tomcat loads your remote
or home interface (via the AdaptiveClassLoader), but the proxy is loaded by
(I am assuming) jBoss (via the java.net.UrlClassLoader).
Anyway, thanks Kevin.
-vince
On Fri, 20 Oct 2000, you wrote:
> > I've looked at the archives and see that others were having a problem with
> > classloaders when using Tomcat.
> >
> > I get a ClassCastException: $Proxy0 (and a long fairly meaningless stack
> trace)
> > when I try to cast my home object (actually the proxy) to the interface
> after
> > getting it from a JNDI lookup.
> >
> > In one of the emails in the archive, Rickard suggests printing out the
> > classloader for both the proxy and the interface. When I do that I get
> the
> > following:
> >
> > cl(proxy) = java.net.URLClassLoader@4b6009
> > cl(remote) = AdaptiveClassLoader( )
> >
> > Clearly different classloaders. I've checked and AdaptiveClassLoader is
> > from Tomcat. So, Tomcat loads my remote interface and JBoss is loading
> the
> > proxy. How do I rectify this situation?
> >
> > I've put my classes everywhere I can think of (WEB-INF/classes, in a jar
> file
> > in WEB-INF/lib, and in a jar file added to the main classpath for the
> JVM --
> > that is, in the run.sh file) and always get the same result.
>
> That is precisely the problem: you have put the classes in too many places.
> The way to fix is to put it in WEB-INF/classes only. Sebastien, do you have
> the details on this one? If so, show Vincent the tricks (i.e. lean over your
> desk and tell him ;-)
>
> /Rickard
>
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
_______________________
Vincent Sheffer
Director of Operations
Telkel, Inc.
_______________________
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]