Hi Mohit,
I have used EJBs which look up RMI objects in the RMI registry. There could
be more than one reason why you are getting this problem however you are in
a best position to judge them.
One of the reasons of the problem may be that you are not unsetting your
classpath in the shell or window in which you are running your RMI registry.
If this is the case then RMI registry will not remember the codebase and
hence will not be able to locate the stubs.
So it may be helpful to try and run rmiregistry in a window where you have
not set the classpath that you are using to compile your application.
Regards,
Ajay
> -----Original Message-----
> From: EXT Mohit Jain [mailto:[EMAIL PROTECTED]]
> Sent: 11. August 2000 1:41
> To: [EMAIL PROTECTED]
> Subject: Re: URGENT: Lookup for a RMI object from SessionBean in
> WebLogic
>
>
> Codebase is set to this:
>
> C:\Downloads\build\newRMI>java
> -Djava.rmi.server.codebase=file:///c:/downloads/build/newRMI/
> -Djava.security.policy=policy.all com.dl.ejbs.BWrmiImpl
>
>
>
>
>
> "Bono, Chris" <[EMAIL PROTECTED]>@www.javasoft.com> on
> 08/10/2000 05:21:15
> PM
>
> Please respond to A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
> Sent by: A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: Re: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean in
> WebLogic
>
>
> Mohit,
> What is the codebase exactly set to?
>
> -----Original Message-----
> From: Mohit Jain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 10, 2000 4:50 PM
> To: [EMAIL PROTECTED]
> Subject: Re: URGENT: Lookup for a RMI object from SessionBean in
> WebLogic
>
>
> Hi Chris,
>
> The codebase is properly set.
>
> Is there any way I could find out if the Stub is actually
> downloaded from
> the server or not...
>
> Does -Dsun.rmi.loader.logLevel=verbose does that.
>
> I started the rmiregistry from a new DOS prompt window after
> unsetting the
> CLASSPATH
> >>set CLASSPATH=
>
> I am using WinNT platform for the development.
>
> Still I have a doubt if the rmiregistry is getting the stub in some
> CLASSPATH.
> Any ideas??
>
> Mohit
>
>
>
>
> "Bono, Chris" <[EMAIL PROTECTED]>@www.javasoft.com> on
> 08/10/2000 04:35:00
> PM
>
> Please respond to A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
> Sent by: A mailing list for Enterprise JavaBeans development
> <[EMAIL PROTECTED]>
>
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: Re: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean in
> WebLogic
>
>
> Mohit,
> It sounds like you are not getting the stub for the service you are
> requesting downloaded dynamically.
> Make sure the codebase is set on the remote objects you are
> requesting.
>
> Chris
>
> -----Original Message-----
> From: Mohit Jain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 10, 2000 4:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: URGENT: Lookup for a RMI object from SessionBean in
> WebLogic
>
>
> Hi Nitya,
>
> Thanks for pointing out the stupid mistakes..
>
> Well, the problem is not solved as yet..
>
> I am still getting the following exception on invocation of
> the Session
> Bean method (sayHello( ))
> Error: java.rmi.UnmarshalException: error unmarshalling return; nested
> exception is:
> java.lang.ClassNotFoundException: com.dl.ejbs.BWrmiImpl_Stub
>
> I am attaching the Bean class below:
> ====================================================================
> package com.dl.ejbs;
>
> import java.rmi.RemoteException;
> import javax.ejb.SessionBean;
> import java.rmi.*;
> import javax.ejb.*;
> import javax.naming.*;
> import java.util.*;
>
>
> /**
> *
> --------------------------------------------------------------
> ----------
> * @stereotype SessionBean
> * @homeInterface com.dl.ejbs.TestHome
> * @remoteInterface com.dl.ejbs.Test
> * @statemode Stateless
> */
> public class TestBean implements SessionBean
> {
>
> private Context ctx;
>
> public String sayHello () throws RemoteException
> {
> try
> {
> ctx = getInitialContext();
> }
> catch (NamingException e)
> {
> System.out.println("Failed to get InitialContext :" +
> e.getMessage());
> }
>
>
> try
> {
> if (System.getSecurityManager() == null)
> {
> System.setSecurityManager(new RMISecurityManager() );
> }
>
> System.out.println("Going to do lookup");
> BWrmi BWrmi1 = (BWrmi) Naming.lookup
> ("//localhost/BWrmiServer");
> System.out.println("Done Lookup" );
>
> return BWrmi1.sayHello();
> }
> catch(Exception e)
> {
> System.out.println("Error: " + e);
> }
>
> return null;
>
> }
>
> public void ejbCreate() { }
> public void setSessionContext(SessionContext context) { }
> public void ejbRemove() { }
> public void ejbActivate() { }
> public void ejbPassivate() { }
> public void ejbLoad() { }
> public void ejbStore() { }
>
> static public Context getInitialContext() throws NamingException
> {
> return new InitialContext(System.getProperties());
> }
>
> }
> =================================================================
>
>
>
>
> Nitya Narasimhan <[EMAIL PROTECTED]> on 08/10/2000 03:26:00 PM
>
> Please respond to Nitya Narasimhan <[EMAIL PROTECTED]>
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: Re: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean in
> WebLogic
>
>
> Hi,
>
> You are using file URLS?? So I assume that means that the
> client, server
> and registry are on the same machine??
>
> Hmm .. there are some small errors in your codebase setting.
> a) the property is java.rmi.server.codebase not java.rmi.codebase
> b) the codebase value must always terminate in a /
>
> Try using
> -Djava.rmi.server.codebase="file:///c:/downloads/build/newRMI/"
>
> and see if that works.
>
>
> Strange thing is that I wonder how the registry managed to allow
> the bind .. it should have thrown the same exception if you had
> set the codebase this way -- UNLESS you started the registry from
> the same directory as the codebase, or had the
> c:/downloads/build/newRMI/
> directory specified on the registry classpath ..
>
>
> -Nitya
>
>
>
>
> >X-MIMETrack: Serialize by Router on Notes-Hub01/CCC(Release
> 5.0.3 |March
> 21, 2000) at 08/10/2000
> 03:19:57 PM
> >MIME-Version: 1.0
> >Content-Transfer-Encoding: 8bit
> >X-MIME-Autoconverted: from quoted-printable to 8bit by
> mail.java.sun.com
> id e7AKLRL24592
> >Date: Thu, 10 Aug 2000 15:19:06 -0500
> >From: Mohit Jain <[EMAIL PROTECTED]>
> >Subject: Re: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean in
> WebLogic
> >Comments: To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >
> >Hi,
> >
> >>>From the looks of it, your session bean on the weblogic
> server cannot
> >>>locate the stub class for the BWrmi service that is
> registered in the
> >>>registry on its local classpath
> >
> >Couldn't understand what you meant by "registered in the
> registry on its
> >local classpath" ?
> >
> >I did provide the codebase for the objects registered on the
> rmiregistry.
> >
> >==snapshot of the screen where I start the rmi server ===
> >>>C:\Downloads\build\newRMI>java
> -Djava.rmi.codebase=file:///c:/downloads/build/newRMI
> >>> -Djava.security.policy=policy.all BWrmiImpl
> >>>
> >>>WebGain Java! JustInTime Compiler Version 4.00.002(x) for JDK 1.2
> >>>Copyright (C) 2000 WebGain, Inc.
> >>>BWrmiServer bound to the registry
> >======
> >
> >Still I get the ClassNotFound exception in the SessionBean when I do
> >Naming.lookup("rmi://localhost/DWrmiServer");
> >
> >Mohit
> >
> >
> >
> >
> >Nitya Narasimhan <[EMAIL PROTECTED]> on 08/10/2000 03:04:39 PM
> >
> >Please respond to Nitya Narasimhan <[EMAIL PROTECTED]>
> >
> >To: [EMAIL PROTECTED]
> >cc:
> >Subject: Re: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean
> in
> > WebLogic
> >
> >
> >
> >Hi,
> >
> >From the looks of it, your session bean on the weblogic
> server cannot
> >locate the stub class for the BWrmi service that is registered in the
> >registry on its local classpath. The best solution would be
> to make sure
> >that the service (that bound itself to the registry) specifies its
> >codebase (using -Djava.rmi.server.codebase) at runtime ..
> this will allow
> >any client of that service to dynamically download any
> classes it needs
> >(including this stub class) at runtime.
> >There is lots more about this on
> >http://java.sun.com/products/jdk/1.2/docs/guide/rmi/codebase.html
> >
> >A quick-and-dirty solution is to make sure that the client
> somehow finds
> >the stub class on its local classpath i.e physically copy
> the stub over
> >into some location on the classpath searched by your
> component. This is a
> >short-term fix and is not a good idea when deploying the
> system finally.
> >
> >-Nitya
> >
> >
> >
> >
> >
> >>X-MIMETrack: Serialize by Router on Notes-Hub01/CCC(Release
> 5.0.3 |March
> >21, 2000) at 08/10/2000
> >02:41:42 PM
> >>MIME-Version: 1.0
> >>Date: Thu, 10 Aug 2000 14:40:49 -0500
> >>From: Mohit Jain <[EMAIL PROTECTED]>
> >>Subject: [EJB-INT] URGENT: Lookup for a RMI object from
> SessionBean in
> >WebLogic
> >>Comments: To: [EMAIL PROTECTED]
> >>To: [EMAIL PROTECTED]
> >>
> >>Hi Gurus,
> >>
> >>I have a existing RMI registry with a couple of objects
> belonging to a
> >>third party registered on it. This rmiregistry is running
> separately not
> >>in the application server (WebLogic 5.1) .
> >>
> >>I require to request services from the objects registered on the
> >>rmiregistry.
> >>
> >>Using a Stateless SessionBean deployed on WebLogic 5.1, can
> I do a lookup
> >>for the RMI objects on the rmiregistry.
> >>
> >>I get the following error:
> >>Error: java.rmi.UnmarshalException: error unmarshalling
> return; nested
> >exception is:
> >> java.lang.ClassNotFoundException: BWrmiImpl_Stub
> >>
> >>Am I doing something wrong??
> >>
> >>Has someone been able to bind the objects registered on a
> rmiregistry to
> >the JNDI tree in Weblogic???
> >>
> >>Thanks in advance
> >>Mohit
> >>
> >>
> >
> ==============================================================
> =============
> >>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".
> >>
> >
> >_____________________________________________________________________
> >���������������������������������������������������������������������
> >���������������������������������������������������������������������
> > ^ /) _/_ Nitya Narasimhan, Graduate Student Researcher
> > / \ / . / _ _ Computer Networks & Distributed Systems Lab
> >(/ v _/_/_ /_/(_/_ University of California, Santa Barbara.
> > ___/
> > ( Email: [EMAIL PROTECTED]
> > URL : http://alpha.ece.ucsb.edu/~nitya
> >_____________________________________________________________________
> >���������������������������������������������������������������������
> >���������������������������������������������������������������������
> >
> >
> ==============================================================
> =============
> >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".
> >
>
> _____________________________________________________________________
> ���������������������������������������������������������������������
> ���������������������������������������������������������������������
> ^ /) _/_ Nitya Narasimhan, Graduate Student Researcher
> / \ / . / _ _ Computer Networks & Distributed Systems Lab
> (/ v _/_/_ /_/(_/_ University of California, Santa Barbara.
> ___/
> ( Email: [EMAIL PROTECTED]
> URL : http://alpha.ece.ucsb.edu/~nitya
> _____________________________________________________________________
> ���������������������������������������������������������������������
> ���������������������������������������������������������������������
>
> ==============================================================
> =============
> 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".
>
> ==============================================================
> =============
> 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".
>
> ==============================================================
> =============
> 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".