jQuery in Action, 3rd edition
The moose likes EJB and other Java EE Technologies and the fly likes EAR module structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EAR module structure" Watch "EAR module structure" New topic

EAR module structure

Denis Zjukow
Ranch Hand

Joined: Mar 15, 2006
Posts: 39

I use EJB 3 with JSF 1.2 in my application and run it under GlassFish (Sun Java System Application Server Platform Edition 9.0_01 (build b14)).

I pack the code into an EAR file with the following structure:


app-ejb.jar /
my.ejb.classes /

app-war.war /
classes /
my.war.classes /

My questions are:

- is it correct to use Util.class, which resides in the EJB module, from MyServlet, which is part of WAR module?

- is EJB module a right place for Util.class (it is not an EJB component!) taking into account that it should be used in both modules EJB as well as WAR.

The problems is that I have an exception during deployment. But what is the most interesting it is the fact that I didn't have this problem until I started using JSF. I've just added faces-config.xml and registered FacesServlet in web.xml. That's it. After doing that I have this deployment problem.

I also want to notice that the code worked before I put 'JSF nature' in it. That makes me think this is not a configuration problem.

Can anyone comment this, please. Thank you.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

I usually place the Util.class in a common-util.jar and make it available to both the EJB module and the war module by mentioning it as a java module in the application.xml. More details can be found here

[My Blog] [JavaRanch Journal]
Denis Zjukow
Ranch Hand

Joined: Mar 15, 2006
Posts: 39
Thanks Jaikiran!

I've read your blog. That was exactly what I wanted to know! Thank you!
I agree. Here's the link: http://aspose.com/file-tools
subject: EAR module structure
It's not a secret anymore!