[jboss-jira] [JBoss JIRA] (WFLY-3925) JAX-RS bean implemented as Stateless is destroyed after response

David Lloyd (JIRA) issues at jboss.org
Wed Oct 1 18:53:03 EDT 2014


     [ https://issues.jboss.org/browse/WFLY-3925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Lloyd updated WFLY-3925:
------------------------------
    Steps to Reproduce: 
1. Create this test bean:

{code}
@Path("/test2")
@Stateless
public class Test2 {
	@GET
	public String hello() {
		return "hello !";
	}

	@PostConstruct
	protected void postConstruct() {
		System.out.println("Test2().postConstruct() " + this);
	}

	@PreDestroy
	protected void preDestroy() {
		System.out.println("Test2().preDestroy() " + this);
	}

}
{code}

2. Hit the URL (ex: http://localhost:8080/TestRest3/rest/test2) and look at the server output, something like this will show:

{noformat}
16:21:46,430 INFO  [stdout] (default task-41) Test1().postConstruct() test.Test2 at 890a1e2
16:21:46,432 INFO  [stdout] (default task-41) Test1().preDestroy() test.Test2 at 890a1e2
{noformat}

AFAIK SLSB shouldn't be destroyed after service request.


  was:
1. Create this test bean:

@Path("/test2")
@Stateless
public class Test2 {
	@GET
	public String hello() {
		return "hello !";
	}

	@PostConstruct
	protected void postConstruct() {
		System.out.println("Test2().postConstruct() " + this);
	}

	@PreDestroy
	protected void preDestroy() {
		System.out.println("Test2().preDestroy() " + this);
	}

}

2. Hit the URL (ex: http://localhost:8080/TestRest3/rest/test2) and look at the server output, something like this will show:

16:21:46,430 INFO  [stdout] (default task-41) Test1().postConstruct() test.Test2 at 890a1e2
16:21:46,432 INFO  [stdout] (default task-41) Test1().preDestroy() test.Test2 at 890a1e2

AFAIK SLSB shouldn't be destroyed after service request.




> JAX-RS bean implemented as Stateless is destroyed after response
> ----------------------------------------------------------------
>
>                 Key: WFLY-3925
>                 URL: https://issues.jboss.org/browse/WFLY-3925
>             Project: WildFly
>          Issue Type: Bug
>    Affects Versions: 8.1.0.Final
>            Reporter: Sergio Samayoa
>            Assignee: Jason Greene
>
> A JAX-RS bean implemented as stateless EJB is destroyed after response is sent.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list