It would be a simple thing to look up the bean in each method in the service locater as versus keeping a reference. However, this is not how the existing service locaters here have been coded and they've been clear about wanting the new stuff to mimic the old stuff. The best way to solve the issue would be to get rid of EJB altogather since the usage requirements of the project are pretty light but I'm not here to change the world (none of these arguments would be easy), just to get their project coded for them as per their requirements. They are going to be maintaining it so I suppose it's fair to code it exactly like the existing code.
Eelco Hillenius wrote: > >> Eelco, I realized that you are recommending using Spring or looking up >> the >> bean on the fly some other way but I am working for a place where Spring >> is >> not part of the "approved" stack and they have an established way that >> access to EJB's is coded. > > Not really. I mean a @SpringBean *construct*, like you can find in the > Spring integration project. That project generates proxies for every > @SpringBean annot found. These proxies are light and serializable, and > internally hold a transient reference to the actual spring bean. When > serialized, the spring bean instance is discarded; the proxy will > locate it again when it is called. > > You said you can't use annotations, so that trick wouldn't go here for > you. There used to be a project[1] (now only for 1.2.x) that used > commons attributes[2] for the same purpose, but we're not maintaining > it for 1.3 anymore (though it is stored as a wicket-stuff project > now[3]). > > Alternatively, you can just locate the bean just in time. Are you sure > you need to keep a reference to it in your component(s)? And consider > that *if* you need a reference, it's probably per-request (so you'll > want a new one when a new request starts). If that is true, you can > just set the reference lazily (get it when you actually access it), > and null it in the components onDetach method (override that method; > it will be called when a request is handled) so that it won't be > serialized. > > Eelco > > [1] > http://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket-spring-annot > [2] http://jakarta.apache.org/commons/attributes/ > [3] > https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-spring-cattr > > ------------------------------------------------------------------------- > 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 > > -- View this message in context: http://www.nabble.com/Wicket-1.2.6-Development-mode-serialization-checks-and-remote-EJB%27s-tf3866878.html#a11011221 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- 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