Spring Boot doesn\'t work with Google App Engine (at least not for me).
However much of the examples written or available in the GitHub or other repositorie
This is happening because you haven't created the bean of UserRepository in context. There are a number of ways you can do this since you're not using a spring boot project so it won't make an object in the container at startup due to which @Autowired is not injecting the object in the UserRepository class. For this project, you can update the following in your project:
package com.demo.svc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.demo.data.User;
import com.demo.data.UserRepository;
@Service
public class UserServiceImpl implements UserService {
UserRepository userRepository;
public User findUserById(Integer id) {
return userRepository.findOne(id);
}
public UserRepository setRepo(UserRepository repo)
{
userRepository=repo;
}
}
Also, you'll need to inject the object from the container. In src/main/webapp/WEB-INF/spring/context.xml
Hope it helps