EBeans parses toString() method as integer

Discussion in 'Plugin Development' started by rcjrrjcr, Apr 3, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    rcjrrjcr

    I've been editing my plugin's storage code to use Bukkit's/CraftBukkit's internal EBeans, and I get this exception when a player logs out:
    Code:
     java.lang.NumberFormatException: For input string: "Jump: jump to aim in world world."
           at java.lang.NumberFormatException.forInputString(Unknown Source)
           at java.lang.Integer.parseInt(Unknown Source)
           at java.lang.Integer.valueOf(Unknown Source)
           at com.avaje.ebeaninternal.server.core.BasicTypeConverter.toInteger(BasicTypeConverter.java:286)
           at com.avaje.ebeaninternal.server.type.ScalarTypeInteger.toBeanType(ScalarTypeInteger.java:68)
           at com.avaje.ebeaninternal.server.type.ScalarTypeInteger.toBeanType(ScalarTypeInteger.java:36)
           at com.avaje.ebeaninternal.server.deploy.id.IdBinderSimple.convertSetId(IdBinderSimple.java:223)
           at com.avaje.ebeaninternal.server.deploy.BeanDescriptor.convertId(BeanDescriptor.java:1729)
           at com.avaje.ebeaninternal.server.persist.DefaultPersister.deleteMany(DefaultPersister.java:494)
           at com.avaje.ebeaninternal.server.core.DefaultServer.delete(DefaultServer.java:1808)
           at com.avaje.ebeaninternal.server.core.DefaultServer.delete(DefaultServer.java:1800)
           at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.storage.StorageEBeans.writePlayerData(StorageEBeans.java:38)
           at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.processLogonLogoff(BuyAbilities.java:775)
           at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.PlayerLoaderSaver.run(BuyAbilitiesPlayerListener.java:87)
           at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:33)
           at java.lang.Thread.run(Unknown Source)
    
    The string "Jump: jump to aim in world world." is from the class' toString() method. I don't want to save this string, but EBeans goes ahead and even attempts to convert it to an integer. Is there anyone who knows how to make EBeans ignore certain methods/fields?
     
  2. Offline

    Mixcoatl

    I'm using the new persistence layer and I'm not seeing this error. Both of the classes I'm persisting have very complicated toString methods and I see no failures for either of them. Have you decorated your toString method with one of the persistence annotations?
     
Thread Status:
Not open for further replies.

Share This Page