this is my lookup code for the UserManagementBean.
Have also tried
Object homeObject = m_ctx.lookup("java:comp/env/ejbUserManagement");
but it returns class not found exception
my system.out.println("m_ctx.getEnvironment().size() =") prints out
zero or "0"
I hope this will help.
m_ctx = new InitialContext();
UserManagementHome home = null;
try
{
System.out.println("m_ctx.getEnvironment().size() = " +
m_ctx.getEnvironment().size() );
Object homeObject = m_ctx.lookup("ejbUserManagement");
home =
(UserManagementHome)PortableRemoteObject.narrow(homeObject,
UserManagementHome.class);
}
catch (Exception e)
{
System.out.println("Class: Model, Method: registerUser, Message:
" + e);
}
UserManagementRemote pUserManagement = null;
try
{
pUserManagement = home.create();
}
catch (Exception e)
{
System.out.println("Class: Model, Method : registerUser, Error
message" + e);
}
try
{
if (pUserManagement == null)
{
System.out.println("pUserManagement is null");
}
pUserManagement.registerUser(strUsername,strPassword);
}
catch (RemoteException ex)
{
System.out.println("Class: Model, Method : registerUser, Error
message: RemoteException " + ex);
}
with thanks.
-----Original Message-----
From: Wayland Chan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 03, July, 2001 15:45
To: [EMAIL PROTECTED]
Subject: Re: Problem with sturts and ejb
Johann,
Can you show us the code in your action class that
does the EJB lookup?
Should probably look something like...
Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY,
DBConnectionManager.getInstance().JNDI_INITIAL_FACTORY);
p.put(Context.PROVIDER_URL,
DBConnectionManager.getInstance().JNDI_PROVIDER_URL);
Context ctx = new InitialContext(p);
java.lang.Object o = ctx.lookup("UserManagerHome"); UserManagerHome
userHome = (UserManagerHome)javax.rmi.PortableRemoteObject.narrow(o,
UserManagerHome.class);
userManager = userHome.create();
Regards,
Wayland Chan
--- joi <[EMAIL PROTECTED]> wrote:
> Hi!
> I have a problem accessing the InitialContext in the
> action
> classes..when i perform lookup on my ejb's I get
> this error message...
>
> "Error instantiating web-app JNDI-context: No
> location specified and no
> suitable instance of the type
>
'com.maskina.mcstudio.model.persistance.UserManagementRemote'
> found for
> the ejb-ref ejbUserManagement"
>
> Does anyone have the answer..?
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/