Recently a user sent a question to the ejb@glassfish.dev.java.net mailing list about an error he was seeing when trying to deploy an EJB JAR containing only Java Persistence API entities. Doing this causes a deployment error, and the user was confused. The reason for the error is that JPA entities are not EJB components, even though they were introduced in the EJB 3.0 specification.
I simply wasn't aware that POJOs annotated with @Entity are not considered EJB components in contrast to POJOs annotated with @Stateless for example.
The user mentioned reading articles and tutorials (vanity alert: definitely not my tutorials) about JPA entities that refer to them as EJB 3.0 entity beans, which is incorrect, if understandable. The reason why Java Persistence was part of the EJB 3.0 spec has nothing to do with the technology, and everything to do with the JCP procedures that govern the release of Java EE. Basically, when the architecture of Java Persistence was decided on by the EJB expert group (i.e. that entities would not be EJB components) it was too late to introduce a separate JSR. So, the choice was to wait until Java EE 6, or piggyback on EJB 3.0. Put another way, the choice was to frustrate and anger developers or confuse them.
So, kids, remember that Java Persistence API entities are not EJB components, and there's no such thing as EJB 3.0 entity beans.

Maybe this is why when you create an entity bean in a netbeans enterprise application, you dont see that under the "enterprise beans" node, entity beans do not show up... I have always wondered about that..
Posted by Venky on November 19, 2007 at 05:28 AM PST #