am i doing something wrong.
Yes - Stateless session beans are not allowed to take parameters for ejbCreate - the bean instance created is NOT associated with a specific client.
According to the EJB 2.1 Spec (Sec 7.11.3, p110), we should be able to define ejbCreate methods in Session Beans that take parameters. Is it just that 3.0.8 is based on an older version of the EJB spec that didn't allow ejbCreate methods to take arguments?
Yes STATEFUL session beans can take parameters. The spec will tell you that stateless beans can not take parameters.
I have read the whole spec and I found nowhere that stateless cannot support ejbCreate with parameter ?
Perhaps i've missed something. Can somebody tell me where exactly on the specs it is specified ?
Its rather hard to miss:
ejb 2.1 spec, 7.11.3 ejbCreate<METHOD> Methods
The session bean class must define one or more ejbCreate<METHOD> methods whose signatures must follow these rules:
+ The method name must have ejbCreate as its prefix.
+ The method must be declared as public.
+ The method must not be declared as final or static.
+ The return type must be void.
+ The method arguments must be legal types for RMI/IIOP if there is a create<METHOD> corresponding to the ejbCreate<METHOD> method on the session bean?s remote home interface.
+ A stateless session bean must define a single ejbCreate method, with no arguments.
+ The throws clause may define arbitrary application exceptions, possibly including the javax.ejb.CreateException.
In the EJB 2.1 specification see section 7.8 'Stateless Session Bean' paragraph 4.