try
{
FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
"database/spring/applicationContext.xml");
UserProvider userProvider = (UserProvider) appContext.getBean("userProvider", UserProvider.class);
userProvider.insertUser(user);
}
catch (Exception e)
{
e.printStackTrace();
}