Re: JNDI Name for EJB (JBoss migration)
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <OF18076116.FEF3F303-ON86257772.006E79DE-86257772.006EE1F3@aviall.com> |
Never mind... got it, thanks to a few lines of Java I found that list all
the JNDI names registered in a context.
For anyone else searching this list with the same problem and accustomed
to the JBoss way of doing it, Jonas seems to use the following name
convention:
com.myco.ejbs.FooImpl_com.myco.ebjs.FooLocal@Local
com.myco.ejbs.FooImpl_com.myco.ebjs.FooRemote@Remote
(where "com.myco.ejbs" is the package where you ejbs live--uses your
package, not generated by Jonas)
The code of listing this stuff out yourself is as follows:
public static void list() {
Context ctx = (Context)new InitialContext();
NamingEnumeration children = ctx.list("");
while(children.hasMore()) {
NameClassPair ncPair = (NameClassPair)children.next();
System.out.print(ncPair.getName() + " (type ");
System.out.println(ncPair.getClassName() + ")");
}
}
Cheers!
"If I had asked my customers what they wanted, they would have said 'A
faster horse'" -- Henry Ford
From:
[email protected]
To:
[email protected]
Date:
08/01/2010 12:32 PM
Subject:
[jonas] JNDI Name for EJB (JBoss migration)
Hello,
I'm trying to migrate my trivial EJB3 from JBoss to Jonas. So far I can
get my ear up and running but I am not able to access it via jndi.
For an EJB "Foo" having an implementation "FooImpl.java" JBoss will
automatically create and publish JNDI names for me for the local/remote
interfaces respectively:
Foo/FooImpl/local
Foo/FooImpl/remote
I would look up these names just as they are here in my initial context
and we're good. These are generated this way by default in JBoss
(although there is an annotation to override this and specify the desired
jndi name) with no action required on my part.
What is the Jonas equivalent? Does Jonas publish my EJBs using a
different default naming convention? Trying various permutations I
haven't been able to find what jndi name will access my ejb local and
remote APIs. Do I need to configure something explicitly?
Thanks!
Greg
"If I had asked my customers what they wanted, they would have said 'A
faster horse'" -- Henry Ford
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_
This e-mail message, including attachments, may contain confidential,
proprietary, or export controlled information.
Any unauthorized disclosure, distribution, or other use is prohibited,
unless expressly authorized.
If you receive this e-mail in error, please notify the sender, and delete
all copies of the original message from your systems.