The dynamic download of stubs is not mandated by the J2EE specification--in
fact, you're flying directly in the face of the J2EE Spec, because dynamic
download of stubs is not handled under the IIOP protocol, which is the
preferred RMI protocol for EJB.
Most likely, this is WebLogic's custom behavior (they wrote their own RMI
layer, which is seen when you use t3: URLs as part of your lookups), so this
is a WebLogic-specific question. RMI/JRMP also provides for dynamic download
of stubs, in which case you'd need to go read up further on the subject in
the RMI docs; boiled down, you need to provide a "codebase" URL so
deserialization knows where to go get the stub code when deserializing the
stub from the remote server.
However, the problem may not be the downloading of the stubs--you're getting
a ClassCastException, not a ClassNotFoundError, which means you got
something, it just wasn't what you thought it was (or else it was defined by
a different ClassLoader than the one you're casting it to). This is my
suspicion--that the stub is being downloaded OK, but the cast is failing due
to ClassLoader relationship problems.
Ted Neward
{.NET || Java} Course Author & Instructor, DevelopMentor
(http://www.develop.com)
http://www.javageeks.com/tneward
http://www.clrgeeks.com/tneward
----- Original Message -----
From: "Ashwin_Bharath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 28, 2002 3:09 AM
Subject: Re: [EJB-INT] Uneven behaviour of Stubs for EJB in Weblogic
> Hi,
>
> EJB is deployed in Weblogic server in machine A.
> Client JSP is in Resin web server in Machine B.
>
> Now if I call the EJB without the stub, I get the exception
>
> "Class cast exception AccountBeanHomeImpl_WlStub"
>
> But it works fine if I copy the stub in Machine B.
>
> I think I have clearly stated my doubt.
>
> Regs
> Ashwin
>
>
>
> -----Original Message-----
> From: David M. Karr [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 9:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Uneven behaviour of Stubs for EJB in
> Weblogic
>
> >>>>> "Ashwin" == Ashwin Bharath <Ashwin_Bharath> writes:
>
> Ashwin> Hi ,
> Ashwin> My doubt is regarding automatic downloading of
> stubs for EJB's deployed in
> Ashwin> Weblogic.
> Ashwin> On detailing, my doubt goes as,
> Ashwin> 1) When ever a java client call an EJB
> deployed in Weblogic server, the
> Ashwin> stub for the particular EJB is dynamically
> loaded in to the client machine
> Ashwin> (correct me if I am wrong). Is it specific to
> Weblogic server or all other
> Ashwin> j2ee servers. Explanations on the advantages
of
> such dynamic stubs will be
> Ashwin> more helpful
> Ashwin> 2) Java clients can call an EJB in
Weblogic
> server even without storing
> Ashwin> the stubs in the client machine. But when we
try
> to invoke an EJB from JSP
> Ashwin> (both the EJB and the JSP are in Weblogic
> server), an exception is thrown
> Ashwin> asking for the stub. Why is this restriction
for
> JSP's.
>
> It's always useful to list the exact exception you're
> getting (cut/paste).
>
> is your EJB module and web module in the same EAR?
>
> --
>
> ===================================================================
> David M. Karr ; Java/J2EE/XML/Unix/C++
> [EMAIL PROTECTED]
>
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff EJB-INTEREST". For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the
message
> "help".
> **************************************************************************
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
> distribution or forwarding of any or all of the contents in this message
is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
> **************************************************************************
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".