an lost in the dark exception question

2008-05-13 Thread Eyal Golan
Hello all,
We have a weird exception in our system.
My team mates created a non standard DataView:
final DataView dataView = new DataView(rows, dataProvider)
{
protected void populateItem(final Item item)
{
final ManagedItemDecorator entity =
(ManagedItemDecorator)item.getModelObject();
//final Component links = new Label(links,new
PropertyModel(entity,links));
*final Component links = new
LinksPanel(links,null,isEnabled);*
item.add(links);
AjaxLink expandButton =
GUIUtis.getExpandButton(expandLink,links,entity);
WebMarkupContainer expandTD = new
WebMarkupContainer(expand);
expandTD.add(GUIUtis.createAttributeModifier(rowspan,
2));
expandTD.add(expandButton);
item.add(expandTD);

 More stuff here ...

}
};

The ExpandButton opens (like a folder in a tree) a Panel that shows more
information.
In the LinksPanel there is another link that open BookmarkablePage.

Scenario:
When we open this BookmarkablePage and then press on ANY of the AjaxLink
(expand button), we get an exception:

2008-05-13 10:55:21,885 ERROR [org.apache.wicket.RequestCycle] - Could not
deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:406)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:702)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311)
at org.apache.wicket.Session.getPage(Session.java:745)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:443)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at
com.eurekify.security.SecurityFilter.doFilterInternal(SecurityFilter.java:38)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: java.io.InvalidClassException:
com.eurekify.tms.web.common.campaign.ManagedItemDecorator; no valid
constructor
at java.io.ObjectStreamClass.init(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at 

Re: an lost in the dark exception question

2008-05-13 Thread Martijn Dashorst
On 5/13/08, Eyal Golan [EMAIL PROTECTED] wrote:
  We have a weird exception in our system.

Not so weird when you read the exception trace. It is a dark art, but
worth the effort of learning.

  My team mates created a non standard DataView:

Uh oh... :)

So read this part:

  2008-05-13 10:55:21,885 ERROR [org.apache.wicket.RequestCycle] - Could not
  deserialize object using
  `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
  object factory

What does that mean? (Don't read ahead just yet, think about the message)








It means that an object, your Item's model object, could not be
deserialized. This means that one of your objects that are attached to
the page does not honor the serialization contract. Specifically when
you go through the stack trace and find the cause:

  Caused by: java.io.InvalidClassException:
  com.eurekify.tms.web.common.campaign.ManagedItemDecorator; no valid
  constructor

It seems that there is something wrong with ManagedItemDecorator - it
is missing some valid constructor. Now if you don't know why this is,
then look up the InvalidClassException using google. This points to
the following JavaDoc [1] and states:

Thrown when the Serialization runtime detects one of the following
problems with a Class.

* The serial version of the class does not match that of the class
   descriptor read from the stream
* The class contains unknown datatypes
* The class does not have an accessible no-arg constructor

Voila, there is your problem, which you could discover yourself given
a bit of brain excercise.

Martijn

[1] http://java.sun.com/j2se/1.4.2/docs/api/java/io/InvalidClassException.html

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: an lost in the dark exception question

2008-05-13 Thread Frank van Lankvelt
According to a conversation I had with Johan, only the last shown page
is kept in memory.  Earlier versions are written to disk.

When using ajax, the page does not have to be actually written to disk
as you cannot reach the previous state by using the back button.  When
using a BookmarkableLink, the previous page _can_ be reached by the back
button so it has to be written out.

Are you using the development mode of Wicket?  It always checks
whether the page is serializable, if I recall correctly.

The problem remains that the ManagedItemDecorator is not serializable.
(see java.io.ObjectStreamClass.lookup)

cheers, Frank

On Tue, 2008-05-13 at 12:01 +0300, Eyal Golan wrote:
 First of all, thanks.
 (most of) all the above I found out.
 I mentioned weird because if that was the problem (Serialization or
 invalid constructor), then the Expand link would have never worked. Am I
 correct?
 BUT, The exception happens only after I go to a BookmarkableLink.
 
 
 It's not we didn't try to discover the problem before :)
 
 
 On Tue, May 13, 2008 at 11:16 AM, Martijn Dashorst 
 [EMAIL PROTECTED] wrote:
 
  On 5/13/08, Eyal Golan [EMAIL PROTECTED] wrote:
We have a weird exception in our system.
 
  Not so weird when you read the exception trace. It is a dark art, but
  worth the effort of learning.
 
My team mates created a non standard DataView:
 
  Uh oh... :)
 
  So read this part:
 
2008-05-13 10:55:21,885 ERROR [org.apache.wicket.RequestCycle] - Could
  not
deserialize object using
  
   `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
 
  What does that mean? (Don't read ahead just yet, think about the message)
 
 
 
 
 
 
 
 
  It means that an object, your Item's model object, could not be
  deserialized. This means that one of your objects that are attached to
  the page does not honor the serialization contract. Specifically when
  you go through the stack trace and find the cause:
 
Caused by: java.io.InvalidClassException:
com.eurekify.tms.web.common.campaign.ManagedItemDecorator; no valid
constructor
 
  It seems that there is something wrong with ManagedItemDecorator - it
  is missing some valid constructor. Now if you don't know why this is,
  then look up the InvalidClassException using google. This points to
  the following JavaDoc [1] and states:
 
  Thrown when the Serialization runtime detects one of the following
  problems with a Class.
 
  * The serial version of the class does not match that of the class
descriptor read from the stream
  * The class contains unknown datatypes
  * The class does not have an accessible no-arg constructor
 
  Voila, there is your problem, which you could discover yourself given
  a bit of brain excercise.
 
  Martijn
 
  [1]
  http://java.sun.com/j2se/1.4.2/docs/api/java/io/InvalidClassException.html
 
  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.3 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
-- 
-
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646
-
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: an lost in the dark exception question

2008-05-13 Thread Eyal Golan
First of all, thanks.
(most of) all the above I found out.
I mentioned weird because if that was the problem (Serialization or
invalid constructor), then the Expand link would have never worked. Am I
correct?
BUT, The exception happens only after I go to a BookmarkableLink.


It's not we didn't try to discover the problem before :)


On Tue, May 13, 2008 at 11:16 AM, Martijn Dashorst 
[EMAIL PROTECTED] wrote:

 On 5/13/08, Eyal Golan [EMAIL PROTECTED] wrote:
   We have a weird exception in our system.

 Not so weird when you read the exception trace. It is a dark art, but
 worth the effort of learning.

   My team mates created a non standard DataView:

 Uh oh... :)

 So read this part:

   2008-05-13 10:55:21,885 ERROR [org.apache.wicket.RequestCycle] - Could
 not
   deserialize object using
 
  `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
   object factory

 What does that mean? (Don't read ahead just yet, think about the message)








 It means that an object, your Item's model object, could not be
 deserialized. This means that one of your objects that are attached to
 the page does not honor the serialization contract. Specifically when
 you go through the stack trace and find the cause:

   Caused by: java.io.InvalidClassException:
   com.eurekify.tms.web.common.campaign.ManagedItemDecorator; no valid
   constructor

 It seems that there is something wrong with ManagedItemDecorator - it
 is missing some valid constructor. Now if you don't know why this is,
 then look up the InvalidClassException using google. This points to
 the following JavaDoc [1] and states:

 Thrown when the Serialization runtime detects one of the following
 problems with a Class.

 * The serial version of the class does not match that of the class
   descriptor read from the stream
 * The class contains unknown datatypes
 * The class does not have an accessible no-arg constructor

 Voila, there is your problem, which you could discover yourself given
 a bit of brain excercise.

 Martijn

 [1]
 http://java.sun.com/j2se/1.4.2/docs/api/java/io/InvalidClassException.html

 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.3 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/