Announcement Announcement Module
Collapse
No announcement yet.
Roo 1.2 maven multi-module project: dependency problem with TX when adding security Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo 1.2 maven multi-module project: dependency problem with TX when adding security

    Hello,

    I'm having a lot of fun with the maven multi-module feature of Spring Roo 1.2

    To summarize: I think Spring transaction 3.1 dependency is missing in the modules' pom.xml files.

    Code:
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-tx</artifactId>
                    <version>${spring.version}</version>
                </dependency>
    Note: spring.version is 3.1 with Roo 1.2.

    You can found it in the parent's pom.xml. But the modules don't have a reference to the parent project.

    A boring explanation, in order to justify a future JIRA ticket if necessary:

    Some context here:

    The application has a CORE module (working: it passes all the tests) and a WEB module (almost working: the selenium tests fail, but it works deployed in the STS's TC server)

    The problem:

    I've set up the security (security setup) and the web application starts with exceptions in the server:

    ...XmlBeanDefinitionReader - Loading XML bean definitions from URL [jar:file:/C:/.../springsource-2.8.0/vfabric-tc-server-developer-2.6.1.RELEASE/base-bio-for-tomcat6-with-IBM61JDK-instance/wtpwebapps/multi-web/WEB-INF/lib/multi-core-0.1.0.BUILD-SNAPSHOT.jar!/META-INF/spring/applicationContext.xml]
    ...DefaultDocumentLoader - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
    ...PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...beans-3.1.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.1.xsd
    ...PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...ntext-3.1.xsd] in classpath: org/springframework/context/config/spring-context-3.1.xsd
    ...PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...-tool-3.1.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-3.1.xsd
    ...XmlBeanDefinitionReader - Ignored XML validation warning
    ...SAXParseException: schema_reference.4: anomalía al leer el documento de esquema 'http://www.springframework.org/schema/tx/spring-tx-3.1.xsd', porque 1) no se ha podido encontrar el documento; 2) no se ha podido leer el documento; 3) el elemento raíz del documento no es <xsd:schema>.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
    After 2 HOURS of researching, I think I've found the problem:

    Using the "Dependecy Hierarchy" when opening the pom.xml in the STS, you can see:
    • Spring-tx 3.1.0.RELEASE is a resolved dependency in the CORE project (via spring-jdbc and spring-orm)
    • Spring-tx 3.0.6.RELEASE is a resolved dependency in the WEB project (via spring-security-web and others)

    That is actually my problem, the jar included in the WEB-INF/lib is not the resolved by the CORE dependency, but the one with the new dependency introduced by the SECURITY setup (3.0.6.RELEASE, that doesn't contain the file spring-tx-3.1.xsd).

    The solution:

    Either add the Spring transaction 3.1 in the module projects or modify the modules to reference the parent.

    Greetings.
    Last edited by jbbarquero; Jan 19th, 2012, 06:04 AM. Reason: More detail
Working...
X