What MUST be in an ejb-jar?

image with no caption

Note

You have to know what is NOT in the ejb-jar.

You’re expected to know what’s NOT in the ejb-jar file. Notice what’s missing? The thing you expect to find in a JAR? Here’s a hint...it’s the thing that usually goes in the META-INF directory.

Figure it out? The manifest! The manifest file is not required as of EJB 2.0. You CAN put one in, but it’s optional and usually not needed.

You also must know what MUST not be in the ejb-jar: classes generated by the container! Remember, the container implements the home and component interface, and makes stubs if the interfaces are remote. This doesn’t happen until deployment... so they aren’t part of what the Bean Provider or Application Assembler put into their deliverable—the ejb-jar file.

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.