Hi Robert,
re: UserTransaction, you'll have to wait for a wiser soul that I on that
one.
re: Listing objects bound to a context, I will reprint here the good bits
that I've read and tried successfully from the discussion starting on page
154 of
the O'Reilly Java Enterprise in a Nutshell (which I highly recommend).
Context c = new InitialContext();
NamingEnumeration enum = c.list("");
while (enum.hasMore()) {
NameClassPair ncPair = (NameClassPair) enum.next();
System.out.println("JNDI name: " + ncPair.getName() + " of type " +
ncPair.getClassName());
}
Cheers,
Dave Elliot
-----Original Message-----
From: Robert Hargreaves [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2000 09:28
To: Orion-Interest
Subject: RE: Transactions in client code
This never works on my setup. Maybe I'm doing wrong. If I try, as suggested
below I get this exception:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
Then if I try my usual initialContext instantiation (which works for ALL
other JNDI lookups)
Properties env = System.getProperties();
env.put("java.naming.factory.initial",
"com.evermind.server.rmi.RMIInitialContextFactory");
env.put("java.naming.provider.url", "ormi://localhost/damanPay");
env.put("java.naming.security.principal", "admin");
env.put("java.naming.security.credentials", "123");
initCtx = new InitialContext(env);
I get the following
javax.naming.NameNotFoundException: java:comp/UserTransaction not found
I've seen lots of postings on this mailing list about getting a
UserTransaction instance into the client, and of those few that have had
replies, none seem to work.
Anyone else experience this?
Regards
Robert Hargreaves
PS Also does anyone know of a class or utility that gives you a list of
names bound to a particular JNDI context?
> -----Original Message-----
> From: Robert Krger [mailto:[EMAIL PROTECTED]]
> Sent: 17 April 2000 07:55
> To: Orion-Interest
> Subject: Re: Transactions in client code
>
>
> just like in any J2EE implementation:
>
> Context initialContext = new InitialContext();
> userTransaction =
> (UserTransaction)initialContext.lookup("java:comp/UserTransaction");
>
>
> robert