Cannot find the declaration of element 'beans'

后端 未结 10 1635
忘掉有多难
忘掉有多难 2020-11-30 01:59

I have the spring jars of spring-3.2.0.RC1.jar and trying to implement Apache ActiveMQ helloWorld program from tutorial given here. Th

相关标签:
10条回答
  • 2020-11-30 02:32

    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">
    
    0 讨论(0)
  • 2020-11-30 02:33

    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>
    
    0 讨论(0)
  • 2020-11-30 02:33

    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

    0 讨论(0)
  • 2020-11-30 02:37

    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"> 
    
    0 讨论(0)
提交回复
热议问题