Ref to table of other plugin.

Discussion in 'Spigot Plugin Help' started by B1acksheep, Aug 4, 2015.

  1. Hey, I'm trying to implement JPA with the class of an plugin in my dependency.

    Plugin A
    Code (Text):

    APlayer.java
    @[email protected](strategy=GenerationType.AUTO)
    private Long id;
    @Column(unique=true, nullable=false)
    private String uuid;
     
    Plugin B (has a Dependency to A)
    Code (Text):

    Death.java
    @ManyToOne
    @JoinColumn(name = "player")
    private APlayer player;
     
    I have registered in Plugin B both classes as Database
    Code (Text):

    @Overridepublic List<Class<?>> getDatabaseClasses() {
    List<Class<?>> list = new ArrayList<>();
    list.add(Death.class);
    list.add(APlayer.class);
     return list;}
     
    But if i start the server it throws Errors
    Code (Text):

    [02:43:09] [Server thread/INFO]: DataSourcePool [B] autoCommit[false] transIsolation[SERIALIZABLE] min[2] max[20]
    [02:43:09] [Server thread/INFO]: DatabasePlatform name:B platform:mysql
    [02:43:09] [Server thread/INFO]: SubClassFactory parent ClassLoader [org.bukkit.plugin.java.PluginClassLoader]
    [02:43:10] [Server thread/ERROR]: Error creating subclass for [de.example.A.APlayer]
    java.io.IOException: Class not found
        at com.avaje.ebean.enhance.asm.ClassReader.readClass(ClassReader.java:382) ~[spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebean.enhance.asm.ClassReader.<init>(ClassReader.java:359) ~[spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.subclass.SubClassFactory.subclassBytes(SubClassFactory.java:115) ~[spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.subclass.SubClassFactory.create(SubClassFactory.java:83) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.subclass.SubClassManager.createClass(SubClassManager.java:113) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.subclass.SubClassManager.resolve(SubClassManager.java:100) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.checkSubclass(BeanDescriptorManager.java:1522) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.setEntityBeanClass(BeanDescriptorManager.java:1469) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1157) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1077) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:584) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:271) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:143) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:209) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:63) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:78) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.java.JavaPlugin.init(JavaPlugin.java:373) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:128) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at de.example.A.<init>(A.java:40) [A~spigot187+2.jar:?]
        at de.example.B.<init>(B.java:28) [B~spigot187+2.jar:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [?:1.7.0_80]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [?:1.7.0_80]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.7.0_80]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [?:1.7.0_80]
        at java.lang.Class.newInstance(Class.java:383) [?:1.7.0_80]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:291) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:524) [spigot.jar:git-Spigot-6d16e64-3e9b5c9]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_80]
     


    Any Ideas or suggestions?
    Have anybody something like this working?
    (Main Idea is to have One Plugin, with has a ID-UUID Player Table, so other Plugins can use this ID to reference some stuff)