the @Resource annotation is included in Java SE 6. If you can't move to Java 6 and have to use Java 5, the annotation can be found in common-annotations.jar
(note that a Java EE 5 app can still run in the Java SE 6 JRE) as per the DB clean up service, if you're using Spring for DI you could probably set up a quartz timer that Spring would manage for you. If you're not using Spring you could probably implement a ServletContextListener (configured in web.xml) to startup on application startup and then use some type of timer in that class. None of it would be specific to struts 2. Brad Cupit Louisiana State University - UIS -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, April 11, 2008 7:25 AM To: Struts Users Mailing List Subject: Scheduled DB clean up service with Struts2 Hello, I now searched a while to get an idea how to implement a DB clean up service with Struts2. The best link I found was the following one: following http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_ejb _3_0_2.php What I dont understand is how to get the session context. As described in the link Im using dependency injection: >>> @Resource Private SessionContext s; <<< but unfortunately that doesnt work. Eclipse says that it doesnt know the @Resource annotation. However, the ejb3-persistence.jar is integrated in the libs. Therefore, the annotation should be well known to Eclipse? What I also dont understand that - even when I got that stuff with that timer working - "who" starts the bean the first time? Do I have to reconfigure something? What happens if I restart the server? Another more general question is: is that the most suitable way to implement the DB clean up service, assuing that further services wont be added in the future (otherwise: scheduler as far from what I've read)? Thanks and best regards Peter --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]