null exception while running app on GAE

Hie

I am trying to run my app on GAE and getting below exception at the point when i try to do pm = PMF.get().getPersistenceManager(); at line 72 as mentioned in stack trace. Any idea what i m missing here?

java.lang.NullPointerException
at vik.sakshum.sakshumweb.server.model.DoSubscribe.execute(DoSubscribe.java:72)
at vik.sakshum.sakshumweb.server.SubscribeModule$1$2.buttonClick(SubscribeModule.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:487)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:158)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:980)
at com.vaadin.ui.Button.fireClick(Button.java:349)
at com.vaadin.ui.Button.changeVariables(Button.java:185)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleVariables(CommunicationManager.java:751)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:300)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:432)
at com.vaadin.terminal.gwt.server.GAEApplicationServlet.service(GAEApplicationServlet.java:231)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:54)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:342)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

Are you sure you have initialized the the static PMF as per GAE documentation? Either PMF or the factory returned by PMF.get() is null, find out which.

Manish, this thread is about GAE. Please post unrelated questions as separate threads.

But to answer your question - it is not possible to have two accordion “tabs” open at the same time.

You might want to take a look at
http://vaadin.com/forum/-/message_boards/message/83908

Well I debuged and PMF.get is returning null. Below is the code in PMF

package vik.sakshum.sakshumweb.server.model.jdo;

import java.util.logging.Logger;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {
private static final PersistenceManagerFactory pmfInst =
JDOHelper.getPersistenceManagerFactory(“transactions-optional”);

    private static final Logger log = Logger.getLogger(PMF.class.getName());
        
    static {
    	log.info("Loading PMF in " + PMF.class.getClassLoader());
		}
    
    private PMF() {}

    public static PersistenceManagerFactory get() {
    	return pmfInst;
    }

}

That PMF works for me, I call PMF.get() in application Init() and it returns a valid PersistenceManagerFactory.

What do you have in your jdoconfig.xml? Mine is

<?xml version="1.0" encoding="utf-8"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

    <persistence-manager-factory name="transactions-optional">
        <property name="javax.jdo.PersistenceManagerFactoryClass"
            value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
        <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
        <property name="javax.jdo.option.NontransactionalRead" value="true"/>
        <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
        <property name="javax.jdo.option.RetainValues" value="true"/>
        <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
    </persistence-manager-factory>
</jdoconfig>

Also note that jdoconfig.xml should be in src/META-INF/ directory. See
this working GAE JDO with Vaadin example
.

If you still can’t get it working further questions should go to the GAE forums as this is most likely a GAE configuration issue.

I do not have any jdoconfig.xml in my app so should i create one in the src/META_INF folder copying your code?