¿Puede la versión del esquema ser diferente del archivo jars?

My lib folder has spring jars of the 4.0.4 release. In the applicationContext.xml I use the 3.0 version of the schema.

For exemple: I have the following jars:

  • frijoles-primavera-4.0.4
  • primavera-contexto-4.0.4
  • spring-core-4.0.4
  • primavera-expresión-4.0.4
  • ramita-web-4.0.4
  • primavera-webmvc-4.0.4

and in the applicationContext.xml I wrote:

<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:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    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
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

Mis preguntas son las siguientes:

Is it possible have different versions between schema and jar?

If yes, what are the consequences?

preguntado el 12 de junio de 14 a las 10:06

Yes, it is. Sometime it throws an error. So try to use same version of jars and in xml use generalised schema not version based. -

1 Respuestas

Try to use this type of schema in xml :

<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:jms="http://www.springframework.org/schema/jms"
       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/jms
                           http://www.springframework.org/schema/jms/spring-jms.xsd">

don't use : context/spring-context-3.0.xsd and like this because when application get bigger to handle all this thing very cumbersome.

and if possible use maven en lugar de jars, just define version once in a property then use that only in pom import of dependency.

Respondido el 12 de junio de 14 a las 10:06

Thank you for the answer. I haven't used maven because I have to respect some specifics. - Café oscuro

okay then fine, I am just telling you. So if you are not using maven then keep versioning of jar in mind. Good luck. - usuario3145373 ツ

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.