-
1. Re: @Singleton beans using @EJB's in @PreDestroy
jjohnson_vii Oct 10, 2012 2:27 PM (in response to jjohnson_vii)I forgot to mention, I'm using AS 7.1.1
Also, I have looked at the EJB 3.1 spec and this seems like a violation. Specifically table 3 lists the "Operations allowed in PreDestroy" and includes the list:
SessionContext methods: getBusinessObject, getRollbackOnly, setRollbackOnly, getTimerService, lookup, getContextData
JNDI access to java:comp/env
Resource manager access
Enterprise bean access
EntityManagerFactory access
EntityManager access
TimerService and Timer methods
So... why are my EJBs unavailable at PreDestroy time?
-
2. Re: @Singleton beans using @EJB's in @PreDestroy
jjohnson_vii Oct 10, 2012 2:41 PM (in response to jjohnson_vii)And 1 more piece of info. I think my EJB is "available" but it is an EJB that uses a @Resource annotated DataSource, and when it tries to use that DataSource during shutdown is when the exception occurs. Relevant stack:
Caused by: java.lang.NullPointerException
at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:88)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getSubject(AbstractConnectionManager.java:689)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:463)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
-
3. Re: @Singleton beans using @EJB's in @PreDestroy
jjohnson_vii Oct 10, 2012 2:45 PM (in response to jjohnson_vii)https://issues.jboss.org/browse/AS7-4808 is my issue I guess, thanks for reading me type to myself fellow coders!!
-
4. Re: @Singleton beans using @EJB's in @PreDestroy
jbertram Oct 10, 2012 2:51 PM (in response to jjohnson_vii)FYI - You can try out the fix on the latest AS7 nightly.
-
5. Re: @Singleton beans using @EJB's in @PreDestroy
jaikiran Oct 10, 2012 9:35 PM (in response to jjohnson_vii)Sorry, I missed this thread. You are right https://issues.jboss.org/browse/AS7-4808 is what is probably causing this and as Justin says, the fix is available in the nightly builds.
-
6. Re: @Singleton beans using @EJB's in @PreDestroy
jaikiran Oct 10, 2012 9:37 PM (in response to jaikiran)jaikiran pai wrote:
Sorry, I missed this thread.
Oh, probably not! I see that this was created just a few hours ago while I was asleep!
-
7. Re: @Singleton beans using @EJB's in @PreDestroy
sfcoy Oct 11, 2012 1:16 AM (in response to jaikiran)jaikiran pai wrote:
...
Oh, probably not! I see that this was created just a few hours ago while I was asleep!
I don't believe that for a second. It's well known that jaikiran pai never sleeps!
-
8. Re: @Singleton beans using @EJB's in @PreDestroy
nickarls Oct 11, 2012 1:57 AM (in response to sfcoy)I don't believe that for a second. It's well known that jaikiran pai never sleeps!
I have a theory he's some sort of JBoss-Bot
-
9. Re: @Singleton beans using @EJB's in @PreDestroy
jaikiran Oct 11, 2012 2:26 AM (in response to nickarls)Ha ha!
Trust me, I'm not a bot, I can pass captcha tests
-
10. Re: @Singleton beans using @EJB's in @PreDestroy
nickarls Oct 11, 2012 2:48 AM (in response to jaikiran)Trust me, I'm not a bot, I can pass captcha tests
On the contrary, it proves you must be a bot. I sometimes have to ask for 10 re-captchas before getting anything remotely readable