[
https://issues.apache.org/jira/browse/TOMEE-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471426#comment-13471426
]
Donatas Ciuksys commented on TOMEE-445:
---------------------------------------
It works now with apache-tomee-1.5.1-20121008.041005-31-webprofile.zip
But there is other problem: after most DIE log messages, there are messages
about failed activation:
...
DIE: beans.DateBean@9da289
Spa 08, 2012 10:09:47 AM org.apache.openejb.core.stateful.SimplePassivater
activate
INFO: Activation failed: file not found
E:\Java\apache-tomee-webprofile-1.5.1-SNAPSHOT\temp\9949eaf8234cf0f7=20284847=13a3f351598=-7ffe
...
though no activation should be perfomed - bean is @RequestScoped, it must die
forever.
> @RequestScoped @Stateful EJB beans are not destroyed after request completes
> ----------------------------------------------------------------------------
>
> Key: TOMEE-445
> URL: https://issues.apache.org/jira/browse/TOMEE-445
> Project: TomEE
> Issue Type: Bug
> Affects Versions: 1.5.0
> Environment: Windows 7 x64; Oracle JDK 1.7.0_07;
> tomee-web-profile-1.5.0.zip
> Reporter: Donatas Ciuksys
>
> 1. Create simple JSF+CDI+EJB application consisting of one JSF page and one
> EJB component:
> index.xhtml:
> ...
> <h:body>
> Current real date is: #{dateBean.currentDate()}
> </h:body>
> </html>
> EJB: DateBean.java:
> @Named
> @RequestScoped
> @Stateful
> public class DateBean {
>
> @PostConstruct
> private void init() {
> System.out.println("INIT: " + this);
> }
>
> @PreDestroy
> private void die() {
> System.out.println("DIE: " + this);
> }
> public String currentDate() {
> System.out.println("Method was called...");
> return "" + new Date();
> }
> }
> 2. Run the application. EJB method works OK, the current date is getting
> printed. Refresh browser window several times, Tomee log file will print this:
> INIT: beans.DateBean@1ac52c5
> Method was called...
> INIT: beans.DateBean@792217
> Method was called...
> INIT: beans.DateBean@1438814
> Method was called...
> Method annotated with @PreDestroy never gets called.
> 3. Remove annotation @Stateful (thus EJB bean becomes simple CDI bean), try
> again.
> This time each INIT log message is followed by DIE message.
> Conclusion: @RequestScoped + @PreDestroy is working on CDI beans, but not on
> EJB beans.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira