I am trying to implement the spring transactions following the petclinic2.0.8 sample application. In place of clinic transaction bean i have userServiceImpl which take care of login and other authentication stuff.
I have created the bean in applicationContext.xml and referencing it from DispatherServlet but I am getting the error;
StackTrace
<blockquote>code:<pre name="code" class="core"> Jul 17, 2008 3:57:50 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin\;E:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;H:\Softwares\ant-1.6.5\bin;C:\Program Files\Java\jdk1.6.0\bin;H:\Program Files\Subversion\bin;D:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Python25;C:\Program Files\TortoiseSVN\bin;G:\Program Files\VisualSVN\bin Jul 17, 2008 3:57:50 PM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8081 Jul 17, 2008 3:57:50 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1188 ms Jul 17, 2008 3:57:50 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jul 17, 2008 3:57:50 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.20 Jul 17, 2008 3:57:50 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Jul 17, 2008 3:57:50 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(H:\eclipseProjects\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\WonderSales\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Jul 17, 2008 3:57:51 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(H:\eclipseProjects\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\WonderSales\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2008-07-17 15:57:52,281 INFO [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/wondergas_trunk]] - Initializing Spring FrameworkServlet 'Wondergas' 2008-07-17 15:57:52,281 INFO [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'Wondergas': initialization started 2008-07-17 15:57:52,359 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@56f631: display name [WebApplicationContext for namespace 'Wondergas-servlet']; startup date [Thu Jul 17 15:57:52 BST 2008]; root of context hierarchy 2008-07-17 15:57:52,578 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from ServletContext resource [/WEB-INF/Wondergas-servlet.xml] 2008-07-17 15:57:52,953 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@56f631]: org.springframework.beans.factory.support.DefaultListableBeanFactory@54c4ad 2008-07-17 15:57:53,234 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@54c4ad: defining beans [WondergasController,AdminMenuController,LoginFormController,CreateUserFormController,ViewUsersController,DeleteUserFormController,LoginValidator,CreateUserValidator,UserImpl,ApplicationSecurityManager,messageSource,urlMapping,viewResolver]; root of factory hierarchy 2008-07-17 15:57:53,343 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@54c4ad: defining beans [WondergasController,AdminMenuController,LoginFormController,CreateUserFormController,ViewUsersController,DeleteUserFormController,LoginValidator,CreateUserValidator,UserImpl,ApplicationSecurityManager,messageSource,urlMapping,viewResolver]; root of factory hierarchy 2008-07-17 15:57:53,343 ERROR [org.springframework.web.servlet.DispatcherServlet] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'LoginFormController' defined in ServletContext resource [/WEB-INF/Wondergas-servlet.xml]: Cannot resolve reference to bean 'UserServiceImpl' while setting bean property 'userServiceImpl'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'UserServiceImpl' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
Didn't you ask this in another thread. It seems like a duplicate post, if it is, please refrain from duplicate posting.
One thing I would point out, is I am assuming this is in more than one xml file. But it seems like the userServiceImpl is declared in with more framework stuff than maybe in a seperate xml file with other application specific beans.