Getting Error from Gmap Application instance while calling Gmap from Custo

Getting Error from Gmap Application instance while calling Gmap from CustomComponent

public class TestComposite1 extends CustomComponent {


Window mainWindow = new Window(“GoogleMap Test Application”);
VaadinpocApplication poc = new VaadinpocApplication();
//Application app = new Application();
googleMap_2 = new GoogleMap(mainLayout.getWindow().getApplication(), new Point2D.Double(12.039321, 77.871094), 12); // throws error
googleMap_2.setImmediate(false);
googleMap_2.setWidth(“150px”);
googleMap_2.setHeight(“100px”);
googleMap_2.setVisible(false);
googleMap_2.addMarker(new BasicMarker(1L, new Point2D.Double(12.039321, 77.871094), “MyHome”));
mainWindow.addComponent(googleMap_2);
mainLayout.addComponent(mainWindow, “top:40.0px;left:30.0px;”);

}

Error Console :

com.vaadin.event.ListenerMethod$MethodException: Invocation of method buttonClick in com.example.vaadinpoc.VaadinComposite2$1 failed.
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:530)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:318)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.poc.UI.client.TestComposite1.buildMainLayout(TestComposite1.java:332)
at com.poc.UI.client.TestComposite1.(TestComposite1.java:97)
at com.example.vaadinpoc.VaadinComposite2$1.buttonClick(VaadinComposite2.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
… 23 more

Please Some one Help…
What should be the actual parameter or argument to be passed to GoogleMap to get the map on the window