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]> 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]
>> +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
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> 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
> [email protected]
> 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
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user