Spring’s cache in Alfresco - spring

I am trying to use the spring's cache in Alfresco, but when I start tomcat I get the following exception:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 14 in XML document from class path resource [alfresco/module/PolmanProject-alfresco-repo/context/service-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 8; cvc-elt.1.a: Cannot find the declaration of element 'beans'.
I have the following module-context:
?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
...
<cache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
<property name="caches">
<set>
<bean
class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"
name="cacheService" />
</set>
</property>
</bean>
</beans>
If I remove and the bean cacheManager, then, I don't get the exception.
What is wrong in my context?

You should comment the line
<!-- <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> -->
and replace the tag with
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
And that will solve your issue. However, it's neccesary take into account another details to use the cache. This post explains how to use the cache step by step

Related

Apache Camel invalid namespace handler

I have an application that has been developed (reworked) on Eclipse. It works fine in the development environment. However when it is loaded into Tomcat it fails with a namespace exception:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [camel-config.xml]
Offending resource: class path resource [spring-config.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [camel-config.xml]; nested exception is
org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested excep
tion is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
my spring-config and camel-config are below
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">
<context:component-scan base-package="foo.bar.agent" />
<task:annotation-driven />
<import resource="camel-config.xml" />
</beans>
camel-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- enable Spring #Component scan -->
<context:component-scan base-package="com.altegix.agent.hl7" />
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
<property name="ignoreMissingLocation" value="true" />
<property name="locations">
<list>
<value>classpath:default.properties</value>
<value>file:/opt/altegix/agent/application.properties</value>
</list>
</property>
</bean>
<bean id="myhl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1" />
<property name="validate" value="false" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring"
id="resultsCamelContext">
<contextScan />
<camel:endpoint id="hl7listener"
uri="mina2:tcp://{{results.endpoint.server}}:{{results.endpoint.port}}?sync=true&codec=#myhl7codec" />
</camelContext>
<context:annotation-config />
<bean class="com.altegix.agent.hl7.HL7ListenerConfiguration" />
I don't understand why I would be getting a InvalidNamespace Exception? There is also the noClassDefFoundError which I have not seen before - maybe am I missing some classes that are in Eclipse?

Am facing the issue while running the application in xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-mongodb="http://www.springframework.org/schema/integration/mongodb"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/mongodb
http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
<bean id="messageDestination" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="messageQueue1" />
</bean>
<!-- spring integration beans -->
<int:channel id="jmsMessages">
<int:queue capacity="1000" />
</int:channel>
<jms:inbound-channel-adapter id="jmsMsgAdapter"
connection-factory="connectionFactory" destination="messageDestination"
channel="jmsMessages">
<int:poller fixed-rate="500" />
</jms:inbound-channel-adapter>
<mongo:db-factory id="mongoDbFactory" dbname="DeviceTrack"
port="27017" host="localhost" />
<int-mongodb:outbound-channel-adapter
channel="jmsMessages" collection-name="jmsMessage" mongodb-factory="mongoDbFactory" />
</beans>
Error :
Caused by: groovy.lang.MissingMethodException: No signature of method: static ajsc.util.AjscLogMessageService.formatExceptionDetails() is applicable for argument types: (org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException) values: [org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 30 in XML document from URL [file:D:/LucyWorkspace/ExistingDeviceFlow/target/swm/package/nix/dist_files/appl/ExistingDeviceFlow/conf/YOUR_SERVICE/v1/appMessageContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 32; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int:channel'.]
at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1500)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1486)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.callStatic(StaticMetaClassSite.java:65)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:206)
at ajsc.util.AjscLogMessageService.logMessage(AjscLogMessageService.groovy:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
enter code here
when I used without spring integration every thing worked well. When am integrating with Spring I am not able build the xml properly. I think I have done
some xml parsing problems because of some missing xsd.
Can any one help me to resolve the issue...
no declaration can be found for element 'int:channel'
It generally means you don't have the spring-integration-core jar on your classpath; the xsd in in that jar (mapped by /META-INF/spring.schemas).

Could not convert constructor argument value of type [java.util.ArrayList] to required type [java.util.List]

I have a spring xml file like this named "request-details-upload.xml"
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
">
<import resource="classpath:META-INF/jobs/environment.xml" />
<import resource="classpath:META-INF/jobs/clients.xml" />
<import resource="classpath:META-INF/jobs/edx/request-details.xml" />
<import resource="classpath:META-INF/jobs/dynamoDbClients.xml" />
<bean id="requestDetailsFetchAndDecryptDataDao" class="com.amazon.edx.dao.FetchAndDecryptDataDaoDynamoDbImpl"
c:dataUploadDao-ref="requestDetailsDataUploadDao"
c:dataTransformer-ref="requestDetailsDataTransformer"
/>
<util:list id="requestDetailsKeyItemAttributesMetadata" value-type="com.amazon.edx.manager.ItemAttributesMetaData">
<ref bean="RequestId"/>
<ref bean="RequestDate"/>
</util:list>
<util:list id="requestDetailsNonKeyItemAttributesMetadata" value-type="com.amazon.edx.manager.ItemAttributesMetaData">
<ref bean="CreatedBy"/>
<ref bean="UpdatedTime"/>
</util:list>
<bean id="RequestId" class="com.amazon.edx.manager.ItemAttributesMetaData"
c:itemAttributeName="RequestId"
/>
<bean id="RequestDate" class="com.amazon.edx.manager.ItemAttributesMetaData"
c:itemAttributeName="RequestDate"
/>
<bean id="CreatedBy" class="com.amazon.edx.manager.ItemAttributesMetaData"
c:itemAttributeName="CreatedBy"
/>
<bean id="UpdatedTime" class="com.amazon.edx.manager.ItemAttributesMetaData"
c:itemAttributeName="UpdatedTime"
/>
<!-- upload manager -->
<bean id = "requestDetailsDataUploadManager" class ="com.amazon.edx.manager.DataUploadManagerImpl"
c:fetchAndDecryptDataDao-ref="requestDetailsFetchAndDecryptDataDao"
c:keyAttributes-ref="requestDetailsKeyItemAttributesMetadata"
c:nonKeyAttributes-ref="requestDetailsNonKeyItemAttributesMetadata"
/>
<bean id = "requestDetailsUploadToEdx" class = "com.amazon.edx.UploadDataToEdx"
c:dataUploadManager-ref ="requestDetailsDataUploadManager"
/>
</beans>
and another xml named request-details.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
">
<bean id="requestDetailsDataUploadDao" class="com.amazon.edx.dao.DataUploadClientImpl"
c:someName="xxxxxxxxxx"
c:otherName="yyyyyyyyy"
/>
<util:list id="requestDetailsColumnMetaData" value-type="com.amazon.edx.transformer.ColumnMetaData">
<ref bean="RequestId"/>
<ref bean="RequestDate"/>
<ref bean="CreatedBy"/>
<ref bean="UpdatedTime"/>
</util:list>
<bean id="RequestId" class="com.amazon.edx.transformer.ColumnMetaData"
c:attributeName="RequestId"
c:dataType="VARCHAR2"
c:columnDisplayName="REQUEST_ID"
/>
<bean id="RequestDate" class="com.amazon.edx.transformer.ColumnMetaData"
c:attributeName="RequestDate"
c:dataType="VARCHAR2"
c:columnDisplayName="REQUEST_DATE"
/>
<bean id="CreatedBy" class="com.amazon.edx.transformer.ColumnMetaData"
c:attributeName="CreatedBy"
c:dataType="VARCHAR2"
c:columnDisplayName="CREATED_BY"
/>
<bean id="UpdatedTime" class="com.amazon.edx.transformer.ColumnMetaData"
c:attributeName="UpdatedTime"
c:dataType="NUMBER"
c:columnDisplayName="UPDATED_TIME"
/>
<bean id="requestDetailsDataTransformer" class="com.amazon.edx.transformer.DataTransformerImpl"
c:dataFlattener-ref="requestDetailsDataFlattener"
c:columnMetadata-ref="requestDetailsColumnMetaData"
c:delimiter="{tabDelimiter}"
/>
<util:constant id="tabDelimiter"
static-field="com.amazon.edx.transformer.Delimiters.TAB_DELIMITER" />
<bean id="requestDetailsDataFlattener" class="com.amazon.edx.flattener.JsonDataFlattenerImpl"
c:multipleRowColumnName=""
/>
</beans>
I am getting the following error:
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requestDetailsDataTransformer' defined in class path resource [META-INF/jobs/edx/request-details.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [java.util.List]: Could not convert constructor argument value of type [java.util.ArrayList] to required type [java.util.List]: Failed to convert value of type 'java.util.ArrayList' to required type 'java.util.List'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.amazon.edx.manager.ItemAttributesMetaData] to required type [com.amazon.edx.transformer.ColumnMetaData]: no matching editors or conversion strategy found
It says cannot convert from java.util.ArrayList to java.util.List. I am not even using java.util.ArrayList. I am new to Spring and not able to understand the exact cause of this error.
Any help is appreciated.
Thanks
Ahh...figured out the issue. There is a conflict in the bean ids present in the lists in both the files. Bean id's should be unique even if they are in different .xml files. There would be a conflict when we import one file into other.
If you use List type dependency, since it is a interface, spring container create an object of its implementation class ArrayList.
For Set type dependency, spring container creates an object of its implementation class LinkedHashSet.
For Map type dependency, spring container creates an object of its implementation class LinkedHashMap.
For Properties type dependency, since it is a class, spring container creates an object of class Properties only.

SAXParseException After Upgraded to Spring 4.1.1

Below is the error I am getting after upgrade to spring.
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 20 in XML document from class path resource [dataStoreContext.xml] is invalid; nested exception is
org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'local' is not allowed to appear in element 'ref'.
The Hibernate version I am using is 3.0
Below is my context xml using
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>cdqiDS</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingResources">
</property>
Edit 1: After changing the local as bean i am getting the below error
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path
resource [dataStoreContext.xml]:
Initialization of bean failed; nested exception is
java.lang.NoClassDefFoundError: org/springframework/jdbc/support/lob/LobHandler
Add the org.springframework.jdbc.jar to your classpath.

Grave: Context initialization failed

I am creating a HelloWorld web/spring application from scratch. I have followed this tutorial in order to learn how to use the mvc pattern. So, after finished all steps and starts to run the application I received this error in console:
Grave: Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 11 in XML document from ServletContext resource
[/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is
org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 100;
cvc-complex-type.2.4.c
Searching around SO question I found some threat like below but have not resolved my error.
Cannot find the declaration of element 'beans' in internet offline mode
Spring Security beginner's question. Build failed
So, I deduced that could be the dispatcher-servlet.xml at WEB-INF folder. This xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref local="localeChangeInterceptor" />
</list>
</property>
<property name="urlMap">
<map>
<entry key="/hello.html">
<ref bean="helloController" />
</entry>
</map>
</property>
</bean>
<bean id="helloController" class="controllers.HelloController">
</bean>
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="hl" />
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
</bean>
</beans>
Finally these are my included jars:
commons-logging-1.1.1.jar
org.springframework.aop-3.1.2.RELEASE.jar
org.springframework.asm-3.1.2.RELEASE.jar
org.springframework.aspects-3.1.2.RELEASE.jar
org.springframework.beans-3.1.2.RELEASE.jar
org.springframework.context-3.1.2.RELEASE.jar
org.springframework.context.support-3.1.2.RELEASE.jar
org.springframework.core-3.1.2.RELEASE.jar
org.springframework.expression-3.1.2.RELEASE.jar
org.springframework.instrument-3.1.2.RELEASE.jar
org.springframework.instrument.tomcat-3.1.2.RELEASE.jar
org.springframework.jdbc-3.1.2.RELEASE.jar
org.springframework.jms-3.1.2.RELEASE.jar
org.springframework.orm-3.1.2.RELEASE.jar
org.springframework.oxm-3.1.2.RELEASE.jar
org.springframework.spring-library-3.1.2.RELEASE.libd
org.springframework.test-3.1.2.RELEASE.jar
org.springframework.transaction-3.1.2.RELEASE.jar
org.springframework.web-3.1.2.RELEASE.jar
org.springframework.web.portlet-3.1.2.RELEASE.jar
org.springframework.web.servlet-3.1.2.RELEASE.jar
org.springframework.web.struts-3.1.2.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
Thanks in advance
EDIT 1:
After make the changes of #Biju Kunjummen, looks like now the problem is that there is a comflic in bean declaration:
Grave: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean 'helloController' while setting bean property 'urlMap' with key [TypedStringValue: value [/hello.html], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloController' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [controllers.HelloController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
String cannot be resolved to a type
I have checked the controller and looks fine into src/controllers dir:
package controllers;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HelloController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String Mess = "Hello World!";
ModelAndView modelAndView = new ModelAndView("hello");
modelAndView.addObject("message", Mess);
return modelAndView;
}
}
You have the http://www.springframework.org/schema/mvc as the default, but your bean definitions belong to the http://www.springframework.org/schema/beans namespace, that should be the issue.
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
...">
<beans:bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix">
<beans:value>/WEB-INF/jsp/</beans:value>
</beans:property>
.....
Or make beans namespace the default this way:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>

Resources