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

List:       logback-user
Subject:    [logback-user] =?utf-8?b?5Zue5aSN77yaICBsb2diYWNrIGRvZXMgbm90IHBy?= =?utf-8?q?int_exception=27s_caus
From:       "=?utf-8?B?6ZmM6Lev5Lq6?=" <h5ru () qq ! com>
Date:       2020-06-18 6:25:51
Message-ID: tencent_AAC4948EDCA47678CA419BEE77A68ECC5E06 () qq ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hi Jörn,
Thank you a lot a lot :) :) I will try it:)

BR,
Mike(Yu, Chong-Chao)


&nbsp;




------------------&nbsp;原始邮件&nbsp;------------------
发件人:&nbsp;"Jörn Huxhorn"<jhuxhorn@googlemail.com&gt;;
发送时间:&nbsp;2020年6月14日(星期天) 晚上10:42
收件人:&nbsp;"logback users list"<logback-user@qos.ch&gt;;

主题:&nbsp;Re: [logback-user] logback does not print exception's cause



 Hi Mike,


sorry for the late answer. I hope this still helps you.


This stackoverflow answer solves your problem:
https://stackoverflow.com/questions/2411487/nullpointerexception-in-java-with-no-stacktrace#3010106



TL;DR:
You are running into a hotspot optimisation and need to \
add&nbsp;-XX:-OmitStackTraceInFastThrow to your JVM options to "enable" those \
stacktraces.  

Cheers,Jörn.
 
 

On 10. June 2020 at 04:52:38, 陌路人 (h5ru@qq.com) wrote:
 
Hi,
Firstly thank you for your time.
Sometimes, logback&nbsp;does not print exception's cause, I can't use the log to fix \
bug, as followings:


2020-06-09 16:54:32,393 ERROR [task-executor-27] [SimpleDispatcher.java:203] \
Exception occurred during dispatch web socket frame for uri[/ws/partydungeon/move] by \
                uid[‪6493203‬].
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
	at com.mitu.game.dispatcher.SimpleDispatcher$EventRunnable.doWebSocketMessage(SimpleDispatcher.java:187)
  at com.mitu.game.dispatcher.SimpleDispatcher$EventRunnable.run(SimpleDispatcher.java:106)
  at com.mitu.game.wrapper.ThreadPoolTaskExecutorEx$SafeRunnable.run(ThreadPoolTaskExecutorEx.java:74)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
2020-06-09 16:54:32,405 INFO [nioEventLoopGroup-3-4] [SimpleLoggingHandler.java:35] \
IN {uid=‪5589867‬, forward=183.200.25.192,&nbsp;183.200.25.192:24172, \
type=websocket, uri=/ws/user/bind, ts=‪1591692869‬} /10.0.0.70:34948&nbsp;10



And the code is like:
&nbsp; &nbsp; private void doWebSocketMessage(Event event) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String uri = "some uri";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String uid = "some id";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Object ret = \
action.method.invoke(action.instance, event.getData(), new Object[]{event}); &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (Exception ex) { &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logger.error(String.format("Exception occurred \
during dispatch web socket frame for uri[%s] by uid[%s].", uri, uid), ex); &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; }



I tried to look for answers by google and bing, but failed, and I tried to reproduce \
                this problem, failed too, the cause can be printed, and it likes:
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
	at com.mitu.game.Application.main(Application.java:54)
Caused by: java.lang.NullPointerException: null
	at com.mitu.game.Application$T.f(Application.java:42)
	... 5 common frames omitted&nbsp;


the difference is NativeMethodAccessorImpl vs GeneratedMethodAccessor100, is it \
matter? I steped into the logback code, maybe the target of the exception is null, \
but I do not know the reason:(




Thank you again, for your patient, and sorry for my poor english:(

BR,Mike Yu

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


[Attachment #5 (text/html)]

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><div>Hi \
Jörn,</div><div>Thank you a lot a lot :) :) I will try it:)</div><div><hr \
align="left" style="margin: 0 0 10px 0;border: 0;border-bottom:1px solid \
#E4E5E6;height:0;line-height:0;font-size:0;padding: 20px 0 0 0;width: 50px;"><div \
style="font-size:14px;font-family:Verdana;color:#000;"><div><span style="line-height: \
1.5;">BR,</span></div><div>Mike(Yu, \
Chong-Chao)</div></div></div><div>&nbsp;</div><div><div><br></div><div><br></div><div \
style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px \
0;">------------------&nbsp;原始邮件&nbsp;------------------</div><div \
style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b>&nbsp;"Jörn \
Huxhorn"&lt;jhuxhorn@googlemail.com&gt;;</div><div><b>发送时间:</b>&nbsp;2020年6月14日(星期天) \
晚上10:42</div><div><b>收件人:</b>&nbsp;"logback users \
list"&lt;logback-user@qos.ch&gt;;<wbr></div><div></div><div><b>主题:</b>&nbsp;Re: \
[logback-user] logback does not print exception's cause</div></div><div><br></div> \
<style>body{font-family:Helvetica,Arial;font-size:13px;}</style><div \
style="font-family:Helvetica,Arial;font-size:13px">Hi Mike,</div><div \
style="font-family:Helvetica,Arial;font-size:13px"><br></div><div \
style="font-family:Helvetica,Arial;font-size:13px">sorry for the late answer. I hope \
this still helps you.</div><div \
style="font-family:Helvetica,Arial;font-size:13px"><br></div><div \
style="font-family:Helvetica,Arial;font-size:13px">This stackoverflow answer solves \
your problem:</div><div style="font-family:Helvetica,Arial;font-size:13px"><a \
href="https://stackoverflow.com/questions/2411487/nullpointerexception-in-java-with-no \
-stacktrace#3010106">https://stackoverflow.com/questions/2411487/nullpointerexception-in-java-with-no-stacktrace#3010106</a></div><div \
style="font-family:Helvetica,Arial;font-size:13px"><br></div><div \
style="font-family:Helvetica,Arial;font-size:13px">TL;DR:</div><div \
style="font-family:Helvetica,Arial;font-size:13px">You are running into a hotspot \
optimisation and need to add&nbsp;-XX:-OmitStackTraceInFastThrow to your JVM options \
to "enable" those stacktraces.</div> <div><br></div>Cheers,<div>Jörn.<br> <div \
class="gmail_signature"></div> <br><p class="airmail_on">On 10. June 2020 at \
04:52:38, 陌路人 (<a href="mailto:h5ru@qq.com">h5ru@qq.com</a>) wrote:</p> \
<blockquote type="cite" class="clean_bq"><span><div><div></div><div><div \
dir="auto"><div style="font-family:sans-serif;font-size:13px;white-space:normal">Hi,</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">Firstly thank you \
for your time.</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">Sometimes, \
logback&nbsp;does not print exception's cause, I can't use the log to fix bug, as \
followings:</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><div>2020-06-09 \
16:54:32,393 ERROR [task-executor-27] [SimpleDispatcher.java:203] Exception occurred \
during dispatch web socket frame for uri[/ws/partydungeon/move] by \
uid[‪6493203‬].</div><div>java.lang.reflect.InvocationTargetException: \
null</div><div><span style="white-space:pre;line-height:1.5">	</span>at \
sun.reflect.<b><font \
color="#ff6600">GeneratedMethodAccessor100</font></b>.invoke(Unknown \
Source)</div><div><span style="white-space:pre;line-height:1.5">	</span>at \
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
java.lang.reflect.Method.invoke(Method.java:498)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
com.mitu.game.dispatcher.SimpleDispatcher$EventRunnable.doWebSocketMessage(SimpleDispatcher.java:187)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
com.mitu.game.dispatcher.SimpleDispatcher$EventRunnable.run(SimpleDispatcher.java:106)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
com.mitu.game.wrapper.ThreadPoolTaskExecutorEx$SafeRunnable.run(ThreadPoolTaskExecutorEx.java:74)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)</div><div><span \
style="white-space:pre;line-height:1.5">	</span>at \
java.lang.Thread.run(Thread.java:748)</div><div>Caused by: \
java.lang.NullPointerException: null</div><div>2020-06-09 16:54:32,405 INFO \
[nioEventLoopGroup-3-4] [SimpleLoggingHandler.java:35] IN {uid=‪5589867‬, \
forward=<a href="https://183.200.25.192/">183.200.25.192</a>,&nbsp;<a \
href="https://183.200.25.192:24172/">183.200.25.192:24172</a>, type=websocket, \
uri=/ws/user/bind, ts=‪1591692869‬} /<a \
href="https://10.0.0.70:34948/">10.0.0.70:34948</a>&nbsp;10</div></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">And the code is \
like:</div><div style="font-family:sans-serif;font-size:13px;white-space:normal"><div>&nbsp; \
&nbsp; private void doWebSocketMessage(Event event) {</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; String uri = "some uri";</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; String uid = "some id";</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; try {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Object \
ret = action.method.invoke(<a href="https://action.in/">action.in</a>stance, \
event.getData(), new Object[]{event});</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; } catch (Exception ex) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; logger.error(String.format("Exception occurred during dispatch web \
socket frame for uri[%s] by uid[%s].", uri, uid), ex);</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">I tried to look for \
answers by google and bing, but failed, and I tried to reproduce this problem, failed \
too, the cause can be printed, and it likes:</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">java.lang.reflect.InvocationTargetException: \
null</div><div style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at sun.reflect.<font \
color="#ff6600"><b>NativeMethodAccessorImpl</b></font>.invoke0(Native \
Method)</div><div style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at \
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at \
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at \
java.lang.reflect.Method.invoke(Method.java:498)</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at \
com.mitu.game.Application.main(Application.java:54)</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">Caused by: \
java.lang.NullPointerException: null</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>at \
com.mitu.game.Application$T.f(Application.java:42)</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><span \
style="white-space:pre;line-height:1.5">	</span>... 5 common frames \
omitted&nbsp;</div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">the difference is \
NativeMethodAccessorImpl vs GeneratedMethodAccessor100, is it matter? I steped into \
the logback code, maybe the target of the exception is null, but I do not know the \
reason:(</div><div style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal"><br></div><div \
style="font-family:sans-serif;font-size:13px;white-space:normal">Thank you again, for \
your patient, and sorry for my poor english:(</div><br>BR,<div>Mike \
Yu</div></div>_______________________________________________<br>logback-user mailing \
list<br><a href="mailto:logback-user@qos.ch">logback-user@qos.ch</a><br><a \
href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></div></div></span></blockquote></div></div>



[Attachment #6 (text/plain)]

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

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

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