Re: Re: JNDI Name for EJB (JBoss migration)
"S. Ali Tokmen" <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Message-ID | <[email protected]> |
Hello Just as a side note, the @Stateful and @Stateless annotations have "mappedName" attribute that let you personalize the EJB's JNDI name. Cheers S. Ali Tokmen http://ali.tokmen.com/ GSM (fr): +33 66 43 00 555 [Orange] GSM (tr): +90 555 266 52 73 [Avea] My AIM, ICQ, MSN Messenger and Yahoo IM contact details are on http://contact.ali.tokmen.com On 01.08.2010 22:11, [email protected] wrote: > > 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. >