yeah i think that should do it. you think it will have a noticable impact on the size of our cloned objects? maybe output null if the object's classloader is the same as our default one to save on space.

-Igor


On 7/22/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
Yes that was the idea.. That you have to delegate there through all your classloaders.
I implemented your change by first using the objects classloader.. then fall back to what we did now.
So that should help your case. When a page (by total) comes from one plugin/package

The only problem is when a page or component that is cloned is a mix of plugins.. Then it won't work and you will need to
implement the IClassResolver so that you iterate over it.

But i think i can fix that also.. so that nobody has to worry anymore for classloaders when cloning (model or object)
I just record all the classloaders that are used for all the objects that are cloned for one request in the outputstream (use the replaceObject method)
Then i use those classloaders myself for t he resolving in the inputstream.. (resolveClass method)
That should always work i believe or am i missing something??

johan



On 7/17/06, Ittay Dror <[EMAIL PROTECTED] > wrote:
if the deserialization uses it, then maybe (i'm not sure how it is used). but in our case, every Page subclass may be in its own class loader, separate from others, so using a singleton IClassResolver instance will not help (unless it delegates to all class loaders, which may cause havoc). i think that my proposed solution is straight forward.

Igor Vaynberg wrote:
> we do have IClassResolver woudnt that help? it helped with osgi
>
> -Igor
>
>
> On 7/17/06, *Ittay Dror* < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     done. the request id is 1524019.
>
>     i've added more description of the problem and the solution. i think
>     this may happen also with osgi integration, or any other case where
>     an object is used that is found through a classloader different than
>     the one wicket / tomcat is in.
>
>     Eelco Hillenius wrote:
>      > I'm afraid I don't get the request. Could you please create a feature
>      > request with a patch, clearly explaining what is wrong today and what
>      > your patch fixes?
>      >
>      > Thanks,
>      >
>      > Eelco
>      >
>      >
>      > On 7/17/06, Ittay Dror < [EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>> wrote:
>      >> Hi,
>      >>
>      >> We're using plugins similar to Eclipse's to decouple
>     functionality. Each plugin's classes run in their own class loader.
>      >>
>      >> We've encountered a problem in onNewBrowserWindow(). it uses
>     Objects.cloneObject(), which uses the default ObjectInputStream,
>     that uses the class loader associated with the execution stack,
>     rather than the object's. so trying to get the class of the object
>     when reading it back fails.
>      >>
>      >> This can be solved by changing cloneObject to:
>      >> public static Object cloneObject(final Object object)
>      >>    {
>      >>        if (object == null)
>      >>        {
>      >>            return null;
>      >>        }
>      >>        else
>      >>        {
>      >>            try
>      >>            {
>      >>                final ByteArrayOutputStream out = new
>     ByteArrayOutputStream(256);
>      >>                ObjectOutputStream oos = new
>     ObjectOutputStream(out);
>      >>                oos.writeObject(object);
>      >>                ObjectInputStream ois = new ObjectInputStream(new
>     ByteArrayInputStream(out
>      >>                        .toByteArray())) {
>      >>                                       protected Class
>     resolveClass(ObjectStreamClass desc) throws IOException,
>      >>                    ClassNotFoundException {
>      >>                        String className = desc.getName();
>      >>                        return Class.forName(className, true,
>     object.getClass().getClassLoader());                     }
>      >>                };
>      >>                return ois.readObject();
>      >>            }
>      >>            catch (ClassNotFoundException e)
>      >>            {
>      >>                throw new WicketRuntimeException("Internal error
>     cloning object", e);
>      >>            }
>      >>            catch (IOException e)
>      >>            {
>      >>                throw new WicketRuntimeException("Internal error
>     cloning object", e);
>      >>            }
>      >>        }
>      >>    }
>      >>
>      >> i think that it should work fine in this context since the
>     object is already accessible when writing it. it is working for us.
>      >>
>      >> btw, a problem that is caused by this failure (and the throwing
>     of WicketRuntimeException) is that the PageMap contains null entries
>     (or rather, the session contains attributes with null values). i
>     couldn't track why exactly this happens.
>      >>
>      >> regards,
>      >> ittay
>      >>
>      >>
>      >>
>      >> --
>      >> ===================================
>      >> Ittay Dror,
>      >> Chief architect, openQRM TL,
>      >> R&D, Qlusters Inc.
>      >> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>      >> +972-3-6081994 Fax: +972-3-6081841
>      >>
>      >> http://www.openQRM.org
>      >> - Keeps your Data-Center Up and Running
>      >>
>      >>
>      >>
>     -------------------------------------------------------------------------
>      >> 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
>     < http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >
>      >> _______________________________________________
>      >> Wicket-user mailing list
>      >> Wicket-user@lists.sourceforge.net
>     <mailto:Wicket-user@lists.sourceforge.net >
>      >> https://lists.sourceforge.net/lists/listinfo/wicket-user
>      >>
>      >
>      >
>      >
>     -------------------------------------------------------------------------
>      > 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
>     < http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>      > _______________________________________________
>      > Wicket-user mailing list
>      > Wicket-user@lists.sourceforge.net
>     <mailto: Wicket-user@lists.sourceforge.net>
>      > https://lists.sourceforge.net/lists/listinfo/wicket-user
>      >
>
>
>     --
>     ===================================
>     Ittay Dror,
>     Chief architect, openQRM TL,
>     R&D, Qlusters Inc.
>     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>     +972-3-6081994 Fax: +972-3-6081841
>
>     http://www.openQRM.org < http://www.openQRM.org>
>     - Keeps your Data-Center Up and Running
>
>
>     -------------------------------------------------------------------------
>     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
>     < http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>     _______________________________________________
>     Wicket-user mailing list
>     Wicket-user@lists.sourceforge.net
>     <mailto: Wicket-user@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
> ------------------------------------------------------------------------
>
>
> -------------------------------------------------------------------------
> 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user


--
===================================
Ittay Dror,
Chief architect, openQRM TL,
R&D, Qlusters Inc.
[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841

http://www.openQRM.org
- Keeps your Data-Center Up and Running

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to