[jboss-jira] [JBoss JIRA] Updated: (JBAS-8384) Passivation of a @Stateful session bean with an @Inject'ed @Stateless session bean fails with not-serializable error.
Ken Britton (JIRA)
jira-events at lists.jboss.org
Fri Sep 3 14:06:52 EDT 2010
[ https://jira.jboss.org/browse/JBAS-8384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ken Britton updated JBAS-8384:
------------------------------
Steps to Reproduce:
1. Create the following objects:
[Bean]
package com.maketechnologies.tlm.identity.beans;
import javax.ejb.PrePassivate;
import javax.ejb.Stateful;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.ejb3.annotation.CacheConfig;
import com.maketechnologies.tlm.identity.service.TestService;
@Named
@ConversationScoped
@Stateful
@CacheConfig(idleTimeoutSeconds=10)
public class TestBean {
@Inject
private TestService testService;
private String property = "test";
public String getProperty() { return this.property; }
public void setProperty(String property) { this.property = property; }
@PrePassivate
public void passivate() {
System.out.println("About to passivate: "+this.getClass().getName());
}
}
[Service]
package com.maketechnologies.tlm.identity.service;
import javax.ejb.Stateless;
@Stateless
public class TestService {}
[JSF page]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<h:outputText value="#{testBean.property}"/>
</h:body>
</html>
2. Attempt to view the JSF page in JBoss6 M4
3. 10 seconds later... stack trace:
10:59:04,840 ERROR [org.jboss.ejb3.cache.simple.SimpleStatefulCache.TestBean] problem passivation thread: javax.ejb.EJBException: Could not passivate; failed to save state
at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:409) [:1.5.0-alpha-4]
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:382) [:1.5.0-alpha-4]
at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:300) [:1.5.0-alpha-4]
Caused by: java.io.IOException: Metadata Serialization Error
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:193) [:6.0.0.20100721-M4]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206) [:6.0.0.20100721-M4]
at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182) [:6.0.0.20100721-M4]
at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90) [:6.0.0.20100721-M4]
...
was:
Create the following objects and attempt to view the JSF page in JBoss6 M4:
[Bean]
package com.maketechnologies.tlm.identity.beans;
import javax.ejb.PrePassivate;
import javax.ejb.Stateful;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.ejb3.annotation.CacheConfig;
import com.maketechnologies.tlm.identity.service.TestService;
@Named
@ConversationScoped
@Stateful
@CacheConfig(idleTimeoutSeconds=10)
public class TestBean {
@Inject
private TestService testService;
private String property = "test";
public String getProperty() { return this.property; }
public void setProperty(String property) { this.property = property; }
@PrePassivate
public void passivate() {
System.out.println("About to passivate: "+this.getClass().getName());
}
}
[Service]
package com.maketechnologies.tlm.identity.service;
import javax.ejb.Stateless;
@Stateless
public class TestService {}
[JSF page]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<h:outputText value="#{testBean.property}"/>
</h:body>
</html>
> Passivation of a @Stateful session bean with an @Inject'ed @Stateless session bean fails with not-serializable error.
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: JBAS-8384
> URL: https://jira.jboss.org/browse/JBAS-8384
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.0.M4
> Environment: Mac OS 10.6.4, Java6
> Reporter: Ken Britton
>
> If a @Stateful session bean has an injected @Stateless session bean it cannot be passivated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list