[prev in list] [next in list] [prev in thread] [next in thread] 

List:       logback-dev
Subject:    [logback-dev] Fwd: Unexpected problem with logback
From:       "Vicente Ferrer" <vteferrer () gmail ! com>
Date:       2007-09-17 10:16:43
Message-ID: e098a2840709170316v4524709cra35cd7fcea2d4e02 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi again,

I´m still experiencing the same error. This is the code, where 'log' is of
org.slf4j.Logger type:

     log.debug("annotation {}: {}", j, annotations[j]);

When 'annotations[j]' is my own annotation, the Logback plugin stops to log
the rest of messages and the Error Log in Eclipse shows this stack trace:

java.lang.ClassNotFoundException: org.app.util.annotation.Operation
    at java.lang.ClassLoader.findClass(ClassLoader.java:358)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(
BundleLoader.java:429)
    at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:369)
    at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:357)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
DefaultClassLoader.java:83)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java
:676)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
:1732)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java
:1945)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java
:480)
    at ch.qos.logback.classic.spi.LoggingEvent.readObject(LoggingEvent.java
:282)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java
:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at ch.qos.logback.eclipse.reciever.SocketNode.run(SocketNode.java:54)
    at java.lang.Thread.run(Thread.java:619)

If I use the toString() method of the annotation, the eclipse Logback plugin
works fine. The sample code of that is:

     log.debug("annotation {}: {}", j, annotations[j].toString());

Do you think this is a bug? It seems '
ch.qos.logback.classic.spi.LoggingEvent.readObject' can´t reach the class '
org.app.util.annotation.Operation' in my Eclipse´s classpath.

How can I solve this problem?

Thanks a lot.

---------- Forwarded message ----------
From: Vicente Ferrer <vteferrer@gmail.com>
Date: 14-sep-2007 21:56
Subject: Unexpected problem with logback
To: logback-dev@qos.ch

Hi,

I´m an habitual user of log4j and I´m trying to port my application to
logback. The first impression of this new tool was very good; the pluggin
for Eclipse IDE has a good apparience. But I´m experiencing a little
worrisomely problem: some logging lines cause the Eclipse plugin stops to
write the rest of logging lines. If I activate a ConsoleAppender, I can view
the rest of the logging lines at the standard console, but the Eclipse
plugins don´t show that lines.

The line causing the Eclipse plugin stops to work is:

     Method[] methods = clazz.getDeclaredMethods();
     log.debug("method: {}", methods[i]);

I´ve seen an error on the Error Log eclipse´s view saying that
java.lang.reflect.Method is not Serializable, and the plugin do not show the
rest of the logging lines.

I´ve experimented similar error when I try to log a message line that
contains an own object such as a bean. In this case, the error is a
ClassNotFoundException because of the logback eclipse plugin can´t find the
bean class. The bean class is in my proyect classpath and in the application
server, logback goes fine because it can reach the bean class. How can I
make accesible my classes to the logback plugin.

Could be these two bugs of the plugin?

If you need it, I can post the stacktrace of the error that appears at
Eclipse Error Log View.

Thanks a lot.

P.D.: I´ve sent this message to the logback user´s list, but later I´ve
thought the most appropiate list for this problem should be the dev list.

[Attachment #5 (text/html)]

Hi again, <br><br>I´m still experiencing the same error. This is the code, where \
&#39;log&#39; is of org.slf4j.Logger type:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; \
log.debug(&quot;annotation {}: {}&quot;, j, annotations[j]);<br><br>When \
&#39;annotations[j]&#39; is my own annotation, the Logback plugin stops to log the \
rest of messages and the Error Log in Eclipse shows this stack trace:  \
<br><br>java.lang.ClassNotFoundException: \
org.app.util.annotation.Operation<br>&nbsp;&nbsp;&nbsp; at \
java.lang.ClassLoader.findClass(ClassLoader.java:358)<br>&nbsp;&nbsp;&nbsp; at \
java.lang.ClassLoader.loadClass(ClassLoader.java:306)<br>&nbsp;&nbsp;&nbsp; at \
java.lang.ClassLoader.loadClass (ClassLoader.java:251)<br>&nbsp;&nbsp;&nbsp; at \
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429)<br>&nbsp;&nbsp;&nbsp; \
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
 <br>&nbsp;&nbsp;&nbsp; at \
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)<br>&nbsp;&nbsp;&nbsp; \
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)<br>&nbsp;&nbsp;&nbsp; \
at java.lang.ClassLoader.loadClass (ClassLoader.java:251)<br>&nbsp;&nbsp;&nbsp; at \
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)<br>&nbsp;&nbsp;&nbsp; \
at java.lang.Class.forName0(Native Method)<br>&nbsp;&nbsp;&nbsp; at \
java.lang.Class.forName(Class.java:247)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectInputStream.resolveProxyClass \
(ObjectInputStream.java:676)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readOrdinaryObject \
(ObjectInputStream.java:1732)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readObject0 \
(ObjectInputStream.java:1323)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)<br>&nbsp;&nbsp;&nbsp; \
at ch.qos.logback.classic.spi.LoggingEvent.readObject \
(LoggingEvent.java:282)<br>&nbsp;&nbsp;&nbsp; at \
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&nbsp;&nbsp;&nbsp; at \
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>&nbsp;&nbsp;&nbsp; \
at sun.reflect.DelegatingMethodAccessorImpl.invoke \
(DelegatingMethodAccessorImpl.java:25)<br>&nbsp;&nbsp;&nbsp; at \
java.lang.reflect.Method.invoke(Method.java:597)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readSerialData \
(ObjectInputStream.java:1846)<br>&nbsp;&nbsp;&nbsp; at \
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)<br>&nbsp;&nbsp;&nbsp; \
at java.io.ObjectInputStream.readObject \
(ObjectInputStream.java:351)<br>&nbsp;&nbsp;&nbsp; at \
ch.qos.logback.eclipse.reciever.SocketNode.run(SocketNode.java:54)<br>&nbsp;&nbsp;&nbsp; \
at java.lang.Thread.run(Thread.java:619)<br><br>If I use the toString() method of the \
annotation, the eclipse Logback plugin works fine. The sample code of that is:  \
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; log.debug(&quot;annotation {}: {}&quot;, j, \
annotations[j].toString());<br><br>Do you think this is a bug? It seems \
&#39;ch.qos.logback.classic.spi.LoggingEvent.readObject&#39; can´t reach the class \
&#39;org.app.util.annotation.Operation &#39; in my Eclipse´s classpath. <br><br>How \
can I solve this problem?<br><br>Thanks a lot.<br><br>---------- Forwarded message \
----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Vicente \
Ferrer</b> &lt; <a href="mailto:vteferrer@gmail.com">vteferrer@gmail.com</a>&gt;<br>Date: \
14-sep-2007 21:56<br>Subject: Unexpected problem with logback<br>To: <a \
href="mailto:logback-dev@qos.ch">logback-dev@qos.ch</a><br><br></span>Hi, <br> \
<br>I´m an habitual user of log4j and I´m trying to port my application to logback. \
The first impression of this new tool was very good; the pluggin for Eclipse IDE has \
a good apparience. But I´m experiencing a little worrisomely problem: some logging \
lines cause the Eclipse plugin stops to write the rest of logging lines. If I \
activate a ConsoleAppender, I can view the rest of the logging lines at the
standard console, but the Eclipse plugins don´t show that lines. <br><br>The line \
causing the Eclipse plugin stops to work is: <br><br>&nbsp;&nbsp;&nbsp;&nbsp; \
Method[] methods = clazz.getDeclaredMethods();<br>&nbsp;&nbsp;&nbsp;&nbsp; \
log.debug(&quot;method: {}&quot;, methods[i]); <br><br>I´ve seen an error on the \
Error Log eclipse´s view saying that  java.lang.reflect.Method is not Serializable, \
and the plugin do not show the rest of the logging lines. <br><br>I´ve experimented \
similar error when I try to log a message line that contains an own object such as a \
bean. In this case, the error is a ClassNotFoundException because of the logback \
eclipse plugin can´t find the bean class. The bean class is in my proyect classpath \
and in the application server, logback goes fine because it can reach the bean class. \
How can I make accesible my classes to the logback plugin.<br><br>Could be these two \
bugs of the plugin?  <br><br>If you need it, I can post the stacktrace of the error \
that appears at Eclipse Error Log View.<br><br>Thanks a lot. <br><br>P.D.: I´ve sent \
this message to the logback user´s list, but later I´ve thought the most appropiate \
list for this problem should be the dev list. <br>



_______________________________________________
logback-dev mailing list
logback-dev@qos.ch
http://qos.ch/mailman/listinfo/logback-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic