Add the three class files (including their package directory) to the JAR

This is the most important part of the whole process! In other words, don’t screw it up. The key is to get the correct classes into the JAR in their package directory structure, and only their package directory structure. In other words, if you put the three class files into the JAR without the headfirst directory, your bean won’t deploy. Or, if you include the classes directory as well as the headfirst directory, your beans won’t deploy. Remember, the ejb-jar is still a JAR file, so the usual JAR rules about package structures apply here.

Navigate to the Advice directory

Expand the classes directory to see the headfirst directory

Select the headfirst directory

Click Add

image with no caption

Use the navigation controls here to get to your Advice directory, where you can see your classes and src directories. Then select the headfirst directory. You don’t have to expand it... we did it so that you could see what’s in there.

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.