blad w spring.xml, gdzie?

0

Wyskakuje mi błąd w lini 12 nie wiem dla czego?

<beans:bean 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"
       xmls.xsi="http://www.springframework.org/schema/util"
       xmls.xsi="http://www.springframework.org/schema/p"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                            http://www.springframework.org/schema/mvc
                            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context-4.0.xsd">


    <context:component-scan base-package="xxx.aaa.xxx" />
      
        
        
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/view/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
       
       
    <bean id="propertyConfigurer"
             class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
             p:location="/WEB-INF/jdbc.properties" />

    
    <bean id="dataSuorce"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
        <property name="driveClassName"
        value="$jdbc.driveClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="jdbc.username"/>
        <property name="password" value="jdbc.password"/>
    </bean>
        
        <util:properties id="hibernateProperties">
            <prop key="hibernate.dialect">
                org.hibernate.dialect.MySQL5InnoDBDialect
            </prop>
            <prop key="hibernate.show_sql">false</prop>
        </util:properties>  
        
        <bean id="sesionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
        p:dataSource-ref="dataSource"
        p:packagesToScan="com.xxx.aaa"
        p:hibernateProperties-ref="hibernateProperties"/>
        
        <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager"
        p:sessionFactory-ref="sessionFactory"/>
        
       
        <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
                <property name="basename" value="/WEB-INF/messages"/>
                <property name="defaultEncoding" value="UTF-8" />
        </bean>
        
        
          <mvc:default-servlet-handler/>
        <mvc:annotation-driven>
            <mvc:message-converters register-defaults="false">
                <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                    <property name="supportedMediaTypes" value="application/json" />
                </bean>
            </mvc:message-converters>
        </mvc:annotation-driven>
         
        
           
</beans:bean>
0

A JAKI błąd? Moim zdaniem to powinno wyglądać tak:

<beans 
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xmlns:util="http://www.springframework.org/schema/util"

xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                            http://www.springframework.org/schema/mvc
                            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context-4.0.xsd"
                            http://www.springframework.org/schema/util
                            http://www.springframework.org/schema/util/spring-util-4.0.xsd
>

To p: nie wiem skąd wziąłeś. Zrób tak:

        <bean id="sesionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
          <property name="dataSource" ref="dataSource"/>
          <property name="packagesToScan" value="com.xxx.aaa"/>
          <property name="hibernateProperties" ref="hibernateProperties"/>
        </bean>
 
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
          <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
0

bład xmlbeandefinitionstoreexception . Czy " nie pwinien być przed >?

0

cały błąd
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from ServletContext resource [/WEB-INF/yodo-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 94; The prefix "beans" for element "beans:bean" is not bound.
Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 94; The prefix "beans" for element "beans:bean" is not bound.

0

:D bo pierwsza linijka powinna być taka:

<beans xmlns="http://www.springframework.org/schema/beans"

bo to przecież nie definicja beana tylko namespace...

0

Nadal wywala błąd :(

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                            http://www.springframework.org/schema/mvc
                            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context-4.0.xsd
                            http://www.springframework.org/schema/util
                            http://www.springframework.org/schema/util/spring-util-4.0.xsd">


    <context:component-scan base-package="com.senfino.yodo" />
      
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/view/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
       
       
    <bean id="propertyConfigurer"
             class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
         <property name="location">
              <value>"/WEB-INF/jdbc.properties"</value>
        </property>
    </bean>

    
    <bean id="dataSuorce"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
        <property name="driveClassName"
        value="$jdbc.driveClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="jdbc.username"/>
        <property name="password" value="jdbc.password"/>
    </bean>
        
        <util:properties id="hibernateProperties">
            <prop key="hibernate.dialect">
                org.hibernate.dialect.MySQL5InnoDBDialect
            </prop>
            <prop key="hibernate.show_sql">false</prop>
        </util:properties>  
        
        <bean id="sesionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
          <property name="dataSource" ref="dataSource"/>
          <property name="packagesToScan" value="com.senfino.yodo"/>
          <property name="hibernateProperties" ref="hibernateProperties"/>
        </bean>
 
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
          <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        
       
        <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
                <property name="basename" value="/WEB-INF/messages"/>
                <property name="defaultEncoding" value="UTF-8" />
        </bean>
        
        
        <mvc:default-servlet-handler/>
        <mvc:annotation-driven>
            <mvc:message-converters register-defaults="false">
                <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                    <property name="supportedMediaTypes" value="application/json" />
                </bean>
            </mvc:message-converters>
        </mvc:annotation-driven>
         
        
           
</beans>

W google nic nie znalazlem

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/yodo-servlet.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findMethod(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Method;
Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findMethod(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Method;
0

Kończe udzielać się w twoim temacie skoro nie potrafisz w żadnym swoim poście podać konkretów. GDZIE ten błąd ci wyświetla?

0

Podałem kod zawartosc xml i blad jaki sie wyswietla. A nic wiecej nie wiem nie wiem ktora linia itp

ok juz mam

0
<bean id="dataSuorce"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
    <property name="driveClassName"
              value="$jdbc.driveClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="jdbc.username"/>
    <property name="password" value="jdbc.password"/>
</bean>

A czy tu czasem nie powinno być:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driveClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
</bean>

IDE Ci nie podpowiada takich rzeczy? Jakbyś używał IntelliJ IDEA, pewnie nie miałbyś takich problemów... Poza tym naliczyłem chyba z 5 błędów w tym jednym kawałku kodu.

1 użytkowników online, w tym zalogowanych: 0, gości: 1