1. java
  2. android
  3. c#
  4. .net
  5. javascript
  6. php
  7. jquery
  8. html
  9. sql

Exception Hibernate 'org.hibernate.type.SerializationException: could not deserialize'

Boa tarde, eu tenho uma aplicacao que ao executar um query.getResultList() ele me retorna este exceção. Alguem tem alguma idéia do que pode ser? Todas as minhas classes estão implementando Serializable. Obrigado

Fev 27, 2014 2:04:55 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
Advertência: javax.persistence.PersistenceException: org.hibernate.type.SerializationException: could not deserialize
javax.el.ELException: javax.persistence.PersistenceException: org.hibernate.type.SerializationException: could not deserialize
    at org.apache.el.parser.AstValue.invoke(AstValue.java:291)
    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
    at com.sun.faces.facelets.el.ContextualCompositeMethodExpression.invoke(ContextualCompositeMethodExpression.java:188)
    at com.sun.faces.facelets.tag.TagAttributeImpl$AttributeLookupMethodExpression.invoke(TagAttributeImpl.java:477)
    at com.sun.faces.facelets.tag.jsf.core.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxHandler.java:459)
    at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
    at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at br.com.ares.sistema.Filtro.doFilter(Filtro.java:44)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: javax.persistence.PersistenceException: org.hibernate.type.SerializationException: could not deserialize
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:277)
    at br.com.ares.beans.ris.PesquisaConsultaBean.pesquisar(PesquisaConsultaBean.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.el.parser.AstValue.invoke(AstValue.java:278)
    ... 35 more
Caused by: org.hibernate.type.SerializationException: could not deserialize
    at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
    at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:140)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:121)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44)
    at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:67)
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:247)
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:332)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2924)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
    at org.hibernate.loader.Loader.getRow(Loader.java:1509)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:719)
    at org.hibernate.loader.Loader.processResultSet(Loader.java:949)
    at org.hibernate.loader.Loader.doQuery(Loader.java:917)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:318)
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2143)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3939)
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:461)
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:430)
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:207)
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:263)
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151)
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1017)
    at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:944)
    at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:671)
    at org.hibernate.type.EntityType.resolve(EntityType.java:489)
    at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:168)
    at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:137)
    at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1112)
    at org.hibernate.loader.Loader.processResultSet(Loader.java:969)
    at org.hibernate.loader.Loader.doQuery(Loader.java:917)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
    at org.hibernate.loader.Loader.doList(Loader.java:2548)
    at org.hibernate.loader.Loader.doList(Loader.java:2534)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2364)
    at org.hibernate.loader.Loader.list(Loader.java:2359)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:268)
    ... 41 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 0000004B
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
    at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
    at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
    at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
    ... 89 more

Fev 27, 2014 2:04:55 PM com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
Grave: javax.persistence.PersistenceException: org.hibernate.type.SerializationException: could not deserialize
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:277)
    at br.com.ares.beans.ris.PesquisaConsultaBean.pesquisar(PesquisaConsultaBean.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.el.parser.AstValue.invoke(AstValue.java:278)
    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
    at com.sun.faces.facelets.el.ContextualCompositeMethodExpression.invoke(ContextualCompositeMethodExpression.java:188)
    at com.sun.faces.facelets.tag.TagAttributeImpl$AttributeLookupMethodExpression.invoke(TagAttributeImpl.java:477)
    at com.sun.faces.facelets.tag.jsf.core.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxHandler.java:459)
    at javax.faces.event.AjaxBehaviorEvent.processListener(AjaxBehaviorEvent.java:113)
    at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:106)
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:804)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at br.com.ares.sistema.Filtro.doFilter(Filtro.java:44)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.hibernate.type.SerializationException: could not deserialize
    at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
    at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:140)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:121)
    at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44)
    at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:67)
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:247)
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:332)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2924)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
    at org.hibernate.loader.Loader.getRow(Loader.java:1509)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:719)
    at org.hibernate.loader.Loader.processResultSet(Loader.java:949)
    at org.hibernate.loader.Loader.doQuery(Loader.java:917)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:318)
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2143)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3939)
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:461)
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:430)
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:207)
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:263)
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151)
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1017)
    at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:944)
    at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:671)
    at org.hibernate.type.EntityType.resolve(EntityType.java:489)
    at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:168)
    at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:137)
    at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1112)
    at org.hibernate.loader.Loader.processResultSet(Loader.java:969)
    at org.hibernate.loader.Loader.doQuery(Loader.java:917)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
    at org.hibernate.loader.Loader.doList(Loader.java:2548)
    at org.hibernate.loader.Loader.doList(Loader.java:2534)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2364)
    at org.hibernate.loader.Loader.list(Loader.java:2359)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:268)
    ... 41 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 0000004B
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
    at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
    at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
    at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
    ... 89 more

Esta é minha classe que esta dando erro

@ManagedBean
@ViewScoped
public class PesquisaConsultaBean extends PesquisaBean implements Serializable{

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = 1L;
    /**
     * selection.
     */
    private Collection<Object> selection;
    /**
     * selectionItems.
     */
    private List<Consulta> selectionItems;
    /**
     * pesquisaLista.
     */
    private List<Consulta> pesquisaLista;
    /**
     * consultaId.
     */
    private int consultaId;
    /**
     * itemPesquisa.
     */
    private String itemPesquisa;
    /**
     * entity.
     */
    private EntityManager entity;

    /**
     * getConsultas.
     * @return Object
     */
    public final Object getConsultas() {

        return pesquisaLista;
    }

    /**
     * limparConsulta.
     */
    public final void limparConsulta() {

        pesquisaLista = null;

    }

    /**
     * Constructor.
     */
    public PesquisaConsultaBean() {

    }

    /**
     * Realiza a pesquisa.
     * @return String
     */
    @SuppressWarnings("unchecked")
    public final String pesquisar() {
        limparConsulta();
        selectionItems = new ArrayList<Consulta>();
        selectionItems.clear();

        if (selection != null) {
            if (!selection.isEmpty()) {
                selection.clear();
            }
        }
        if (entity == null) {
            entity = lookupEntityManager();
        }

        Query q;
        if (itemPesquisa.matches(Regex.ALFA.toString())) {

            if (itemPesquisa.length() < 3) {
                pesquisaLista = null;
                selectionItems = null;
                MensagensUtil.aviso("Nome do Paciente "
                + "deve conter 3 dígitos ou mais.");
                return "";
            }

            q = entity.createQuery("SELECT c from Consulta c "
            + "where c.paciente.pessoaFisica.nome LIKE :nome");
            q.setParameter("nome", "%" + itemPesquisa + "%");

            if (q.getResultList().isEmpty()) {
                pesquisaLista = null;
                selectionItems = null;
                MensagensUtil.aviso("Paciente não existe "
                + "em nosso banco de dados.");
                return "";
            }

            pesquisaLista = q.getResultList();
        } else if (itemPesquisa.matches(Regex.NUMERICO.toString())) {
            if (itemPesquisa.length() > 10) {
                MensagensUtil.aviso("Pesquisa muito longa");
                return "";
            }
            q = entity.createQuery("SELECT c from Consulta "
                    + "c where c.consultaId = " + Integer.parseInt(itemPesquisa));

            if (q.getResultList().isEmpty()) {
                pesquisaLista = null;
                selectionItems = null;
                MensagensUtil.aviso("Número de consulta"
                + " não existe em nosso banco de dados.");
                return "";
            }
            pesquisaLista = q.getResultList();
        } else if (itemPesquisa.matches(Regex.ALFANUMERICO.toString())
            || itemPesquisa.matches(Regex.NOT_ALFANUM.toString())
            || itemPesquisa.matches(Regex.ESPACO.toString())
            || itemPesquisa.matches(Regex.CARAC_ESPECIAL.toString())) {
            mensagemErro();
        } else {
            pesquisaLista = null;
            selectionItems = null;
        }

        return "";
    }

    /**
     * selectionListener.
     * @param event
     */
    public final void selectionListener(final AjaxBehaviorEvent event) {
        UIExtendedDataTable dataTable =
                (UIExtendedDataTable) event.getComponent();
        Object originalKey = dataTable.getRowKey();
        selectionItems.clear();
        for (Object selectionKey : selection) {
            dataTable.setRowKey(selectionKey);
            if (dataTable.isRowAvailable()) {
                Consulta consulta =
                    (Consulta) dataTable.getRowData();
                selectionItems.add(consulta);
                consultaId = consulta.getConsultaId();
            }
        }
        dataTable.setRowKey(originalKey);
    }

    /**
     * mensagemErro.
     */
    public final void mensagemErro() {
        MensagensUtil.erro("Sua pesquisa está incorreta, "
        + "favor verifique o termo pesquisado e tente novamente.");
    }

    /**
     * getSelection.
     * @return Collection<Object>
     */
    public final Collection<Object> getSelection() {
        return selection;
    }

    /**
     * setSelection.
     * @param selection
     */
    public final void setSelection(final Collection<Object> selection) {
        this.selection = selection;
    }

    /**
     * getSelectionItems.
     * @return List<Consulta>
     */
    public final List<Consulta> getSelectionItems() {
        return selectionItems;
    }

    /**
     * setSelectionItems.
     * @param selectionItems
     */
    public final void setSelectionItems(
            final List<Consulta> selectionItems) {
        this.selectionItems = selectionItems;
    }

    /**
     * getConsultaId.
     * @return int
     */
    public final int getConsultaId() {
        return consultaId;
    }

    /**
     * setConsultaId.
     * @param consultaId
     */
    public final void setConsultaId(final int consultaId) {
        this.consultaId = consultaId;
    }

    /**
     * getItemPesquisa.
     * @return String
     */
    public final String getItemPesquisa() {
        return itemPesquisa;
    }

    /**
     * setItemPesquisa.
     * @param itemPesquisa
     */
    public final void setItemPesquisa(final String itemPesquisa) {
        this.itemPesquisa = itemPesquisa;
    }

    /**
     * @return the entity
     */
    public final EntityManager getEntity() {
        return entity;
    }

    /**
     * @param entity the entity to set
     */
    public final void setEntity(final EntityManager entity) {
        this.entity = entity;
    }

    /**
     * @return the pesquisaLista
     */
    public final List<Consulta> getPesquisaLista() {
        return pesquisaLista;
    }

    /**
     * @param pesquisaLista the pesquisaLista to set
     */
    public final void setPesquisaLista(final List<Consulta> pesquisaLista) {
        this.pesquisaLista = pesquisaLista;
    }
}
  • Dê uma olhada neste link: http://stackoverflow.com/questions/11878884/hibernate-throws-streamcorruptedexception-invalid-stream-header poderia postar as suas classes, ou seja seus "VOs"

    ramilani12   27 de fev de 2014
  • Entao, eu dei uma olhada, e nao consegui aplicar ao meu problema..

    Mateus Ferrer   27 de fev de 2014
  • resolveu como? eu estou com o mesmo problema. a questão é que estava funcionando com apenas 1 linha no banco de dados para teste. quando eu coloquei 25mil registros... ficou dando esse problema.

    thimor   13 de nov de 2015
  1. Você vai ver essas setas em qualquer página de pergunta. Com elas, você pode dizer se uma pergunta ou uma resposta foram relevantes ou não.
  2. Edite sua pergunta ou resposta caso queira alterar ou adicionar detalhes.
  3. Caso haja alguma dúvida sobre a pergunta, adicione um comentário. O espaço de respostas deve ser utilizado apenas para responder a pergunta.
  4. Se o autor da pergunta marcar uma resposta como solucionada, esta marca aparecerá.
  5. Clique aqui para mais detalhes sobre o funcionamento do GUJ!

1 resposta

Não é a resposta que estava procurando? Procure outras perguntas com as tags hibernate java ou faça a sua própria pergunta.