Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dependency Conflicts with EasySQL #1827

Open
5 of 7 tasks
CarmJos opened this issue Dec 23, 2024 · 10 comments
Open
5 of 7 tasks

[BUG] Dependency Conflicts with EasySQL #1827

CarmJos opened this issue Dec 23, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@CarmJos
Copy link
Collaborator

CarmJos commented Dec 23, 2024

Description

I'm the Main Developer of EasySQL, and I have made a series of plugins based on a Core Plugin witch compliled the EasySQL with original path.

And I got this error issues in my plugin's repository, see ArtformGames/UserSuffix#7 .

[19:09:12 INFO]: [UserSuffix] Enabling UserSuffix v1.3.1
[19:09:12 INFO]: [UserSuffix]  _   _             ___       __  __ _
[19:09:12 INFO]: [UserSuffix] | | | |___ ___ _ _/ __|_  _ / _|/ _(_)_ __
[19:09:12 INFO]: [UserSuffix] | |_| (_-</ -_) '_\__ \ || |  _|  _| \ \ /
[19:09:12 INFO]: [UserSuffix]  \___//__/\___|_| |___/\_,_|_| |_| |_/_\_\
[19:09:12 INFO]: [UserSuffix]  UserSuffix v1.3.1
[19:09:12 INFO]: [UserSuffix] UserSuffix 1.3.1 开始启动...
[19:09:12 INFO]: [UserSuffix] Loading plugin configurations...
[19:09:12 INFO]: [UserSuffix] Register handlers...
[19:09:12 ERROR]: Error occurred while enabling UserSuffix v1.3.1 (Is it up to date?)
java.lang.LinkageError: loader constraint violation: when resolving interface method 'boolean cc.carm.lib.easysql.api.SQLTable.create(cc.carm.lib.easysql.api.SQLManager)' the class loader 'UserSuffix-1.3.1.jar' @648f3142 of the current class, com/artformgames/plugin/usersuffix/user/SuffixLoader, and the class loader 'QuickShop-Hikari-6.2.0.7.jar' @3e985be8 for the method's defining class, cc/carm/lib/easysql/api/SQLTable, have different Class objects for the type cc/carm/lib/easysql/api/SQLManager used in the signature (com.artformgames.plugin.usersuffix.user.SuffixLoader is in unnamed module of loader 'UserSuffix-1.3.1.jar' @648f3142, parent loader java.net.URLClassLoader @108c4c35; cc.carm.lib.easysql.api.SQLTable is in unnamed module of loader 'QuickShop-Hikari-6.2.0.7.jar' @3e985be8, parent loader java.net.URLClassLoader @108c4c35)
        at UserSuffix-1.3.1.jar/com.artformgames.plugin.usersuffix.user.SuffixLoader.<init>(SuffixLoader.java:27) ~[UserSuffix-1.3.1.jar:?]
        at UserSuffix-1.3.1.jar/com.artformgames.plugin.usersuffix.Main.initialize(Main.java:38) ~[UserSuffix-1.3.1.jar:?]
        at ArtCore-1.1.1.jar/cc.carm.lib.easyplugin.EasyPlugin.onEnable(EasyPlugin.java:71) ~[ArtCore-1.1.1.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[purpur-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[purpur-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:669) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:618) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:772) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:534) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:363) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1251) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:344) ~[purpur-1.21.3.jar:1.21.3-2358-16ce24a]
        at java.base/java.lang.Thread.run(Unknown Source) ~[?:?]
[19:09:12 INFO]: [UserSuffix] Disabling UserSuffix v1.3.1
[19:09:12 INFO]: [ArtCore] Unregistering all handlers from #UserSuffix ...

It is easy to determine that the conflict is caused by the dependency call. So I checked the QuickShop-Hikari project and found that when it used libby to load and call this dependency, it did not relocate the path.

To avoid other problems, please consider to relocate the EasySQL(and other dependencies if not reloacted) from cc.carm.lib.EasySQL to com.ghostchu.quickshop.shade.easysql.

Steps to reproduce

Using any projects that compiled EasySQL.

Expected Behaviour

To avoid other problems, please consider to relocate the EasySQL(and other dependencies if not reloacted) from cc.carm.lib.EasySQL to com.ghostchu.quickshop.shade.easysql.

Screenshots

No response

/quickshop paste URL

N/A

Additional Context

No response

Checklist

  • I'm running Paper or Spigot, and not a fork
  • I confirm that Paper/Spigot has been updated to the latest build
  • I confirm that QuickShop-Hikari has been updated to the latest stable version released on Modrinth (or the latest CI version)
  • I confirm that I have not read these checkboxes and therefore I just ticked them all.
  • I confirm that I'm using QuickShop-Hikari, not QuickShop-Reremake, and I'm well aware that they're maintained by different people, and that Reremake issues shouldn't be reported here.
  • I confirm that I am running a server that is not a Hybird Server, (e.g. Mohist, Magma, CatServer, Banner, etc.), and I am aware that QuickShop-Hikari may not function properly on a Forge/Fabric hybrid server, and I am running at my own risk on such a server program, and I am aware that the I run such server-side programs at my own risk and know that I will not receive any support or help for this behavior.
  • I am well aware that if the Issue Ticket is not filled out correctly and completely, it will simply be closed without any response or reason.
@YuanYuanOwO YuanYuanOwO added the bug Something isn't working label Dec 23, 2024
@CarmJos
Copy link
Collaborator Author

CarmJos commented Dec 27, 2024

Is there any ideas?

@creatorfromhell
Copy link
Contributor

creatorfromhell commented Dec 27, 2024

Is there any ideas?

It will be moved when imported.

@CarmJos
Copy link
Collaborator Author

CarmJos commented Jan 5, 2025

I have checked the codes, and found that it may need to edit libraries.maven's format or simply declare that all dependencies should be relocated to com.ghostchu.quickshop.shade. if used.

Then, relocate them all in pom.xml.

In libby, using relocate(String pattern, String relocatedPattern) to apply relocations.

@creatorfromhell
Copy link
Contributor

I have checked the codes, and found that it may need to edit libraries.maven's format or simply declare that all dependencies should be relocated to com.ghostchu.quickshop.shade. if used.

Then, relocate them all in pom.xml.

In libby, using relocate(String pattern, String relocatedPattern) to apply relocations.

Yes, that's the plan, this just isn't a high priority issue for me currently.

@CarmJos
Copy link
Collaborator Author

CarmJos commented Jan 5, 2025

Have you decided which method to use?

I may be able to pr for it.

@creatorfromhell
Copy link
Contributor

Have you decided which method to use?

I may be able to pr for it.

Not really, either method would most likely work

@CarmJos CarmJos self-assigned this Jan 5, 2025
@CarmJos
Copy link
Collaborator Author

CarmJos commented Jan 5, 2025

Well, the question is relocating in libby need to bind to specific jar, which means current libraries.maven is hard to configured relocations if not change the format.

So do you mind if I changed libraries.maven to dependencies.yaml for complex dependencies' settings support?

@creatorfromhell
Copy link
Contributor

Well, the question is relocating in libby need to bind to specific jar, which means current libraries.maven is hard to configured relocations if not change the format.

So do you mind if I changed libraries.maven to dependencies.yaml for complex dependencies' settings support?

I don't mind at all.

@CarmJos
Copy link
Collaborator Author

CarmJos commented Jan 5, 2025

example:

from

cc.carm.lib:easysql-hikaricp:[email protected]

to

dependencies:
  - dependency: "cc.carm.lib:easysql-hikaricp:0.4.7"
    vailidate: "cc.carm.lib.easysql.hikari.HikariDataSource"
    relocations:
      - pattern: ""
        shaded: ""

or

dependencies:
  - group: "cc.carm.lib"
    artifact: "easysql-hikaricp"
    version: "0.4.7"
    classifier: "" # if used
    test: "cc.carm.lib.easysql.hikari.HikariDataSource"
    relocations:
      - pattern: ""
        shaded: ""

@creatorfromhell
Copy link
Contributor

example:

from

cc.carm.lib:easysql-hikaricp:[email protected]

to

dependencies:
  - dependency: "cc.carm.lib:easysql-hikaricp:0.4.7"
    vailidate: "cc.carm.lib.easysql.hikari.HikariDataSource"
    relocations:
      - pattern: ""
        shaded: ""

or

dependencies:
  - group: "cc.carm.lib"
    artifact: "easysql-hikaricp"
    version: "0.4.7"
    classifier: "" # if used
    test: "cc.carm.lib.easysql.hikari.HikariDataSource"
    relocations:
      - pattern: ""
        shaded: ""

seems good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants