This content has been marked as final.
Show 3 replies
-
1. Re: JNDI Problem ?
gavin.king Jun 18, 2007 1:56 PM (in response to christophea)No, its an EJB name, not a class name. Check the EJB spec.
All you need to do is specify an EJB name explicitly using @Stateful(name=...). -
2. Re: JNDI Problem ?
christophea Jun 18, 2007 3:14 PM (in response to christophea)Thanks for the reply...
I quickly had a look at the spec, where I found :The name annotation element defaults to the unqualified name of the bean class. The name?whether explicitly specified or defaulted?must be unique within the ejb-jar.
Plus, I actually had an error (i haven't noticed it) thrown by the EJB container at the beginning of the deployement, stating :jboss.j2ee:ear=Global_EAR_Project.ear,jar=EJB3_Action_Test.jar,name=SearchAction,service=EJB3 + is already registered
So it's very consistent with what you said.
Adding @Stateful(name="test/example1/search") and @Stateful(name="test/example2/search") where required, solved the problem.
Thanks for having made things clearer to me.
Now, just one more question I'd like to have your opinion on...
For large application developpement with Seam, you finally end up with beans that look like :package com.my.package; @Stateful(name="com/my/package") @Name("com.my.package.MyBean") public class MyBeanAction implements MyBean ...
Don't you think there is too much redundancy ?
(Seam turned me into a loafer) -
3. Re: JNDI Problem ?
gavin.king Jun 18, 2007 3:20 PM (in response to christophea)Yes, its definitely too redundant. Web Beans will default component names, and we may well decide to default to a qualified name (though thats by no means certain). Unfortunately we're stuck with the EJB name default.
But notice that EJB names are only unique in the ejb-jar. So for a truly large app you would usually package things into multiple ejb-jars.
Seam/Web Beans names are different, they need to be unique in the whole ear, and so I think there's an even stronger argument for defaulting to a qualified name.