This is my system.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:amq="http://activemq.apache.org/schema/core"
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://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<import resource="jetty.xml" />
<import resource="communication.xml" />
<camelContext xmlns="http://camel.apache.org/schema/spring"
id="camel">
<route>
<from uri="file://test.json"/>
<threads>
<bean ref="operationTest" method="test" />
</threads>
</route>
</camelContext>
</beans>
Here is my communication.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"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="operationTest" class="edu.test.Test">
</bean>
</beans>
I have a main of
context = new SpringServerContext(new FileSystemXmlApplicationContext("conf/system.xml"));
Runtime.getRuntime().addShutdownHook(new Thread(group, new Runnable() {
#Override
public void run() {
stop();
}
}, shutdownThreadName));
context.startup();
and the Test class has a method of
public Object test(Object info) {
//prints info
}
Yet when I run, nothing prints. . .
Can we not trigger the from tag by a file?
I am also trying from Active MQ and is not succeding getting an error of
because of No endpoint could be found for: brokerURL, please check your classpath contains the needed Camel component jar.
I used Active MQ for the route and it worked
I have the spring jars of spring-3.2.0.RC1.jar and trying to implement Apache ActiveMQ helloWorld program from tutorial given here. The xml configuration file is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemalocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms.xsd">
<bean class="org.apache.activemq.command.ActiveMQQueue" id="destination">
<constructor-arg value="TEST.Q1"></constructor-arg>
</bean>
<bean class="org.apache.activemq.ActiveMQConnectionFactory" id="connectionFactory"
p:brokerurl="tcp://localhost:8161"></bean>
<bean class="com.jms.helloworld.listner.MessageListenerImpl" id="simpleMessageListener">
<bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
id="jmsContainer">
<property name="connectionFactory" ref="connectionFactory"></property>
<property name="destination" ref="destination"></property>
<property name="messageListener" ref="simpleMessageListener"></property>
</bean>
</bean>
</beans>
main:
public static void main(String[] args) throws JMSException {
System.out.println("LISTNER STARTED");
ApplicationContext context = new FileSystemXmlApplicationContext("src/com/jms/helloworld/config/JMSConfig.xml");
}
**Exception on console**
LISTNER STARTED
log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from file [/home/neal/workspace/ActiveMQListener/src/com/jms/helloworld/config/JMSConfig.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 61; cvc-elt.1: Cannot find the declaration of element 'beans'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
at com.jms.helloworld.test.TestJMSListner.main(TestJMSListner.java:15)
Caused by: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 61; cvc-elt.1: Cannot find the declaration of element 'beans'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:387)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:321)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1920)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:709)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3080)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:899)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
... 14 more
I don't know what is wrong with the beans.So far any suggestion in other question doesn't help. Any help?
Try this, assuming you're on Spring 3.1:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
Replace 3.1 on the last line with whatever major Spring version you use. Meaning: there is no 3.1.1 XSD even though there is a Spring version 3.1.1.
Found it on another thread that solved my problem... was using an internet connection less network.
In that case copy the xsd files from the url and place it next to the beans.xml file and change the xsi:schemaLocation as under:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
spring-beans-3.1.xsd">
Add this code ..It helped me
<?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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
classpath:/org/springframework/context/config/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
classpath:/org/springframework/aop/config/spring-aop-3.0.xsd
">
</beans>
This error of Cannot find the declaration of element 'beans' but for a whole different reason
It turs out my internet connection was not very reliable, so i decided to check first for this url
http://www.springframework.org/schema/context/spring-context-4.0.xsd
Once I saw that the xsd was open succesfully I clean the Eclipse(IDE) project and the error was gone
If you try this steps and still get the error then
check the Spring version so that it matches as mentioned by another answer
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-**[MAYOR.MINOR]**.xsd">
Replace [MAYOR.MINOR] on the last line with whatever major.minor Spring version that you are using
For Spring 4.0
http://www.springframework.org/schema/context/spring-context-4.0.xsd
For Sprint 3.1
http://www.springframework.org/schema/beans
spring-beans-3.1.xsd
All the contexts are available here
http://www.springframework.org/schema/context/
I had this issue and the root cause turned out to be white-space (shown as dots below) after the www.springframework.org/schema/beans reference in xsi:schemaLocation, i.e.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans....
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
I have encountered this same as you.
With my solution as follows:
Reconfig file: Spring Configuration File (no use XSD namespace declaration).
-> with the main purpose of not having tag name( bean, ...)
Create tag with class you want to use.
---HappyCoding---
I resolved this using the following code.
<? 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:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
</Beans>
Try Using this- Spring 4.0. Working
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
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://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
Make sure if all the spring jar file's version in your build path and the version mentioned in the xml file are same.
For me the problem was my file encoding...I used powershell to write the xml file and this was not UTF-8 ...
It seems that spring requires UTF8 because as soon as I changed the encoding (using notepad++) it works again without any errors
Now i Use in my powershellscript the following line to output the xml file in UTF-8:
[IO.File]::WriteAllLines($fname_dataloader_xml_config_file, $dataloader_configfile)
instead of using the redirection operator > to create my file
Note: I didn't put any xml parameters in my beans tag and it works
For me the problem was that spring was not able to download http://www.springframework.org/schema/beans/spring-beans.xsd or http://www.springframework.org/schema/context/spring-context.xsd
However I was able to access those from my browser as it was using my machines proxy. So I just copied the content of the two xsds to files named spring-beans.xsd and spring-context.xsd and replaced the http url with the file names and it worked for me.
Try using this:
xsi:schemaLocation="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">
For Spring 5.1.0.RELEASE, the configuration file format specified in an answer for another question works for me.
This is the copy:
<?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: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://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Bean declaration and other configurations -->
</beans>
Use this to solve your problem:
<context:annotation-config/>
I have xml file to java to configure i can't load this that files in beans javas
main.java:
ApplicationContext appContext = new ClassPathXmlApplicationContext("applicationContext.xml");
PDF2HTMLService service = appContext.getBean(PDF2HTMLService.class);
Error:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - incompatible types: org.springframework.context.support.ClassPathXmlApplicationContext cannot be converted to org.springframework.context.ApplicationContext
at pdf2html.Main.main(Main.java:27)
Java Result: 1
how can i solve this problems...
XML FILE:
<beans xmlns="http://www.springframework.org/schema/beans"
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"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<aop:aspectj-autoproxy />
<context:component-scan base-package="pdf2html" />
</beans>
Very strange. ClassPathXmlApplicationContext implements ApplicationContext. Might be a classpath issue.
The ClassPathXmlApplicationContext is loaded from one jar, but ApplicationContext from another and they aren't compatible by versions.
Check you classpath for duplication of spring-context-[VERSION].jar
I am having a weird issue that I can't seem to track down. I have this working with other servers without a problem, but I can't seem to get this one to work. The closest post that I see to my problem was this post The prefix "context" for element "context:component-scan" is not bound
All others really were just because the prefix was not in the xml file. I am hoping someone might be able to point me in the right direction here.
Spring XML file:
<?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:context="http://www.springframework.org/schema/context"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd">
<context:annotation-config/>
So I have that, but getting this error:
org.xml.sax.SAXParseException: The prefix "context" for element "context:annotation-config" is not bound.
Appreciate any help. Let me know what else I can provide.
Thanks
I was experiencing the same problem until I realized beans tag attribute xmlns:context was missing. Just added the below lines
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
...."
Then rebuilt the project.
It worked well then on.
The following works for me:
test.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:context="http://www.springframework.org/schema/context"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd">
<context:annotation-config/>
</beans>
When I use the following class to run it:
Test.java
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Test {
public static void main(String[] args) throws Exception {
new ClassPathXmlApplicationContext("test.xml");
System.out.println("Finished!");
}
}
Can you please see if this runs for you? You will need the following libraries in the classpath: commons-logging, spring-asm, spring-beans, spring-context, spring-core, and spring-expression.
Please let me know if it worked. If it didn't, please post the full stack-trace. Finally, I used Spring 3.1.1 for the above.
This error comes when you have xmlns:context missing from your spring xml file. So add it. Your beans header should look something like the following -
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd" >
<context:annotation-config />
<context:component-scan base-package="controller" />
</beans>
I encountered the same problem but i was able to solve it by moving
from applicationContext.xml to spring-servlet.xml and adding xmlns:context in the spring-servlet.xml
I am getting below error when running my application on apache tomcat.
HTTP Status 500 - Servlet.init() for servlet spring threw exception
root cause
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 11 in XML document from ServletContext resource [/WEB-INF/spring-servlet.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
My spring-context.xml is this
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cotext="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc">
<mvc:annotation-driven/>
<cotext:component-scan base-package="springmvc"/>
I've tried https://jira.springsource.org/browse/SPR-3372 with no luck.
please help.
Few things looks off to me:
1) You have to remove " http://java.sun.com/xml/ns/javaee" in xmlns attribute. I think this is the main problem here. "xmlns" attribute can't take multiple URIs according to spec:
http://www.w3schools.com/xml/xml_namespaces.asp
2) Some XML libraries don't like the spaces in the beginning of XML file in front of (in particular Eclipse will complain)
3) xsi:schemaLocation value is missing location URI for mvc. It should probably look like this:
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/context/spring-mvc-3.0.xsd">
You can as well remove extra "beans" declaration as previous answer suggests, unless you really want to use "beans" namespace prefix for some reason.
You have repeating entry of xmlns:beans="http://www.springframework.org/schema/beans" in your XML header. Remove one instance of it and try as below:
<beans xmlns="http://www.springframework.org/schema/beans http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cotext="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc">
<mvc:annotation-driven/>
<cotext:component-scan base-package="springmvc"/>