I have a maven/spring-mvc application which is a very simple web application which calls mvc controller which calls the webservices to get data and gives data to JSP.
I develop this application on my windows machine on eclipse. The application executes perfectly fine. I also executed "maven clean install" through command prompt and create a war file and deployed manually on tomcat 6 and tomcat 7 on windows and this works perfectly fine too.
Now I move the same war file to linux and it gives this error in catalina.out (tomcat log)
`Caused by: org.springframework.beans.factory.BeanCreationException:
Could not autowire field: com.mondia.entertainment.ws.SecurityServer
com.mondia.common.controller.HomeController.security;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [com.mondia.entertainment.ws.SecurityServer] found for dependency:
expected at least 1 bean which qualifies as autowire candidate for this dependency.
Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}`
My mvc-dispatcher-servlet.xml looks like this: `
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:application.properties" />
</bean>
<!-- enable @Autowired, @Required, @Resource (JSR-250) and other annotations -->
<context:annotation-config />
<context:component-scan base-package="com.mondia.entertainment" />
<context:component-scan base-package="com.mondia.common" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<jaxrs:client id="securityClient"
serviceClass="com.mondia.entertainment.ws.SecurityServer" address="http://localhost:8080/restful-service/security">
<jaxrs:features>
<cxf:logging/>
</jaxrs:features>
</jaxrs:client>`
I even moved the apache-tomcat 7 folder (with the war file) from windows to linux and tried to start up the server and I get the same exception.
- What does this error imply?
- Why does this error not occur on the same instance of tomcat on my windows system?