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

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


    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.

    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 [] in classpath: org/springframework/beans/factory/xml/spring-beans-3.1.xsd
    ...PluggableSchemaResolver - Found XML schema [] in classpath: org/springframework/context/config/spring-context-3.1.xsd
    ...PluggableSchemaResolver - Found XML schema [] 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 '', 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.

    Last edited by jbbarquero; Jan 19th, 2012, 05:04 AM. Reason: More detail