Vaadin7 with Grails

Hi,

I am using vaadin 7 with grails and using domin class with service. when i call service i get error :-

java.lang.NullPointerException
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
    at org.codehaus.groovy.grails.orm.support.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:85)
    at com.xfuel.web.services.PeopleService.checkLogin(PeopleService.groovy)
    at com.xfuel.web.services.PeopleService$checkLogin.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    at test.Test$2.buttonClick(Test.groovy:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
    at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:984)
    at com.vaadin.ui.Button.fireClick(Button.java:393)
    at com.vaadin.ui.Button$1.click(Button.java:57)

below in the code i am trying

package test

import com.vaadin.event.ShortcutListener;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.PasswordField;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.xfuel.web.services.PeopleService;

class Test  extends UI {

    public Test() {
        // TODO Auto-generated constructor stub
    }
    @Override
    protected void init(VaadinRequest request) {
        
        HorizontalLayout fields = new HorizontalLayout();
        fields.setSpacing(true);
        fields.setMargin(true);
        fields.addStyleName("fields");
        
        final TextField username = new TextField("Username");
        username.focus();
        fields.addComponent(username);

        final PasswordField password = new PasswordField("Password");
        fields.addComponent(password);

        final Button signin = new Button("Sign In");
        signin.addStyleName("default");
        fields.addComponent(signin);
        fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);

        final ShortcutListener enter = new ShortcutListener("Sign In",
                KeyCode.ENTER, null) {
            @Override
            public void handleAction(Object sender, Object target) {
                signin.click();
            }
        };

        signin.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (username.getValue() != null
                        && username.getValue().equals("")
                        && password.getValue() != null
                        && password.getValue().equals("")) {
                    signin.removeShortcutListener(enter);
                    PeopleService p1 = new PeopleService();
                    p1.checkLogin("", "");
                 //   iPeopleService.checkLogin(username.getValue(), password.getValue());
                    buildMainView();
                } else {
                    
                }
            }
        });

        signin.addShortcutListener(enter);
        setContent(fields);
    }
}

service code :-

@Transactional
class PeopleService {

    static transactional = true
    
    def serviceMethod() {

    }
public People checkLogin(String username, String password) {
        def query = People.where{
             peopleID == username &&
             apppassword == password &&
             visible == true
         }
         return people = query.find()
         
    }
}

and Data source :-

development {
        dataSource {
            driverClassName = "com.mysql.jdbc.Driver"
              url = "jdbc:mysql://localhost/sample"
              username = "root"
              password = "root"
              loggingSql = true
        }
    }

is there anything i missed ?

Please help.

Thanks
Anchit

Are you passing null’s to the checkLogin() method?