> I have a wicket page (java class) which uses a service locater to execute
> messages on a remote EJB. Though there is no direct reference to the EJB
> from my wicket page there is a reference to the service locater which uses
> JNDI to get a reference to the remote EJB. I get the following error (FYI,
> This error does not happen in wicket 1.2 but happens in wicket 1.2.6).

Make sure you've read and understand
http://cwiki.apache.org/WICKET/working-with-wicket-models.html first,
particularly the bit about detachable models.

Also, you might have references you weren't aware off through
annonymous classes, which hold references to their enclosing objects.
so

class Foo {
  public Foo() {
    add(new Bar() {
      void oink() { };
    });
  }
}

Bar actually holds a reference to Foo. This might be a reason why you
have a reference to an EJB you weren't expecting.

Finally, note that you can turn the check off. When you put Wicket in
deployment mode (which everyone *should* do when deploying) this check
is turned off anyway. The reason why 1.2 worked for you was because
the check wasn't in there yet.

In 1.2, the check is only for development, to help you find code that
would be problematic *if* you use session replication. But if you
don't, you can turn off this check. A short history is kept in memory
as 'versions', which are only the deltas of changes in the component
tree. In Wicket 1.3, we have another default
(SecondLevelCacheSessionStore, the previous was HttpSessionStore)
implementation of where history is kept, and this store only holds the
current page instance in memory, and saves older versions to 'second
level cache', by default a temp dir (and the actual saving happens
async in a background thread). For this to work, your whole (detached)
page has to be serializable.

A final note: reporting on serialization errors is much improved in
Wicket 1.3. On top of the JDK's normal error reporting, Wicket now
traces to the exact (first) reference to the non-serializable object
you have. So, depending on how far you are in your project, if
upgrading to 1.3 is an option for you, please do :)

Eelco

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to