Question

After I updated from GAE-JAVA-SDK-1.5.5 to 1.6.0 and 1.6.1 my app stop functioning properly. it started giving an error on the RPC service.

Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void com.skip.school.client.service.AdminService.addStudent(com.skip.school.shared.Student)' threw an unexpected exception: java.lang.NoClassDefFoundError: Could not initialize class com.skip.school.server.PmfSingleton

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.skip.school.server.PmfSingleton

The whole log can be found here pastebin.

I have a singleton that should be initialized when the user starts there first rpc call. The singleton I use should be correct there are many example found here on stackeroverflow and everywhere on the web.

public final class PmfSingleton {
    private final static PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");

    private PmfSingleton() { }

    public static PersistenceManagerFactory get() {
    return pmfInstance;    
    }
}

I call that class in all my server implementations like so.

PersistenceManager pm = PmfSingleton.get().getPersistenceManager();

this works on sdk 1.5.5 and below but not on sdk 1.6.0 and above, does anyone know what I' doing wrong what i should change if i want to use sdk 1.6.0 and above?

Was it helpful?

Solution

I had this same problem after upgrading to a newer version of AppEngine SDK. It turns out the problem was I had an older version of the appengine-api-1.0-sdk jar hanging around in the deployment folder.

Have a look in the war\WEB-INF\lib folder of your application and see if there are two different versions of appengine-api-1.0-sdk-1.x.y.jar. I fixed it by removing the appengine-api-1.0-sdk-1.5.x file.

OTHER TIPS

I read somewhere else that this problem is related to an out dated version of the datanucelus jars. I've updated to the latest version, v1.6.1 available from the eclipse plugin and I fixed it by deleting all old references to the old jars, leaving behind just these 3:

  • datanucleus-appengine-1.0.10.final.jar
  • datanucleus-core-1.1.5.jar
  • datanucleus-jpa-1.1.5.jar

I hope that works for you!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top