Skip to main content

Posts

Showing posts from 2010

Using Spring Bean from Servlet

In order to use a Spring bean from Servlet use the following; ServletContext context = getServletContext(); WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context); UserDao userdao = (UserDao) applicationContext.getBean("userDaoBeanName"); I ran into this issue when I tried using getHibernateTemplate() in servlet code. Unless you use the above code to get the bean, you will see a NullPointerException.

OpenSCManager failed - Access is denied. (0x57)

I was trying to install springsource tc developer edition on vista by execting " tcruntime-ctl.bat spring-insight-instance install". I kept getting an error: OpenSCManager failed - Access is denied. (0x57). I was able to resolve it by browsing to start menu, programs, accessories and right clicking command prompt and selecting run as administrator. I then tried running the above command again. That fixed the problem.

setting up daily cron job

create a script in /etc/cron.daily . Do remember that the script should not have any suffix otherwise the cron job will not pick it up. I made a mistake of naming the file mysqlbackup.sh and later discovered that the cron job was not executing this script. I had to rename it to mysqlbackup (no .sh suffix)