DEV Community

Muhammed DURRA
Muhammed DURRA

Posted on

1 2

Deployment of EJB server application and client independently

A friend asked me to work on an EJB and EJB client project in an independent separated deployment package for each.

I get used to use Netbeans to do that along time ago, but I decided to do it with maven. Looking for that I found that Apache provided plugins of EAR and EJB application for maven:
https://maven.apache.org/plugins/maven-ear-plugin/ for deploying artifacts as a Java EE Enterprise Archive (EAR)
https://maven.apache.org/plugins/maven-ejb-plugin/ which generates Java Enterprise JavaBean (EJB) file as well as the associated client jar.
That was almost perfect though the documentation was not clear enough. then I looked for someone how used it and fortunately I found an example on github, it was good to some extent, but wasn’t organized well and I had build issues with maven.

Making some efforts to re-organize the pom structure and fix some configurations I was able to build the EJB application as an isolated EAR file (because of dependencies on Hibernate it should be EAR not JAR).
the plugin also generates EJB jar and EJB client jar for you and with maven you can add it easily as a dependency for your client application.

The build of the EJB client application was straightforward with JSF, primefaces and the created EJB client jar built in the first step. then I used Glassfish server to deploy both artifacts.

This was just a simple try to build isolated Enterprise Java applications but things may go complex with other requirements.

You can check github for sources and build/deploy instructions
https://github.com/mhddurrah/ejb-application
https://github.com/mhddurrah/ejb-jsf-client
and don’t hesitate to contact me for updates or other issues/ queries.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs