I only added @Stateless to my @WebService classes because of deployment
errors in TomEE. They worked fine in Glassfish. Figured perhaps CDI wasn't
as mature in TomEE?

Didn't realise beans.xml had to go into each jar. Will add.

If I'm reading this right, POJOs @Injected into a SLSB will share the scope
of the SLSB. So if the EJB container pools the SLSBs (my web tier), it will
also pool the POJOs? I'm balancing the need for thread safety with new
instances everywhere, and memory churn with GC pauses.

James



On 5 March 2013 20:45, Romain Manni-Bucau <rmannibu...@gmail.com> wrote:

> Hi
>
> It works, ensure you have a beans.xml in each jar + about annotations check
> your need but @applicationscoped is tempting.
>
> Finally sharing your exception can help too
> Le 5 mars 2013 21:39, "James Green" <james.mk.gr...@gmail.com> a écrit :
>
> > I've spent the past year developing a Java EE 6 application with JAX-RS
> and
> > JAX-WS endpoints. Each of these are annotated @Stateless.
> >
> > The project exists currently as a single maven project of war packaging
> > type. I would like to split this up by tier - web, service, database -
> as I
> > suspect many other people do things this way to spread workload between
> > staff.
> >
> > My "service" layer is currently a set of POJOs. They are @Injected into
> the
> > web service layer. Similarly, the database layer is @Injected into the
> > service layer.
> >
> > Two questions emerge and I'd like some experienced voices on the matter.
> >
> > 1. Should I be able to push the service and database classes down into a
> > separate jar file, and have the existing war project depend on that?
> >
> > 2. Should the service and database (DAO) layers have any container
> > annotations?
> >
> > This is a bit of a loaded question since I tried to push down the service
> > and database tiers of one of my java packages but it blew up during
> > deployment with the likes of
> >
> >
> http://docs.oracle.com/javaee/6/api/javax/enterprise/inject/IllegalProductException.html
> >
> > Bear in mind that our database is MongoDB, so I have no need for EJBs for
> > transaction and I'm not using EJB for security either, hence beyond the
> web
> > tier everything is CDI.
> >
> > Thanks for your time in advance.
> >
> > James
> >
>

Reply via email to