O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required