-
1. Re: JBoss 4.0.2 -> 5.1 problem with EJB3 lookup via jndi
wdfink Nov 4, 2010 12:56 PM (in response to skin123)You are migrating from EJB2 to EJB3, yes? (witn JB4.0.2 there is no EJB3 deployer)
With EJB3 there is no necessity to use such lookups if you are local.
Add
@EJB PostManager myPostmanager;
to your code and remove the lookup, the container will do the work for you ;-)
-
2. Re: JBoss 4.0.2 -> 5.1 problem with EJB3 lookup via jndi
skin123 Nov 4, 2010 1:14 PM (in response to wdfink)Thanks for your response,
in fact this is JBoss i need to migrate, not my EJB2s.
i have installed ejb3.deployer in JBoss 4.0.2, so i loaded these EJB3s with lookups.
Now i cant touch all lookups because there are too many so i search a miracle with JBoss configuration
-
3. Re: JBoss 4.0.2 -> 5.1 problem with EJB3 lookup via jndi
wdfink Nov 4, 2010 1:46 PM (in response to skin123)One is to annotate @LocalBinding(jndiBinding="..."), but that is not what you want (also painful because the annotation change from JB4 => JB5).
But it should possible to overwrite the names via deployment descriptor META-INF/ejb-jar.xml or jboss.xml.
You should only set the local jndi name all other should be taken from annotation due to JEE spec. (convention over configuration)
-
4. Re: JBoss 4.0.2 -> 5.1 problem with EJB3 lookup via jndi
skin123 Nov 5, 2010 5:54 AM (in response to wdfink)Thank you for your response,
IMHO, the best solution is the annotation @EJB to inject the bean, this is a big migration but there are only one migration
thx
-
5. Re: JBoss 4.0.2 -> 5.1 problem with EJB3 lookup via jndi
wdfink Nov 5, 2010 9:35 AM (in response to skin123)I agree,
in this case you are JEE compliant and must not migrate again (also if you migrate the application server, but why ;-) )