-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: XML Encoding of hibernate objects.
PostPosted: Fri Jun 22, 2007 6:44 am 
Newbie

Joined: Wed Apr 04, 2007 11:47 am
Posts: 4
Hi everyone,

I am having trouble with XML encoding of a java application which uses hibernate. I get a null pointer on every serialisation attempt of my hibernate objects, and everytime a "EnhancerByCGLIB" is in the stacktrace.
I tried disabling cglib and using Hibernate.initialize(status); without success.
My mapping files were generated by MyEclipse - Hibernate Tools, should I modify them to disable lazy initialisation? There is about 50 or more mapping file so I'm not giving it a shot :(

I dont know where to look anymore, any advice would be great.

Baptiste

Hibernate version: 3.2

Full stack trace of any exception that occurs:
java.lang.NullPointerException
at org.model.Status$$EnhancerByCGLIB$$51351ad4.getIdstatus(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at java.beans.Statement.invoke(Unknown Source)
at java.beans.Expression.getValue(Unknown Source)
at java.beans.DefaultPersistenceDelegate.doProperty(Unknown Source)
at java.beans.DefaultPersistenceDelegate.initBean(Unknown Source)
.... A lot more writeObject and writeExpression

Name and version of the database you are using: MaxDB


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 8:01 am 
Newbie

Joined: Wed Apr 04, 2007 11:47 am
Posts: 4
Quick reply, I finally found how to solve this with the following code :


// If this is a Hibernate Proxy, loads the object
if (this.operstd instanceof HibernateProxy) {
this.operstd = (Operstd) ((HibernateProxy) operstd).getHibernateLazyInitializer().getImplementation();
}

You may find more information on the forum by searching for HibernateProxy :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.