lazyoverflow example issue with dpHibernate 2.0-RC3

34 views
Skip to first unread message

jandrade

unread,
Jan 6, 2011, 3:22:36 PM1/6/11
to dpHibernate
Hi,

I'm trying to start using dpHibernate for my project and I've been
using the lazyoverflow example as a template for my implementation.
However, it seems that it doesn't quite work with the latest
dpHibernate 2.0-RC3 libraries. For example, the spring context file
has an error for the dpHibernateDeserializer bean since there is no
constructor with no arguments. I'm not sure how to configure the
spring bean properly to accomodate the constructor. It seems like it
needs the source object, but I don't know how I can refer to it from
the context file.

Also, can I use the dpHibernateContext.xml as a good starting
template? I saw Marty Pitt's excellent article on DZone and the sample
configuration there is simpler, missing some things such as the
objectChangeUpdater, hibernateProxyResolver, dpHibernatePreProcessors
and dpHibernatePostProcessors beans. Can you please help me to
identify a good starting template for a dpHibernate application?

Thanks!

Marty Pitt

unread,
Jan 6, 2011, 5:01:40 PM1/6/11
to dphib...@googlegroups.com
Hi

I'll try and take a look at the RC3 / LazyOverflow combo and see what the
problem is. Which version of the Spring adapter are you using?

The source for the demo I put together for the article should work as a good
template - grab it from here:

http://code.google.com/p/dphibernate/source/browse/#svn/trunk/samples/lazyLoadingWithSpring

Marty

--------------------------------------------------
From: "jandrade" <jand...@gmail.com>
Sent: Thursday, January 06, 2011 3:22 PM
To: "dpHibernate" <dphib...@googlegroups.com>
Subject: lazyoverflow example issue with dpHibernate 2.0-RC3

> --
> You received this message because you are subscribed to the Google Groups
> "dpHibernate" group.
> To post to this group, send email to dphib...@googlegroups.com.
> To unsubscribe from this group, send email to
> dphibernate...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dphibernate?hl=en.
>
>

jandrade

unread,
Jan 6, 2011, 5:17:26 PM1/6/11
to dpHibernate
Hi Marty,

Thanks for responding. I'm using Spring framework 3.0.5.RELEASE so I'm
using the Spring 3.0 extensions.

I just tried the dZoneTutorial project from SVN and it gives me the
same error. I'm using the Spring IDE in Eclipse which validates the
spring XML files before even running the application. The validation
error I get is:

No constructor with 0 arguments defined in class
'org.dphibernate.serialization.HibernateSerializer'

It looks like this is the main issue for now. I'd really appreciate
any suggestions on how to fix this error.

Thanks!

Javier


On Jan 6, 2:01 pm, Marty Pitt <martyp...@me.com> wrote:
> Hi
>
> I'll try and take a look at the RC3 / LazyOverflow combo and see what the
> problem is.  Which version of the Spring adapter are you using?
>
> The source for the demo I put together for the article should work as a good
> template - grab it from here:
>
> http://code.google.com/p/dphibernate/source/browse/#svn/trunk/samples...
>
> Marty
>
> --------------------------------------------------
> From: "jandrade" <jandra...@gmail.com>

jandrade

unread,
Jan 10, 2011, 12:30:35 PM1/10/11
to dpHibernate
Hi,

Any suggestions? I'm sorry to insist, but I have our development team
waiting for a way to solve the lazy initialization exceptions we're
getting during BlazeDS serialization/deserialization, and I really
don't want to set everything to eager loading. I know another way is
to use DTOs, but dpHibernate seems like a more elegant solution to
this problem.

Thanks!

Javier

Marty Pitt

unread,
Jan 10, 2011, 5:47:43 PM1/10/11
to dphib...@googlegroups.com
Hi

Sorry for taking so long to reply - busy start to the year.

I've just had a quick look at this ... and I believe that the issue lies
with the Spring IDE validation.

The bean is declared in the spring context as prototype, and dpHibernate
invokes Spring to instantiate a serializer on a per-instance basis. The
object to be serialized is passed in at runtime.

AFAIK, this is a valid Spring configuration (ie., I use it in production
without issue), however I'll follow up with the Spring community to double
check. In the mean time, I'd suggest suspending the validation within
SpringIDE.

Marty


--------------------------------------------------
From: "jandrade" <jand...@gmail.com>
Sent: Monday, January 10, 2011 12:30 PM
To: "dpHibernate" <dphib...@googlegroups.com>
Subject: Re: lazyoverflow example issue with dpHibernate 2.0-RC3

Nam

unread,
Jan 13, 2011, 10:16:50 AM1/13/11
to dpHibernate
I can confirm that this is valid configuration. We just need to add a
public default constructor for HibernateSerializer as it's a JavaBean
object. Can you fix this Marty?

On Jan 10, 5:47 pm, Marty Pitt <martyp...@me.com> wrote:
> Hi
>
> Sorry for taking so long to reply - busy start to the year.
>
> I've just had a quick look at this ... and I believe that the issue lies
> with the Spring IDE validation.
>
> The bean is declared in the spring context as prototype, and dpHibernate
> invokes Spring to instantiate a serializer on a per-instance basis.  The
> object to be serialized is passed in at runtime.
>
> AFAIK, this is a valid Spring configuration (ie., I use it in production
> without issue), however I'll follow up with the Spring community to double
> check.  In the mean time, I'd suggest suspending the validation within
> SpringIDE.
>
> Marty
>
> --------------------------------------------------
> From: "jandrade" <jandra...@gmail.com>

Marty Pitt

unread,
Jan 13, 2011, 10:38:04 AM1/13/11
to dphib...@googlegroups.com
Sorry, but no.

It's invalid for HibernateSerializer to be constructed without an object to
serialize, which is why there isn't a default constructor.

Marty

--------------------------------------------------
From: "Nam" <ale...@gmail.com>
Sent: Thursday, January 13, 2011 10:16 AM

Reply all
Reply to author
Forward
0 new messages