Hi
I am using Vaadin TouchKit, Spring Boot . My application is working fine in local system . When I deploy in UAT server , view page is not autowiring service layer .So I tried through controller .That also failed.
Am I missing any configuration ?
Below is the code
@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan
public class HrApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(HrApplication.class, args);
}
My UI
/**
* The UI's "main" class
*/
//@SuppressWarnings("serial")
// Use the TouchKit widget set for the TouchKit UI
@Widgetset("com.geomotion.hr.gwt.TouchKitSamplerWidgetSet")
// Use a custom theme
@Theme("mobiletheme")
// Cache static application files so as the application can be started
// and run even when the network is down.
@CacheManifestEnabled
// Switch to the OfflineMode client UI when the server is unreachable
@OfflineModeEnabled
// Make the server retain UI state whenever the browser reloads the app
@PreserveOnRefresh
@SpringUI(path = TouchKitHRUI.APP_ROOT)
public class TouchKitHRUI extends UI {
private static final long serialVersionUID = -7416079964703904927L;
private static final Logger logger = LogManager.getLogger(TouchKitHRUI.class);
public static final String APP_ROOT = "/hrapp";
// TODO This is currently unused in the sampler
private final TouchKitHRPersistToServerRpc serverRpc = new TouchKitHRPersistToServerRpc() {
@Override
public void persistToServer() {
// TODO this method is called from client side to store offline data
}
};
@Autowired
TimesheetController timesheetController;
....
public static TimesheetController getTimesheetController() {
logger.error("TimesheetController........ with emp:");
return (TimesheetController) ((TouchKitHRUI) getCurrent()).timesheetController;
}
View program
@UIScope
@SpringView()
public class SubmissionView extends NavigationView {
...
try {
employeeList = TouchKitHRUI.getTimesheetController().findAll();
logger.error("employeeList 2"+employeeList);
} catch (Exception e1) {
e1.printStackTrace();
System.out.println( e1.toString()); logger.error("Here is the Error ::"+ e1.toString());
}
I am getting **NullPointerException **at the line
employeeList = TouchKitHRUI.getTimesheetController().findAll();
Controller
@SpringComponent
@ViewScope
@UIScope
@SpringUI
public class TimesheetController implements Serializable{
private static final Logger logger = LogManager.getLogger(TimesheetController.class);
@Autowired
EmployeeService empService;
public List<Employee> findAll() throws Exception {
logger.error("I am inside controller");
return empService.findAll();
}
}
This line is not printing logger.error(“I am inside controller”);
Thanks in advance