Re: [Wicket-user] SLF4J and wicket
On Thursday, April 26, 2007, 8:46:08 PM, Igor [EMAIL PROTECTED] wrote: and this is a problem only for things that are deployed into a SHARED classpath. no body (at least i hope not) is sharing wicket.jar between multiple web applications. so there is no problem. Well, I did have a look at doing just that a few months back, as multiple Wicket Spring jars do bulk out an EAR! Unfortunately, it wasn't a major requirement, so couldn't justify spending much time on it as I came across some (probably minor, but...) class-loading issues, I just accepted the extra overhead in deployment time. (The link between me the server seems to run at ~IDSN speed!) /Gwyn - 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
Re: [Wicket-user] SLF4J and wicket
since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run (FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found
Re: [Wicket-user] SLF4J and wicket
But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray (Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run (FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks
Re: [Wicket-user] SLF4J and wicket
Yes, that was my point earlier. Or make it a transient with lazy creation as that would be more efficient. Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler .init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup (ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651
Re: [Wicket-user] SLF4J and wicket
but not for Wicket components, an instance log field in Component (or other base wicket class) will be a memory slot for every wicket component instance... johan On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Yes, that was my point earlier. Or make it a transient with lazy creation as that would be more efficient. Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler .init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387
Re: [Wicket-user] SLF4J and wicket
yeah, so it either more efficient in terms of processing (reusing the member var) or in memory (not keep the member var). Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: but not for Wicket components, an instance log field in Component (or other base wicket class) will be a memory slot for every wicket component instance... johan On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Yes, that was my point earlier. Or make it a transient with lazy creation as that would be more efficient. Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory (new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler .init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject
Re: [Wicket-user] SLF4J and wicket
why not just make them static? you want the nonstatic loggers so you can get better context, but we dont need better context! for us classname:linenumber is enough. so in the framework we can use the static instances. if a user wants better context then their loggers can be non-static. -igor On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: yeah, so it either more efficient in terms of processing (reusing the member var) or in memory (not keep the member var). Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: but not for Wicket components, an instance log field in Component (or other base wicket class) will be a memory slot for every wicket component instance... johan On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Yes, that was my point earlier. Or make it a transient with lazy creation as that would be more efficient. Eelco On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J ( v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory (new
Re: [Wicket-user] SLF4J and wicket
On 4/26/07, Igor Vaynberg [EMAIL PROTECTED] wrote: why not just make them static? http://wiki.apache.org/jakarta-commons/Logging/StaticLog - 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
Re: [Wicket-user] SLF4J and wicket
yeah yeah yeah. and this is a problem only for things that are deployed into a SHARED classpath. no body (at least i hope not) is sharing wicket.jar between multiple web applications. so there is no problem. -igor On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: On 4/26/07, Igor Vaynberg [EMAIL PROTECTED] wrote: why not just make them static? http://wiki.apache.org/jakarta-commons/Logging/StaticLog - 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 - 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
Re: [Wicket-user] SLF4J and wicket
why not just make them static? Earlier this thread: (me) I would prefer to either have log fields as static in components... We were just discussing what people could do if they didn't want those loggers as static variables. Personally, I have no problem with them being static. 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
Re: [Wicket-user] SLF4J and wicket
what they would do is simple they would do the lazylookup you showed, but instead of using a field they would use the metadata store. that way you get a non-static logger, and do not incur a memory footprint hit. -igor On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: why not just make them static? Earlier this thread: (me) I would prefer to either have log fields as static in components... We were just discussing what people could do if they didn't want those loggers as static variables. Personally, I have no problem with them being static. 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 - 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
Re: [Wicket-user] SLF4J and wicket
what they would do is simple they would do the lazylookup you showed, but instead of using a field they would use the metadata store. that way you get a non-static logger, and do not incur a memory footprint hit. The memory foot print would still be there if you use the Component's meta data. 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
Re: [Wicket-user] SLF4J and wicket
not really. you would remove the logger in ondetach. it isnt a permanent footprint - that is it doesnt take up a slot in all subclasses. -igor On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: what they would do is simple they would do the lazylookup you showed, but instead of using a field they would use the metadata store. that way you get a non-static logger, and do not incur a memory footprint hit. The memory foot print would still be there if you use the Component's meta data. 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 - 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
Re: [Wicket-user] SLF4J and wicket
on which class is it then bound? we use private static loggers now so they are really bind to the class. But if you are storing them in the meta data then they are not really bind to the class but more the the resulting class/instance so never Component itself. Don't know if that really matters but that would be a difference between een private static log field or private Log getLog() method Besides that the question is how many times for 1 component wold the getLog() be called? if it is just once or twice then don't store it. Just create one But for wicket this is a none issue in my eyes, just private static logs are fine for me. (as long as the logger doesn't keep a reference to the wicket class) johan On 4/26/07, Igor Vaynberg [EMAIL PROTECTED] wrote: not really. you would remove the logger in ondetach. it isnt a permanent footprint - that is it doesnt take up a slot in all subclasses. -igor On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: what they would do is simple they would do the lazylookup you showed, but instead of using a field they would use the metadata store. that way you get a non-static logger, and do not incur a memory footprint hit. The memory foot print would still be there if you use the Component's meta data. 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
like i said in my previous response, ditto. for wicket private static is fine. -igor On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: on which class is it then bound? we use private static loggers now so they are really bind to the class. But if you are storing them in the meta data then they are not really bind to the class but more the the resulting class/instance so never Component itself. Don't know if that really matters but that would be a difference between een private static log field or private Log getLog() method Besides that the question is how many times for 1 component wold the getLog() be called? if it is just once or twice then don't store it. Just create one But for wicket this is a none issue in my eyes, just private static logs are fine for me. (as long as the logger doesn't keep a reference to the wicket class) johan On 4/26/07, Igor Vaynberg [EMAIL PROTECTED] wrote: not really. you would remove the logger in ondetach. it isnt a permanent footprint - that is it doesnt take up a slot in all subclasses. -igor On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: what they would do is simple they would do the lazylookup you showed, but instead of using a field they would use the metadata store. that way you get a non-static logger, and do not incur a memory footprint hit. The memory foot print would still be there if you use the Component's meta data. 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 - 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
great, a neat way to make logging even cheaper... instantiate all the time for each and every message :-) Am 26.04.2007 um 13:28 schrieb Johan Compagner: But if static logs are really a problem: http://wiki.apache.org/jakarta-commons/Logging/StaticLog if would do this: private void doSomething() { /// foo LogFactory.getLog(Xxx.class).debug(blaat) // bar } or private void doSomething() { /// foo getLog().debug(blaat); // bar } private Log getLog() { return LogFactory.getLog(Xxx.class); } On 4/26/07, Johan Compagner [EMAIL PROTECTED] wrote: since when does a logger have state? I am very interrested to know what it is that a logger isn't thread safe. You configure it through the constructor (so i guess assign final fields) you don't set any variables after that on it. And you call only info/error with 1 or to params that it needs to log! johan On 4/26/07, Matej Knopp [EMAIL PROTECTED] wrote: Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin Bjön Limell [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init (ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup (ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject (ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler $ObjectFieldAndIndex.writeField(ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields (ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject (ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray (Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage (FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access $900(FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore $PageSerializingThread.run(FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste
Re: [Wicket-user] SLF4J and wicket
great, a neat way to make logging even cheaper... instantiate all the time for each and every message :-) It doesn't get instantiated every time. For instance Log4jLoggerFactory creates one instance lazily and then does a map lookup. Of course, it is still more expensive then just referring to a static var, certainly for 'just logging'. But otoh it seems unlikely that this will every be a real problem in web applications. 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
Re: [Wicket-user] SLF4J and wicket
Unless I am missing something, why not do it like this: private transient Logger logger; private Logger getLogger() { if (logger == null) { logger = LoggerFactory.getLogger(Foo.class); } } public void myMethod() { ... getLogger().debug(Something here); } On Thu, 2007-04-26 at 13:55 -0700, Eelco Hillenius wrote: great, a neat way to make logging even cheaper... instantiate all the time for each and every message :-) It doesn't get instantiated every time. For instance Log4jLoggerFactory creates one instance lazily and then does a map lookup. Of course, it is still more expensive then just referring to a static var, certainly for 'just logging'. But otoh it seems unlikely that this will every be a real problem in web applications. 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 -- Philip A. Chapman Desktop and Web Application Development: Java, .NET, PostgreSQL, MySQL, MSSQL Linux, Windows 2000, Windows XP signature.asc Description: This is a digitally signed message part - 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
Re: [Wicket-user] SLF4J and wicket
because if we put that into Component for example, all components will have a logger take up a memory slot -igor On 4/26/07, Philip A. Chapman [EMAIL PROTECTED] wrote: Unless I am missing something, why not do it like this: private transient Logger logger; private Logger getLogger() { if (logger == null) { logger = LoggerFactory.getLogger(Foo.class); } } public void myMethod() { ... getLogger().debug(Something here); } On Thu, 2007-04-26 at 13:55 -0700, Eelco Hillenius wrote: great, a neat way to make logging even cheaper... instantiate all the time for each and every message :-) It doesn't get instantiated every time. For instance Log4jLoggerFactory creates one instance lazily and then does a map lookup. Of course, it is still more expensive then just referring to a static var, certainly for 'just logging'. But otoh it seems unlikely that this will every be a real problem in web applications. Eelco -This SF.net email is sponsored by DB2 ExpressDownload DB2 Express C - the FREE version of DB2 express and takecontrol 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 -- Philip A. Chapman Desktop and Web Application Development: Java, .NET, PostgreSQL, MySQL, MSSQL Linux, Windows 2000, Windows XP - 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 - 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
[Wicket-user] SLF4J and wicket
Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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
Re: [Wicket-user] SLF4J and wicket
It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup(ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField(ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields(ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage(FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900(FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run(FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup(ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField(ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields(ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage(FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900(FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run(FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Could you try to suggestion in the error message to put: Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) in your Application's init method and see if all works ok then? Meanwhile, I hope Johan notes this error and takes a look. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup(ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField(ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields(ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage(FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900(FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run(FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Why would you want to serializable a log?! -Matej On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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
Re: [Wicket-user] SLF4J and wicket
On 4/25/07, Matej Knopp [EMAIL PROTECTED] wrote: Why would you want to serializable a log?! Isn't the recommendation of one of the logging guru's to not make the loggers static, but just members or local vars? If you make them non-static members, they'll get serialized. Martijn -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.6 contains a very important fix. Download Wicket now! http://wicketframework.org - 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
Re: [Wicket-user] SLF4J and wicket
Yeah, I would prefer to either have log fields as static in components or get them just in time rather than keeping references to them. Keeping references in instances kind of combines the worst of both. Eelco On 4/25/07, Peter Ertl [EMAIL PROTECTED] wrote: looks like the logging guru is wrong when it comes to wicket... Am 25.04.2007 um 22:15 schrieb Martijn Dashorst: On 4/25/07, Matej Knopp [EMAIL PROTECTED] wrote: Why would you want to serializable a log?! Isn't the recommendation of one of the logging guru's to not make the loggers static, but just members or local vars? If you make them non-static members, they'll get serialized. Martijn -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.6 contains a very important fix. Download Wicket now! http://wicketframework.org -- --- 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Thats what i have heard too. At least JCL isnt thread-safe. Dont really know about slf4j On 4/25/07, Martijn Dashorst [EMAIL PROTECTED] wrote: On 4/25/07, Matej Knopp [EMAIL PROTECTED] wrote: Why would you want to serializable a log?! Isn't the recommendation of one of the logging guru's to not make the loggers static, but just members or local vars? If you make them non-static members, they'll get serialized. Martijn -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.6 contains a very important fix. Download Wicket now! http://wicketframework.org - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin Bjön Limell [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init(ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup(ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField(ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields(ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride(WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage(FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900(FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run(FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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 - 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 - 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
Re: [Wicket-user] SLF4J and wicket
Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory (new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride( WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride( WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run( FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar : org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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 - 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 - This SF.net
Re: [Wicket-user] SLF4J and wicket
What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory (new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride( WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride( WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage (FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run( FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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 - 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
Re: [Wicket-user] SLF4J and wicket
here's the trace: ERROR org.apache.wicket.util.lang.Objects Error serializing object class testpage.PollPage [object=[Page class = testpage.PollPage, id = 1, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:Unable to serialize class: org.apache.commons.logging.impl.SLF4JLocationAwareLog Field hierarchy is: 1 [class=testpage.PollPage, path=1] private final org.apache.commons.logging.Log testpage.BasePage.log[class= org.apache.commons.logging.impl.SLF4JLocationAwareLog] - field that is not serializable at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:347) at org.apache.wicket.util.io.SerializableChecker.checkFields( SerializableChecker.java:615) at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:538) at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride (SerializableChecker.java:683) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java :322) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride( IObjectStreamFactory.java:74) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java :322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run( FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) Caused by: java.io.NotSerializableException: org.apache.commons.logging.impl.SLF4JLocationAwareLog at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java :1156) at java.io.ObjectOutputStream.defaultWriteFields( ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData( ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject( ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java :1150) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java :326) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride( IObjectStreamFactory.java:66) ... 6 common frames omitted Using jdk1.6.0_01 On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116
Re: [Wicket-user] SLF4J and wicket
Yep, that's pretty clear. SLF4JLocationAwareLog[1] doesn't implement serializable. So, to fix, see my previous comment. Eelco [1] http://www.slf4j.org/api/org/apache/commons/logging/impl/SLF4JLocationAwareLog.html On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: here's the trace: ERROR org.apache.wicket.util.lang.Objects Error serializing object class testpage.PollPage [object=[Page class = testpage.PollPage, id = 1, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:Unable to serialize class: org.apache.commons.logging.impl.SLF4JLocationAwareLog Field hierarchy is: 1 [class=testpage.PollPage, path=1] private final org.apache.commons.logging.Log testpage.BasePage.log[class= org.apache.commons.logging.impl.SLF4JLocationAwareLog] - field that is not serializable at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:347) at org.apache.wicket.util.io.SerializableChecker.checkFields ( SerializableChecker.java:615) at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:538) at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride( SerializableChecker.java :683) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java :322) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride( IObjectStreamFactory.java:74) at java.io.ObjectOutputStream.writeObject (ObjectOutputStream.java :322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run( FilePageStore.java:237) at java.lang.Thread.run (Thread.java:619) Caused by: java.io.NotSerializableException: org.apache.commons.logging.impl.SLF4JLocationAwareLog at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java :1156) at java.io.ObjectOutputStream.defaultWriteFields ( ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData( ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject( ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java :1150) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java :326) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride ( IObjectStreamFactory.java:66) ... 6 common frames omitted Using jdk1.6.0_01 On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization
Re: [Wicket-user] SLF4J and wicket
Yeah, if it really should be a member variable (which makes sense when logger is not thread safe), it probably could be something like this: private transient Logger logger; private Logger getLogger() { if (logger == null) initializeLogger; return logger; } On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage [object=[Page class = test.page.SignInPage, id = 1, version = 0]] org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog test.page.SignInPage-log NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: org.apache.wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at org.apache.wicket.util.io.ClassStreamHandler.init( ClassStreamHandler.java:252) at org.apache.wicket.util.io.ClassStreamHandler.lookup( ClassStreamHandler.java:116) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:752) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.writeField (ClassStreamHandler.java:862) at org.apache.wicket.util.io.ClassStreamHandler.writeFields( ClassStreamHandler.java:387) at org.apache.wicket.util.io.WicketObjectOutputStream.writeObjectOverride (WicketObjectOutputStream.java:779) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run (FilePageStore.java:237) at java.lang.Thread.run(Thread.java:619) ps. thanks for the SUPER quick response!! ;) On 4/25/07, Eelco Hillenius [EMAIL PROTECTED] wrote: It might be a bug in our custom serialization. Could you please paste the full stack trace please? Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Hi. Anyone had success with slf4j and wicket pages? Im getting serializeable exceptions with jcl104-over-slf4j-1.3.1.jar: org.apache.wicket.util.io.WicketSerializeableException: No Serializable constructor found for class org.apache.commons.logging.impl.SLF4JLocationAwareLog At the moment I dont need to cluster, but im not sure how its gonna be later on... - 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
Re: [Wicket-user] SLF4J and wicket
Yepp, thanks! But i think the best thing for me to do is to replace all use of Log(jcl) - Logger(slf4j) in my app :) On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Yep, that's pretty clear. SLF4JLocationAwareLog[1] doesn't implement serializable. So, to fix, see my previous comment. Eelco [1] http://www.slf4j.org/api/org/apache/commons/logging/impl/SLF4JLocationAwareLog.html On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: here's the trace: ERROR org.apache.wicket.util.lang.Objects Error serializing object class testpage.PollPage [object=[Page class = testpage.PollPage, id = 1, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:Unable to serialize class: org.apache.commons.logging.impl.SLF4JLocationAwareLog Field hierarchy is: 1 [class=testpage.PollPage, path=1] private final org.apache.commons.logging.Log testpage.BasePage.log[class= org.apache.commons.logging.impl.SLF4JLocationAwareLog] - field that is not serializable at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:347) at org.apache.wicket.util.io.SerializableChecker.checkFields ( SerializableChecker.java:615) at org.apache.wicket.util.io.SerializableChecker.check( SerializableChecker.java:538) at org.apache.wicket.util.io.SerializableChecker.writeObjectOverride( SerializableChecker.java :683) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:322) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride( IObjectStreamFactory.java:74) at java.io.ObjectOutputStream.writeObject ( ObjectOutputStream.java:322) at org.apache.wicket.util.lang.Objects.objectToByteArray( Objects.java:1102) at org.apache.wicket.protocol.http.FilePageStore.serializePage( FilePageStore.java:651) at org.apache.wicket.protocol.http.FilePageStore.access$900( FilePageStore.java:49) at org.apache.wicket.protocol.http.FilePageStore$PageSerializingThread.run( FilePageStore.java:237) at java.lang.Thread.run (Thread.java:619) Caused by: java.io.NotSerializableException: org.apache.commons.logging.impl.SLF4JLocationAwareLog at java.io.ObjectOutputStream.writeObject0( ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields ( ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData( ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject( ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0( ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeObject( ObjectOutputStream.java:326) at org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride ( IObjectStreamFactory.java:66) ... 6 common frames omitted Using jdk1.6.0_01 On 4/26/07, Eelco Hillenius [EMAIL PROTECTED] wrote: What's the stack trace you get when you use normal serialization? It should point you to an offending field. If you only get it with JCL, there is probably something in JCL that isn't serializable. You should consider either making it a static variable, getting it only when you need it (don't hold a reference, which is probably quite inefficient), or store it as a transient field, and initiatlize it lazily (check on null) so that it won't be serialized. More work but safe. If you choose the latter, be sure to always do the null check, as serializaing/ deserializing will null the reference. Eelco On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Maybe I was a bit unclear. The problem only occurs when you're using jcl104-over-slf4j (JCL's Log not slf4j's Logger). JCL104-over-slf4j just enables you to use old 'Log log = LogFactory.getLog ()' with slf4j (without classloading issues etc) ps. Same problem with Objects.setObjectStreamFactory(...); On 4/25/07, Justin Morgan [EMAIL PROTECTED] wrote: Just a data point...I am using the Wicket 1.3 snapshot jars along with SLF4J with no problems; my pages log just fine. The underlying logging implementation I'm using is the Log4J (v1.2) logging system. So far I really like slf4j, BTW. - Justin *Bjön Limell [EMAIL PROTECTED]* Sent by: [EMAIL PROTECTED] 04/25/2007 11:57 AM Please respond to wicket-user@lists.sourceforge.net To wicket-user@lists.sourceforge.net cc Subject Re: [Wicket-user] SLF4J and wicket btw, im using 1.3.0-incubating-SNAPSHOT On 4/25/07, Bjön Limell [EMAIL PROTECTED] wrote: Sure! ERROR org.apache.wicket.util.lang.Objects Error serializing object class test.page.SignInPage[object=[Page class = test.page.SignInPage, id = 1, version = 0