openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Goodson <matt...@spidertracks.co.nz>
Subject Re: Serialization error
Date Tue, 30 Aug 2011 22:57:23 GMT
Found the solution.
Added <property name="openjpa.DetachState"
 value="loaded(DetachedStateField=transient)"/>  to my persistence.xml

On Tue, Aug 30, 2011 at 5:06 PM, Matthew Goodson <matthew@spidertracks.co.nz
> wrote:

> Hi guys, I'm getting the error below when I try to serialize a page that
> contains my 'Plan' object.
> My 'plan' object extends my 'UuidEntity' object which is shown below.
> UUID is a time based id and the source is fromhttp://
> stephenc.github.com/eaio-uuid
> Both 'Plan' and 'UUID' implement Serializable.
> Does anyone know why I would be getting this?
> Thanks!
>
>
> @MappedSuperclass
> public abstract class UuidEntity extends Persistable<UUID> {
> private static final long serialVersionUID = 1L;
>
> @Id
> private UUID id;
>
> public UUID getId() {
>  return id;
> }
>
> protected void setId(UUID id){
>  this.id = id;
> }
>
> @Override
>  public UUID getKey() {
> return id;
> }
>
> @PrePersist
> public void genId() {
> if (id == null) {
>  id = new UUID();
> }
> }
> }
>
> 2011-08-30 04:52:13,705Z ERROR [1906419187@qtp-1568368195-4]  Exception
> when detaching/serializing page
> java.lang.IllegalAccessError: tried to access field
> com.spidertracks.aviator.model.UuidEntity.id from class
> com.spidertracks.aviator.model.billing.Plan
>  at com.spidertracks.aviator.model.billing.Plan.writeExternal(Plan.java)
> at
> java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
>  at org.apache.wicket.Component.writeObject(Component.java:4700)
> at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
>  at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
>  at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>  at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
> at
> org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:121)
>  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
> at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1124)
>  at
> org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
> at
> org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
>  at
> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
> at org.apache.wicket.Session.requestDetached(Session.java:1435)
>  at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1176)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1462)
>  at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
> at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
>  at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>  at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>  at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>  at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
>  at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
>  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>  at
> org.mortbay.jetty.security.SslSocketConnector$SslConnection.run(SslSocketConnector.java:680)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>



-- 

Matthew

Software Engineer

Matthew Goodson | spidertracks

po box 5203 | 117a the square | Palmerston North 4441 | new zealand

P: +64 6 353 3395 | M: +64 27 6969639

E: *matthew@spidertracks.co.nz* <matthew@spidertracks.co.nz>   *
www.spidertracks.com*

spiderwatch - because in the rescue game, time = life.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message