14.1. Debugging hints

Debugging EJBs presents particular challenges, as they operate in a distributed environment. The fact that they are called by the container and never directly by clients also introduces complications. This section describes some basic approaches to debugging EJBs.

14.1.1. Test clients

I recommend creating standalone test clients for all EJBs in the application, even where the EJBs will never be called from an end-user client. Even entity EJBs that are only ever called by session EJBs need their own test clients. The more versatile the test client, the more useful it will be. Ideally, a test client will be able to exercise all the methods on the EJB, passing different parameters.

Test clients for EJBs can be standalone ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.