JRun's documentation sucks and it's code examples use
deprecated methods. Does anybody know the correct means to get a JNDI
reference to an EJB home interface from a servlet? I've tried most
everything, but what I got before pulling the rest of my hair out and quitting
is a servlet containing, in part:
Context jndiContext = getInitialContext();
Object ref =
jndiContext.lookup( "java:comp/env/ejb/CustomerHome");
* * *
public
static Context getInitialContext() throws NamingException
{
Properties p = new Properties();
p.setProperty( Context.PROVIDER_URL,
"ejipt://192.168.0.1:8100");
p.setProperty(
Context.INITIAL_CONTEXT_FACTORY,
"allair.ejipt.ContextFactory");
return new InitialContext(
p);
}
The PROVIDER_URL is the port for my JRun
Server. The INITIAL_CONTEXT_FACTORY is what the
documentation says is correct, although there is an InitialContextFactory class in another package. And
the JNDI lookup is in the recommended form. I've also tried the put() method of Property. No
matter what, ref is always null.
A couple of interesting things:
(1) I
am not getting a NullPointerException (nor any other
error) when calling the servlet from a browser - just a page with some test HTML
output from a PrintWriter() statement prior to the
JNDI lookup;
(2) assert always throws a
NullPointerException:
assert ref ==
null;
assert ref != null;
assert
ref.equals( null);
I know this is happening because the Rams lost
the SB...Appreciate any insight(s) you guys may have.
Mark
- Re: JRun/JNDI Question Galbreath, Mark
- Re: JRun/JNDI Question ^BoyInterrupted^
- Re: JRun/JNDI Question Ronald Wildenberg
- Re: JRun/JNDI Question Venu Gopal
- Re: JRun/JNDI Question Tom�s( Marek
- Re: JRun/JNDI Question Harish K Kottarathil
- Re: JRun/JNDI Question Colin Capriati
- Re: JRun/JNDI Question Galbreath, Mark
- Re: JRun/JNDI Question Gayathri Palicherla
- folder display on web Venu Gopal
- Re: folder display on web Soubhratra Das
