We connect to multiple third party system via jax-rpc. The default wrapping of those webmethods when they want to throw a fault is java.rmi.RemoteException.
The thing to keep an eye on is that EJB transactions will roll back on System Exceptions which include RuntimeException and RemoteException. The subclasses of these exception can be turned into Application Exceptions, rather than System Exceptions, and consequently not causing transaction rollbacks by the @javax.ejb.ApplicationException annotation.
However, the annotation can contain the rollback=true definition which will cause a roll back to be introduced into the flow of control of that application exception is caused.
One thing I see a lot is that people don't understand that EJB is for a distributed system in the same way that CORBA and DCOM are. For many of the implementation's EJB is put too, it is far too complex a model and I think this is where people trip up and make horrible EARs with all sorts of craziness compiled in. The simplest EAR structure is:
PROJECT-EAR
PROJECT-EJB-Client
PROJECT-EJB
PROJECT-WS
PROJECT-Util
The PROJECT-EAR contains the APP-INF/lib directory which has all the jar files that are required on the classpath for the EAR to work on a JVM. This includes the project utility jar and the client jars from other projects.
The PROJECT-EJB-Client jar is the equivalent of the IDL from CORBA. This is where the remote interfaces and DTOs for the remote interfaces are located. These serve as the stubs across the distributed network and container system. If you think of the distributed system as an ocean of stubs (remote interfaces) floating across the surface that external systems can attach to and use the concrete beans that are implemented under the surface.
The PROJECT-EJB contains the concrete bean implementations for the remote interfaces and local interfaces for the project. It also contains the necessary JPA model objects and entity beans for persistence storage. Usually this is where all the business logic resides.
The PROJECT-WS layer is a dynamic web project where the webservices reside. This is a really light layer that does little other than accept the DTOs in the WSDL and then pass them directly into the injected beans. Too often I have seen that all the business logic and manipulation is done in the WS layer rather than being off loaded into the EJB layer where the beans can handle it. This is usually the newbie mistake I see most that suggests someone doesn't understand EJB.
Another issue I see commonly is that people will compile down a WSDL in the system rather than attach to a remote interface via JNDI. This is woefully inefficient and runs the risk of calls popping out of the system and hitting unexpected webservices in the wider system. With a remote interface they will attach directly across the container and keep the business logic concise and within the scope of the EJBs.
It is surprisingly common to see the entity beans copied en-masse or compiled into a jar from one EAR and then accessed via an entity manager to persist them in another EAR. Again this is best handled by remote interfaces across the container so that only one implementation of the entity beans exist for each table being mapped.
If another project requires access to the EJBs or entity beans in another EAR the structure would be:
OTHER-EAR
OTHER-EJB-Client
OTHER-EJB
OTHER-WS
PROJECT-Util
PROJECT-EJB-Client
In that structure two jars from the original PROJECT-EAR are compiled into the OTHER-EAR's APP-INF/lib. This is the PROJECT-EJB-Client jar which contains the DTOs and Remote interfaces from the PROJECT-EAR. The other is the util jar. By compiling in the PROJECT-EJB-Client jar the OTHER-EAR has access to the EJBs in the PROJECT-EAR and can access them as if they are in the OTHER-EAR.
Most Popular on South Sea Republic
The articles that have been viewed the most:
Most Popular Restaurants in Phoenix
Phoenix Eats Out is the restaurant review site for
Phoenix,
Scottsdale and
Old Town Scottsdale which lists the modernist and contemporary restaurants, taverns and bars in the greater Phoenix area.
This is the list of the most popular restaurants pages from phoenixeatsout.com that have been viewed the most;
My personal favourite restaurants in Phoenix are
AZ88,
Postinos,
Bomberos with
Grazie,
Humble Pie,
Orange Table,
The Vig,
Fez and others coming close behind. View the complete list with the photo-journalistic style images on
phoenixeatsout.com
Most Popular Hikes in Arizona
Arizona is an outdoor state and has lots of hiking in the city and around the state. Phoenix is unusual for most cities in having several large mountains in the center of the city with great hiking. Anyone who comes to Phoenix has to do the
Echo Canyon trail on Camelback and the
Summit Hike on Squaw Peak or Piesta Peak. The views of the city, suburbs and surrounding mountains are wonderful from Camelback and Piesta Peak.
For more experienced hikers there is the McDowell Mountains in North Scottsdale that has several difficult and strenuous hikes in
Tom's Thumb and
Bell Pass. Alternatively, you can hike the highest mountain in Arizona. At 12,600 feet
Humphrey's Peak is a long and difficult hike.
Alternate Australian Constitutions
Between 2004 and 2009 this site,
southsearepublic.org, was a constitutional blog based on scoop which focused on Australian and global constitutional issues.
One of the strongest aspects of it was the development of constitutions by those involved in the blog. These constitutions are the outcome:
The constitutions were built using principles from Montesquieu's separation of powers, the enlightnment's universal political rights and the ancient Athenian technology of sortition and choice by lot.
Archives For South Sea Republic
South Sea Republic started in 2004 as an Australian constitutional blog in 2004 based on scoop software. It was an immigrative outgrowth of Kuro5hin. The archives for each year since then;
The articles are ordered by views.
Who Is Cam Riley

I am an Australian living in the United States as a permanent resident.
I am a software developer by trade and mostly work in Java and jump between middleware and front end.
I originally worked in the New York area of the United States in telecommunications before moving to Washington DC and
working in a mix of telecommunications, energy and ITS. I started my own software company before heading out to
Arizona and working with Shutterfly. Since then I have joined a startup in the Phoenix area and am thoroughly enjoying myself.
I do a lot of photography which I post on this website, but also on flickr. I have a photo-journalistic website which lists
the modernist and contemporary restaurants in phoenix. I have a site on the
Australian Flying Corps [AFC] which has been around since the 1990s and which I unfortunately
lost the .org URL to during a life event; however, it is under the
www.australianflyingcorps.com URL now.
The AFC website has gone through several iterations since the 90s and the two most recent are
Australian Flying Corps Archives(2004-2002) and
Australian Flying Corps Archives(2002-1999) which are good places to start.
Websites Worth Reading
Websites of friends, colleagues and of interest;