After a bit of self exploration, I found out that I missed something in the applicationContext.xml configuration. Later I corrected it and now this is the error that I face:
This message was edited 2 times. Last update was at by Jothi Shankar Kumar
Oh yes, it worked. I did forget to specify the datasource property. The server startup was without any exceptions. Now I have to check how the declarative transaction would work by forcefully introducing some exceptions during insertion into the table. Will post here if I face any difficulties.
Seems not to work, since setDataSource is final (in the JdbcDaoSupport) and cannot be overridden. I'm anyways wiring it in the applicationContext.xml as you can see it in my post above.
Seems not to work, since setDataSource is final (in the JdbcDaoSupport) and cannot be overridden.
Sorry, the jdbcTemplate is supposed to be instanciated when the DataSource is set. So the xml file is correct.
What puzzles me now is the following line :
Is this IAdminDAO instance retrieved by the Spring container ? If not, that would explain why the jdbcTemplate is not set.
If it's not managed by Spring, the wiring process will not magically happen You should get it from a servlet, not from a JSP. You can retrieve it any way you would for a classic application, via the ApplicationContext.
(It would even be better to autowire the service to the controller, so you wouldn't need that)
I hope you have everything configured properly. Your context file doesn't seem to have a correct name. It should be named [servlet-name]-servlet.xml, where [servlet-name] is the name you have given to the DispatcherServlet. Are you using a tutorial ?
This message was edited 1 time. Last update was at by Christophe Verré
I'm just testing this app set up and all what I'm doing is just calling the AdminServiceImpl implementation in my index.jsp. Is there any additional configuration that I need to do to wire up the service?? I'm using Struts 1.3.10 framework.
Aaaah, ok You're not hiding some information So you are using the ContextLoaderListener. You can now access the context via WebApplicationContextUtils:
Christophe Verré wrote:Aaaah, ok You're not hiding some information So you are using the ContextLoaderListener. You can now access the context via WebApplicationContextUtils:
The "application" is the jsp implicit object?? Am I right?