The fact that you see "output 1" but not "output 2" implies that your
problem is in the line where you set the initial context factory property.
Perhaps it doesn't like the fact that the Properties object is "final". When
you pass the properties object to the constructor for the InitialContext it
will try to make a duplicate reference for the object. The "final" keyword
may interfere with this, (just a guess).
Other problems you may run into:
1. You should set your JVM's security manager to be an RMISecurityManager so
that RMI calls are allowed.
System.setSecurityManager( new RMISecurityManager() );
2. The name that you use when you lookup the home interface is, by default,
the name of the implementation class, not the home interface class.
HelloWorldHome home = (HelloWorldHome)ctx.lookup("HelloWorldBean");
//I'm assuming that HelloWorldBean is the implementation class.
If you have changed the bean's home name to be what you are showing below,
then disregard this. You can always use the JMC to lookup a bean's JNDI home
name.
-----Original Message-----
From: Kathpalia, Jeetender [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 29, 2001 1:18 PM
To: JRun-Talk
Subject: EJB simpe HelloWorld problem
Hi
I want to call a helloworld bean wose jar file is deployed on a Unix box.
I am calling that bean through my Servlet which is running in a NT
environment.
The servlet program is as below....
---------------------------------------------------------------------
out.println( "Sample servlet" );
final Properties h = new Properties();
out.println( "output 1" );
h.setProperty(Context.INITIAL_CONTEXT_FACTORY,"allaire.ejipt.ContextFactory"
);
out.println( "output 2" );
h.setProperty(Context.PROVIDER_URL,"ejipt://163.231.102.97:2323");
out.println( "output 3" );
Context ctx = new InitialContext(h);
out.println( "output 4" );
HelloWorldHome home = (HelloWorldHome)
(ctx).lookup("HelloWorldHome");
out.println( "output 5" );
HelloWorld helloworld = home.create();
out.println( "output 6" );
out.println("the valkue is " + helloworld.hello(" "));
helloworld.remove();
out.println( "output 7" );
-----------------------------------------------------------------------
The output just shows me the lines "Sample Servlet" and "output1" on the
output screen.
It doesnt show any errors....any ideas what am I doing wrong...why is that
the Bean is not working?.
Thanks
Jeetu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists