Run your bean through the deploytool verifier

You already know your bean classes compile, but just because it compiles doesn’t mean it follows bean law. The verifier takes your jar and runs it through a bunch of tests to see if it meets the minimum requirements for deployment. As you learn more about the EJB spec, you’ll see that the verifier is testing your bean’s code (and the deployment descriptor) to see if it complies with the spec. For example, a stateless session bean’s home interface must have a no-arg create() method declared, and nothing else. And the bean class must have methods that match those declared in the component interface. And if the component interface is remote, it must declare that each method throws RemoteException. Don’t worry about remembering these examples; it’s just to give you an idea of the kinds of things the verifier does.

Click on the Ejb1 icon (the little jar) to highlight it

Choose ToolsVerifier...

Cross your fingers

image with no caption

Get Head First EJB 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.