Just to rule out the policy file as the problem, try using a policy like the
jrun.policy in the $JRUN_HOME/lib directory, i.e., one that grants all
permissions. If that works, then your problem is with the Java policy file.
If not, let us see the exception, please.
Scott Stirling
Allaire
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 5:51 PM
To: JRun-Talk
Subject: Re: Can't get initial context from a different machine
Does anyone have any suggestions on this one?
----- Forwarded by Adam R Esterline/msi on 11/14/00 04:53 PM -----
Adam,
Thanks for trying to help me with this. I must just be dense. I have
included my client code, my java
policy file and my deploy.properties file. Maybe you can see what I am
doing wrong.
Amit
PS Thanks again
#
#Tue Oct 17 18:09:39 CDT 2000
ejipt.storeName=default
ejipt.loginSessionHomeName=default.LoginSessionHome
ejipt.users=spender1\:pass;spender2\:pass;saver1\:pass;saver2\:pass;chief\:p
ass
ejipt.userHomeName=default.UserHome
#ejipt.classServer.host=localhost
ejipt.roleHomeName=default.RoleHome
ejipt.roles=spender\:spender1,spender2,chief;saver\:saver1,saver2,chief
ejipt.ejbJars=ConsumerMasterNoDBEJB.jar,ConsumerMasterEJB.jar,sample1a_ejb.j
ar
import CRUD.*;
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
import java.io.*;
public class DoesNotWork {
static
{
System.setSecurityManager(new RMISecurityManager());
}
private Context _context = null;
public DoesNotWork() {}
public ConsumerMaster getConsumerMaster() {
ConsumerMaster consumerMaster = null;
Properties properties = new Properties();
properties.setProperty( Context.INITIAL_CONTEXT_FACTORY,
"allaire.ejipt.ContextFactory");
properties.setProperty( Context.PROVIDER_URL,
"ejipt://172.16.16.221:2323");
properties.setProperty(Context.SECURITY_PRINCIPAL, "spender1" );
properties.setProperty(Context.SECURITY_CREDENTIALS, "pass" );
try
{
_context = new InitialContext(properties);
ConsumerMasterHome home = ( ConsumerMasterHome )_context.lookup(
"CRUD.ConsumerMasterHome" );
consumerMaster = ( ConsumerMaster ) home.create();
}
catch (AuthenticationException authentication)
{
System.out.println( authentication );
}
catch (Exception e)
{
System.out.println( e );
throw new RuntimeException("Failed to connect to server");
}
finally {
}
return consumerMaster;
}
public static void main(String[] args) {
DoesNotWork junk = new DoesNotWork();
ConsumerMaster consumerMaster = junk.getConsumerMaster();
}
}
grant {
permission java.security.AllPermission;
permission java.net.SocketPermission "172.16.16.221:2323", "connect";
};
----------------------------------------------------------------------------
--
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.