tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joe <>
Subject @PostContruct bug?
Date Wed, 03 Nov 2010 16:32:43 GMT

I have a stateless bean with a method which is annotated with 
@PostConstruct. This method throws an unchecked exception.

So when the client (swing app) invokes this EJB for the first time, the 
following exception is catched by the client:

javax.ejb.EJBException: Cannot obtain a free instance.; nested exception 
is: java.lang.RuntimeException: test exception

That looks ok for me.
But all future invocations(until restarting OpenEJB server) of this EJB 
throw the following exception


For me this looks like the EJB is in use, although it should never be in 
use cause the @PostContruct method throwed an (unchecked) exception
and no other EJB method is invoked.

For testing i wrote a stateless EJB with a @PostContruct method just 
throwing a RuntimeException and i configured the container by setting 
the MaxSize to 1.

<Container id="My Stateless Container" type="STATELESS">
   MaxSize = 1

I also tested MaxSize = 2. Then the first exeception is catched 2 times, 
all other times, the second exception is catched.

And i also tested no pooling (MaxSize = 0,  StrictPooling = false), then 
always the first exception is catched.

Looks like a bug for me, isn't it?

View raw message