Marcus Junius Brutus
Marcus Junius Brutus

Reputation: 27296

Injecting EJB3 / CDI / JSF beans in console application for testing / experimentation purposes

Is there any way to inject EJB3 / CDI / JSF beans (if the last category makes any sense) and use the respective annotations without having to use a Java EE container? I.e. in a plain old static void main type console application?

Reason might be for experimentation / testing / behavior deciphering purposes.

Upvotes: 0

Views: 717

Answers (1)

Luiggi Mendoza
Luiggi Mendoza

Reputation: 85789

EJB3, CID and JSF runs over a Java EE container: GlassFish, JBoss, IBM WebSphere Application Server and so on. Note that Tomcat is not a Java EE container, it's a Servlet/JSP container.

A console project, in the other hand, run over Java SE container, this is, a simple JRE installation. If you try to download the Java Platform, Enterprise Edition 6 SDK, you will notice that it's a GlassFish distribution.

If you want/need to do proof of concepts using these technologies, you should create a simple Web project and deploy it on any Java EE containers. IMO I would recommend JBoss AS 7 for being lightweight on deployment (note: people can correct me if I'm wrong).

Upvotes: 2

Related Questions