CDI Beans Serialization issue on Cluster -
i'm facing big issue when tried run ejb+cdi+jsf application on wildfly 9.2 (also tried 10.0) on standalone clustered mode.
the issue happens when cluster container tries deserialize session scoped cdi beans, throws following exception :
2016-02-06 02:17:22,650 error [io.undertow.request] (default task-9) ut005071: undertow request failed httpserverexchange{ /login.xhtml request {accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], accept-language=[en-us,en;q=0.8], cache-control=[max-age=0], accept-encoding=[gzip, deflate, sdch], user-agent=[mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/48.0.2564.97 safari/537.36], connection=[keep-alive], cookie=[__utma=111872281.273659443.1454265274.1454265274.1454265274.1; __utmz=111872281.1454265274.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); jsessionid=oic7sg_tinxbz6bwghg5pq2urzcmw4kh5opqprqu.ahmed-pc], upgrade-insecure-requests=[1], host=[localhost:8180]} response {connection=[keep-alive], content-type=[text/html;charset=utf-8], content-length=[12371], date=[fri, 05 feb 2016 23:17:22 gmt]}}: org.jboss.weld.exceptions.illegalstateexception: weld-001122: failed deserialize annotated type identified annotatedtypeidentifier [contextid=ear-1.0.0.ear, bdaid=/c:/web server/wildfly-10.0.0.final/standalone/deployments/ear-1.0.0.ear/mysystemview-1.0.0.war/web-inf/lib/mysystemcontroller-1.0.0.jar, classname=com.sh.controller.mysystemcontroller, suffix=null, modified=false] @ org.jboss.weld.annotated.slim.slimannotatedtype$serializationproxy.readresolve(slimannotatedtype.java:60) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.jboss.marshalling.reflect.serializableclass.callreadresolve(serializableclass.java:413) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1286) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1606) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1606) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:224) @ org.jboss.marshalling.river.riverunmarshaller.readfields(riverunmarshaller.java:1745) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1658) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.blockunmarshaller.readobject(blockunmarshaller.java:149) @ org.jboss.marshalling.river.blockunmarshaller.readobject(blockunmarshaller.java:135) @ org.jboss.marshalling.marshallerobjectinputstream.readobjectoverride(marshallerobjectinputstream.java:53) @ org.jboss.marshalling.river.riverobjectinputstream.readobjectoverride(riverobjectinputstream.java:307) @ java.io.objectinputstream.readobject(objectinputstream.java:365) @ java.util.hashmap.readobject(hashmap.java:1396) @ sun.reflect.generatedmethodaccessor63.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.jboss.marshalling.reflect.serializableclass.callreadobject(serializableclass.java:307) @ org.jboss.marshalling.river.riverunmarshaller.doinitserializable(riverunmarshaller.java:1637) @ org.jboss.marshalling.river.riverunmarshaller.doreadnewobject(riverunmarshaller.java:1285) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:276) @ org.jboss.marshalling.river.riverunmarshaller.doreadobject(riverunmarshaller.java:209) @ org.jboss.marshalling.abstractobjectinput.readobject(abstractobjectinput.java:41) @ org.wildfly.clustering.marshalling.jboss.simplemarshalledvalue.get(simplemarshalledvalue.java:101) @ org.wildfly.clustering.marshalling.jboss.simplemarshalledvalue.get(simplemarshalledvalue.java:44) @ org.wildfly.clustering.marshalling.jboss.marshalledvaluemarshaller.read(marshalledvaluemarshaller.java:45) @ org.wildfly.clustering.marshalling.jboss.marshalledvaluemarshaller.read(marshalledvaluemarshaller.java:32) @ org.wildfly.clustering.web.infinispan.session.coarse.coarsesessionattributesfactory.findvalue(coarsesessionattributesfactory.java:84) @ org.wildfly.clustering.web.infinispan.session.coarse.coarsesessionattributesfactory.findvalue(coarsesessionattributesfactory.java:48) @ org.wildfly.clustering.web.infinispan.session.infinispansessionfactory.findvalue(infinispansessionfactory.java:63) @ org.wildfly.clustering.web.infinispan.session.infinispansessionfactory.findvalue(infinispansessionfactory.java:40) @ org.wildfly.clustering.web.infinispan.session.infinispansessionmanager.findsession(infinispansessionmanager.java:234) @ org.wildfly.clustering.web.undertow.session.distributablesessionmanager.getsession(distributablesessionmanager.java:140) @ io.undertow.servlet.spec.servletcontextimpl.getsession(servletcontextimpl.java:726) @ io.undertow.servlet.spec.servletcontextimpl.getsession(servletcontextimpl.java:756) @ io.undertow.servlet.spec.servletcontextimpl.updatesessionaccesstime(servletcontextimpl.java:760) @ io.undertow.servlet.spec.httpservletresponseimpl.responsedone(httpservletresponseimpl.java:557) @ io.undertow.servlet.handlers.servletinitialhandler.handlefirstrequest(servletinitialhandler.java:331) @ io.undertow.servlet.handlers.servletinitialhandler.dispatchrequest(servletinitialhandler.java:263) @ io.undertow.servlet.handlers.servletinitialhandler.access$000(servletinitialhandler.java:81) @ io.undertow.servlet.handlers.servletinitialhandler$1.handlerequest(servletinitialhandler.java:174) @ io.undertow.server.connectors.executeroothandler(connectors.java:202) @ io.undertow.server.httpserverexchange$1.run(httpserverexchange.java:793) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) caused by: exception occurred: in object of type org.jboss.weld.annotated.slim.slimannotatedtype$serializationproxy in field type in object of type org.jboss.weld.annotated.slim.backed.backedannotatedfield$serializationproxy in field field in object of type org.jboss.weld.injection.attributes.inferringfieldinjectionpointattributes in field attributes in object of type org.jboss.weld.injection.fieldinjectionpoint in field injectionpoint in object of type org.jboss.weld.event.eventimpl$serializationproxy in field events in object of type com.sh.controller.mysystemcontroller in field instance in object of type org.jboss.weld.context.serializablecontextualinstanceimpl in object of type java.util.hashmap
i have found question here on stackoverflow , mentioned shouldn't mark cdi injected beans transient skip serialization, problem ?? need transient injected beans ?
the class source code more 2500 lines of code, i'm coping here class operators:
@named("syscontrol") @sessionscoped public class mysystemcontroller extends venusabstractbean implements bundlefiles,serializable { private static final long serialversionuid = 9021710761540108681l; private ticket ticket; private logger log = loggerfactory.getlogger(this.getclass()); private ticketdata data; @inject private transient ticketingsubject subject; @inject private ticketlistcontroller ticketlistcont; @ejb private smshandler smshandler; @ejb private typefacade typefacade; @ejb private usersfacade usersfacade; @ejb private statusfacade statusfacade; @ejb private ticketfacade ticketfacade; @ejb private attachmentsfacade attachementfacade; @ejb private sourcechannelfacade sourcefacade; @ejb private ticketdatafacade datafacade; @ejb private lockfacade lockfacade; @ejb private usersassignedticketsfacade ticketassignfacade; @ejb private tickethistoryfacade historyfacade; @ejb private usersassignedticketsfacade assignedfacade; @ejb private emailhandler emailhandlerfacade; @ejb private globalconfigurationfacade globalconfigfacade; @ejb private escalationhistoryfacade escalationhistoryfacade; @ejb private emailmessagefacade emailmessagefacade; @ejb private ticketdatafacade ticketdatafacade; @ejb private calendarfacade calfacade; @ejb private emailhistoryfacade emailhistoryfacade; private boolean enablelastreplyedit = false; private maincategory cat; private subcategory sub; private topic topic; private tickethistory history; private byte[] attachment; private list<string> uploadedfile; private string reply; private string reassignnote; private lock mylock; private status status; private string mimetype; private boolean enablereopen; private ticketdata selecteddata; private long lockseconds; private boolean canbereopened; private list<integer> reopenstatuslist; private users selecteduser; private string changedeptcaller; private integer viewmode; private boolean printcontent; private boolean printreplies; private boolean printescalation; private list<attachments> attachmentslist; private list<attachments> uploadattachementslist;; private boolean displaytimeoutmessage; private list<ticketactions> actions; private ticketactions selectedaction; private ticketholdreason holdreason; private boolean skip; private int assign_changedept; private boolean cansetonhold; private boolean lockrequired; private list<ticket> selectedtickets; private boolean editlastrowmode; private list<ticketdata> ticketdatalist; @inject private event<ticketevent> events; @ejb private ticketeventobserver listener; @ejb private slatimecalculator slacalc; @ejb private slafacade slafacade; @ejb private ejbutils ejbutils; private date duedate; private long duedateremainingsec; }
ticketevent class
import java.util.eventobject; import com.sh.entity.ticket; public class ticketevent extends eventobject { private static final long serialversionuid = 1l; private ticket ticket; private object[] values; public ticketevent(object source, ticket ticket, object... values) { super(source); this.ticket = ticket; this.values = values; } public ticket getticket() { return ticket; } public void setticket(ticket ticket) { this.ticket = ticket; } public object[] getvalues() { return values; } public void setvalues(object[] values) { this.values = values; } }
basically, can following:
make beans implement
serializable
.add
transient
modifier class members not implementserializable
.
afaik, since java ee 6, can use @inject
instead of @ejb
when injecting cdi managed beans.
Comments
Post a Comment