Page 1 of 1

Java library conflict

Posted: 31 Jul 2025, 10:23
by Lucas
I perform server-side authorisation checks via Google accounts. To do this, I use a library from Google https://developers.google.com/api-clien ... t/download
I copy it to the extensions/__lib__ directory.
When the library is running, an error occurs

Code: Select all

java.lang.NoSuchMethodError:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.NoSuchMethodError
Message: 'long com.google.common.io.ByteStreams.exhaust(java.io.InputStream)'
Description: Error handling event: { USER_LOGIN, Params: [LOGIN_IN_DATA, LOGIN_PASSWORD, SESSION, LOGIN_OUT_DATA, LOGIN_NAME, ZONE] } Listener: com.smartfoxserver.v2.entities.managers.SFSExtensionManager@66748676

This happens because the Google library uses guava-31.1-jre.jar, while SmartFoxServer itself uses guava-18.0.jar. In version 20, a new method was added to this library. How can I make the library work?
What I have already done:
1. I looked at previous versions of the Google library, which also had guava > 20.
2. I looked at the new versions of SmartFoxServer. The guava version has not changed there.

Re: Java library conflict

Posted: 31 Jul 2025, 14:28
by Lapo
Hello,
you should be able to replace the guava jar file under SFS2X/lib/ with the latest one. SFS2X has a small dependency on a few classes that haven't been changed in a "hundred" years.

Cheers
p.s. = in SFS3 that dependency will be dropped.

Re: Java library conflict

Posted: 31 Jul 2025, 14:39
by Lucas
Thanks. Can I do this in Overcast?

Re: Java library conflict

Posted: 01 Aug 2025, 06:14
by Lapo
I am sorry no.

Re: Java library conflict

Posted: 01 Aug 2025, 07:07
by Lucas
Lapo wrote:I am sorry no.

How else can the problem be solved?

Re: Java library conflict

Posted: 01 Aug 2025, 07:54
by Lapo
If possible, avoid using the library.
In your case instead of using ByteStream just use the standard InputStream functionality from the JDK.

We'll take a note to update guava to the latest version in a future SFS2X update.
Thanks

Re: Java library conflict

Posted: 01 Aug 2025, 10:55
by Lucas
This library is provided by Google. The option to access the source code, modify it, and compile it is quite laborious.

Re: Java library conflict

Posted: 01 Aug 2025, 18:32
by Lapo
As a workaround we could replace the library on your behalf on your specific Overcast server.
If you plan to deploy more servers you could take a snapshot of the patched instance and use it to deploy more instances.

If you want to proceed, get in touch with us using the support@... email box with a reference to this post and the version of the library required.
Cheers

Re: Java library conflict

Posted: 05 Aug 2025, 13:06
by Lucas
Thanks. I checking it via PHP on another server.