On Wednesday 06 September 2006 22:04, Peter Neubauer wrote:
> Hi Gang,
> tried to use PaxLogging service 0.8.1 with Wicket. I get complaints
> runtime about OsgiLogServiceImpl not being serializable, so it is not
> allowed to exist anywhere below the Pages class hirarchy. Anything we
> can do about that?

Hmmm... 
That means that you must have a non-static member holding the Logger instance.

And that in turn will not only hold the reference to the service 
implementation (which we could fix) but also to the BundleContext, which we 
can not serialize, nor recover from during deserialization.

David's suggestion therefor sounds reasonable;
Change

  private final Logger m_logger = Logger.getLogger( ThisClass.class );

to
  private static final Logger m_logger = Logger.getLogger( ThisClass.class );

It is harder for third-party code though, but IIRC Log4J and JCL aren't 
serializable either, so should not be any change.


Cheers
Niclas

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to