Results 1 to 4 of 4

Thread: Converting from Spring 2.5 to Spring 3.0 issue with AOP Jar file...

  1. #1

    Post Converting from Spring 2.5 to Spring 3.0 issue with AOP Jar file...

    Hi,

    I am updating from Spring 2.5 to Spring 3.0 and I am having issues in only one area, AOP...

    Under Spring 2.5 this area was working fine, without an issue!

    These statements in our XML file:

    Code:
    <?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:util="http://www.springframework.org/schema/util" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    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.xsd 
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd 
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
    Code:
    <aop:config proxy-target-class="false">
            <aop:pointcut id="xxxxDAOUpdatePointcut" expression="execution(* com.sss.ttt.st.db.iBATIS.xxxxDAO.update*(..))" />
            <aop:pointcut id="xxxxDAOInsertPointcut" expression="execution(* com.sss.ttt.st.db.iBATIS.xxxxDAO.insert(..))" />
            <aop:pointcut id="xxxxDAODeletePointcut" expression="execution(* com.sss.ttt.st.db.iBATIS.xxxxDAO.delete*(..))" />
            <aop:pointcut id="yyyDAOUpdatePointcut" expression="execution(* com.sss.ppp.st.db.iBATIS.yyyDAO.update*(..))" />
            <aop:pointcut id="yyyDAOInsertPointcut" expression="execution(* com.sss.ppp.st.db.iBATIS.yyyDAO.insert(..))" />
            <aop:pointcut id="yyyDAODeletePointcut" expression="execution(* com.sss.ppp.st.db.iBATIS.yyyDAO.delete*(..))" />
            <aop:pointcut id="qqqDAODeletePointcut" expression="execution(* com.sss.ppp.st.db.iBATIS.qqqDAO.delete*(..))" />
            <aop:advisor advice-ref="xxxxDAOAdvice" pointcut-ref="xxxxDAOUpdatePointcut" id="xxxxDAOUpdateAdvisor" />
            <aop:advisor advice-ref="xxxxDAOAdvice" pointcut-ref="xxxxDAOInsertPointcut" id="xxxxDAOInsertAdvisor" />
            <aop:advisor advice-ref="xxxxDAOAdvice" pointcut-ref="xxxxDAODeletePointcut" id="xxxxDAODeleteAdvisor" />
            <aop:advisor advice-ref="yyyDAOAdvice" pointcut-ref="yyyDAOUpdatePointcut" id="yyyDAOUpdateAdvisor" />
            <aop:advisor advice-ref="yyyDAOAdvice" pointcut-ref="yyyDAOInsertPointcut" id="yyyDAOInsertAdvisor" />
            <aop:advisor advice-ref="yyyDAOAdvice" pointcut-ref="yyyDAODeletePointcut" id="yyyDAODeleteAdvisor" />
            <aop:advisor advice-ref="yyyDAOAdvice" pointcut-ref="qqqDAODeletePointcut" id="qqqDAODeleteAdvisor" />
            <bean id="xxxxDAOAdvice" class="com.sss.ttt.st.db.iBATIS.xxxxDAOAdvice" />
            <bean id="yyyDAOAdvice" class="com.sss.ttt.st.db.iBATIS.yyyDAOAdvice" />
    </aop:config>

    Produces this runtime issue:

    [java] [sshexec] 2011-06-06 15:37:29,635 [main] WARN factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning
    [java] [sshexec] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/aop/spring-aop.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    [java] [sshexec] at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(ErrorHandlerWrap per.java:195)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.warning(ErrorHandlerWrapper.java:96)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:380)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:318)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.reportSchemaErr(XSDHandler.java:254 1)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.reportSchemaWarning(XSDHandler.java :2532)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.getSchemaDocument(XSDHandler.java:1 836)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.parseSchema(XSDHandler.java:531)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maLoader.loadSchema(XMLSchemaLoader.java:552)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.findSchemaGrammar(XMLSchemaValidator.j ava:2437)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.handleStartElement(XMLSchemaValidator. java:1782)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.startElement(XMLSchemaValidator.java:7 05)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanStartElement(XMLNSDocumentScann erImpl.java:400)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDriver.next(XM LDocumentFragmentScannerImpl.java:2755)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl.next(XMLDocumentScannerImpl.java:648)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.next(XMLNSDocumentScannerImpl.java: 140)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:511)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:808)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:737)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:119)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(DOMParser.java:235)
    [java] [sshexec] at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(DocumentBuilderImpl.java:284)
    [java] [sshexec] at org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 75)
    [java] [sshexec] at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:388)
    [java] [sshexec] at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
    [java] [sshexec] at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
    [java] [sshexec] at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    [java] [sshexec] at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    [java] [sshexec] at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
    [java] [sshexec] at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:212)
    [java] [sshexec] at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:126)
    [java] [sshexec] at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:92)
    [java] [sshexec] at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:130)
    [java] [sshexec] at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:467)
    [java] [sshexec] at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:397)
    [java] [sshexec] at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    [java] [sshexec] at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:93)

    It is very strange that all the other xsd's are resolving properly via the classpath correctly.

    I have verified that the org.springframework.aop-3.0.5.RELEASE.jar file is in the classpath...

    Any ideas or suggestions why the Spring AOP Jar file is not being resolved correctly.

    Thanks!

  2. #2
    Join Date
    Jun 2011
    Posts
    35

    Default

    Have you tried to change the schema to "http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd" or "http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"

  3. #3

    Default

    Hi,

    Thanks for the suggestions...unfortunately I have tried both versions (2.5 and 3.0) for the spring-aop XSD file reference without success.

    Thanks again!

  4. #4
    Join Date
    Jun 2011
    Posts
    35

    Default

    Hi again,

    Strange, I tried to create a proof of concept project to reproduce this problem, first creating a small Spring 2.5 aop and then porting it to 3.0. However it worked as expected.
    I see from the your printout that you use sshexec task in ant to run, are you sure all required jars are available on the remote platform ?
    What JVM version are you using ?
    Are you using GWT and/or Jetty ?
    Here is my attempt to recreate the issue but I do not think it will help you much :-/
    Last edited by ullgren; Jun 7th, 2011 at 05:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •