question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception trace output from BaseSerializingTranscoder if Objects no more compatible

See original GitHub issue

If a retrieved object from cache is no more “compatible” with the current class in the running application, memcachedClient.get(…) does correctly return null but also prints an exeption trace like:

10:19:48,504 ERROR [net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder] (default task-110) Caught IOException decoding 8002 bytes of data: java.io.InvalidClassException: com.my.package.my.class; local class incompatible: stream classdesc serialVersionUID = 7737855311941045290, local class serialVersionUID = -351616861165941259
	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:616)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1630)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
	at java.util.ArrayList.readObject(ArrayList.java:791)
	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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
	at net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder.deserialize(BaseSerializingTranscoder.java:112)
	at net.rubyeye.xmemcached.transcoders.SerializingTranscoder.decode0(SerializingTranscoder.java:98)
	at net.rubyeye.xmemcached.transcoders.SerializingTranscoder.decode(SerializingTranscoder.java:90)
	at net.rubyeye.xmemcached.XMemcachedClient.fetch0(XMemcachedClient.java:669)
	at net.rubyeye.xmemcached.XMemcachedClient.get0(XMemcachedClient.java:1072)
	at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1030)
	at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1041)
	at net.rubyeye.xmemcached.XMemcachedClient.get(XMemcachedClient.java:1063)
	at xx.xx.CacheService.cacheGet(CacheService.java:1052)

There is no exception thrown to my code so that I could catch it around memcachedClient.get(…). This output comes from the client itself. How can I disable this?

I already have the following in my log4j.xml Configuration:

<Configuration >
    <Properties>
        <Property name="log4j.logger.net.rubyeye.xmemcached">false</Property>
        <Property name="log4j.logger.com.google.code.yanf4j">false</Property>
    </Properties>
...
</Configuration>

Edit: fixed styling.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adrianbadercommented, Sep 25, 2017

With the help of Stackoverflow [https://stackoverflow.com/q/46365134/4106030] I was able to get a solution. The problem was that Wildfly includes implizitely log4j -> so over slf4J, this log4j with its config was taken; therefore, the own config has been ignored.

0reactions
killme2008commented, Sep 22, 2017

Of course i can ,but i think disabling log4j package level logging is a better choice.

2017-09-22 21:57 GMT+08:00 adrianbader notifications@github.com:

Thanks for your tipp. I already placed a question: https://stackoverflow.com/questions/46365134/slf4j-in- library-seems-to-ignore-my-log4j2-configuration

It seems to become hard…

One possibility to solve this is, if you would implement a method on memcachedclient to disable logging at all and depending on this, do no more logging. 😃

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/killme2008/xmemcached/issues/63#issuecomment-331454175, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA3Pm-iYr3Q3xnnQvZTY3NDt7_6ijjyks5sk7zAgaJpZM4PgYxk .

– 庄晓丹 Email: killme2008@gmail.com Site: http://fnil.net

不学习,毋宁死

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to print full stack trace in exception?
I was looking for a simple way to do it and here it is. Some little concern is it is not as much...
Read more >
traceback — Print or retrieve a stack traceback — Python 3.11 ...
Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways: if tb...
Read more >
Stack trace not included in re-thrown exception
When re-throwing an exception, make sure to include the stack trace. Otherwise pertinent debug information is lost. Detector ID.
Read more >
Exception.StackTrace Property (System) - Microsoft Learn
Gets a string representation of the immediate frames on the call stack. ... Use StackTrace to get stack trace information when no exception...
Read more >
Understanding the Python Traceback
Python prints a traceback when an exception is raised in your code. The traceback output can be a bit overwhelming if you're seeing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found