[jboss-jira] [JBoss JIRA] (AS7-3229) OptionalDataException failure during deserialization of nested bean

Scott Marlow (JIRA) jira-events at lists.jboss.org
Wed Jan 11 23:27:21 EST 2012


    [ https://issues.jboss.org/browse/AS7-3229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655396#comment-12655396 ] 

Scott Marlow commented on AS7-3229:
-----------------------------------

Thinking more about it, since we are only putting stateful session beans in the SerializationGroup, its probably an instance StatefulBean, which looks like:

{code:title=StatefulBean.java}
@Clustered
@javax.ejb.Stateful(name = "StatefulBean")

public class StatefulBean implements Stateful {

    @PersistenceContext(unitName = "mypc", type = PersistenceContextType.EXTENDED)
        EntityManager em;

     @EJB
     SecondBean secondBean;


    /**
     * Create the employee but don't commit the change to the database, instead keep it in the
     * extended persistence context.
     *
     * @param name
     * @param address
     * @param id
     */
    @Override
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public void createEmployee(String name, String address, int id) {

        Employee emp = new Employee();
        emp.setId(id);
        emp.setAddress(address);
        emp.setName(name);

        em.persist(emp);
    }

    @Override
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public Employee getEmployee(int id) {
        return em.find(Employee.class, id, LockModeType.NONE);
    }

    @Override
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public Employee getSecondBeanEmployee(int id) {
        return secondBean.getEmployee(id);
    }

}
{code}

{code:title=SecondBean.java}
@Clustered
@javax.ejb.Stateful
public class SecondBean {
    @PersistenceContext(unitName = "mypc", type = PersistenceContextType.EXTENDED)
        EntityManager em;

    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public Employee getEmployee(int id) {
        return em.find(Employee.class, id, LockModeType.NONE);
    }
}
{code}

                
> OptionalDataException failure during deserialization of nested bean
> -------------------------------------------------------------------
>
>                 Key: AS7-3229
>                 URL: https://issues.jboss.org/browse/AS7-3229
>             Project: Application Server 7
>          Issue Type: Sub-task
>          Components: Clustering
>            Reporter: Scott Marlow
>            Assignee: Scott Marlow
>             Fix For: 7.1.0.Final
>
>
> Test case branch link is coming (I need to recreate it without the Hibernate 4.0.1-SNAPSHOT dependency).
> The bug didn't recreate with the simple test https://github.com/scottmarlow/jboss-as/commits/AS7-3229.  Might need to push the XPC serialization changes before it can be recreated.
> Exception call stack http://pastie.org/3155867

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list