Tim buddy,

I went about solving this a different way, which was to deproxy the hibernate objects before they get passed into the resolution.  It went a little something like this:

public class HibernateUtils {
    public static Object deProxy(Object obj) {
       return ((LazyInitializer)((HibernateProxy)obj).getHibernateLazyInitializer()).getImplementation();
    }
}

So then I call it like this:

public Resolution findAutomobile() {
    return new _javascript_Resolution(HibernateUtils.deProxy(dao.findById(automobile.getId())));
}

It worked just fine for me.

Peace,

Kevin

On 9/3/06, Tim Fennell (JIRA) <[EMAIL PROTECTED]> wrote:
     [ http://mc4j.org/jira/browse/STS-264?page=all ]

Tim Fennell resolved STS-264.
-----------------------------

    Resolution: Fixed

I've fixed the problem with properties without read methods.  Now, if I construct a _javascript_Resolution as:

new _javascript_Resolution(myHibernateObject, Class.forName("net.sf.cglib.proxy.Callback"));

it works well and doesn't include all the hibernate metadata.  Unfortunately there doesn't seem to be a good way to determine progamattically that a class is an "enhanced" class without introducing some dependency either on CGLIB classes or class names - i.e. it wouldn't work for Javassist or other enhancers.

> _javascript_ resolution doesn't work with hibernate proxies
> ---------------------------------------------------------
>
>                 Key: STS-264
>                 URL: http://mc4j.org/jira/browse/STS-264
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.4
>            Reporter: Tim Fennell
>         Assigned To: Tim Fennell
>             Fix For: Release 1.4.1
>
>
> The _javascript_Resolution (or _javascript_Builder) doesn't work for objects that are proxied by hibernate for a couple of reasons.  Firstly there are properties that have no read method, and should therefore be ignored, but these currently cause NullPointerExceptions!
> Secondly, once that's fixed, it still serializes reams of hibernate meta-data, so there needs to be a way to exclude this.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to