Sams Teach Yourself J2EE™ in 21 Days
by Martin Bond, Dan Haywood, Debbie Law, Andy Longshaw, Peter Roxburgh
Gotchas
As you start to implement your own Session beans, there's bound to be a couple of aspects that will trip you up. The following quick checklist of such “gotchas” should keep you on the straight-and-narrow:
When you look up resources from JNDI, you should use a string of the form java:comp/env/XXX. However, in the deployment descriptor, only the XXX is needed; the java:comp/env prefix is implicit.
Perhaps obvious, but don't use ejb as a prefix for naming your business methods. Names of that format are reserved for the EJB architecture callback methods.
Don't implement the remote interface in your bean! If you do so, your bean could inadvertently return itself (Java keyword this) as a return type. If a client starts invoking methods on this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access