Announcement Announcement Module
Collapse
No announcement yet.
Spring AOP - JDK1.4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring AOP - JDK1.4

    I need help to solve an issue with trying to use Spring 1.2 or 2.5 (AOP) in with JDK 1.4.

    With Spring 1.2 I tried the following configuration
    (Used DTD in the xml: <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">)

    <bean id="performanceInterceptor"
    class="com.springproject.test1.PerformanceAdvice"/>

    <bean id="performanceAdvisor"
    class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
    <property name="advice">
    <ref local="performanceInterceptor"/>
    </property>
    <property name="pattern" value="*.embark"/>
    </bean>

    and it doest appear to work when the embark method is invoked on any bean.

    While I tired to use <aop:config> by setting the schema in the xml as

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

    but I get the following compilation error on the console.


    org.springframework.beans.factory.BeanDefinitionSt oreException: Parser configuration exception parsing XML from class path resource [knight.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl @2c84d9] does not support XML Schema. Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
    Caused by: javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl @2c84d9] does not support XML Schema. Are you running on Java 1.4 or below with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
    at org.springframework.beans.factory.xml.DefaultDocum entLoader.createDocumentBuilderFactory(DefaultDocu mentLoader.java:101)
    at org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 70)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:361)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:313)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:290)
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFactory.java:73)
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFactory.java:61)
    at com.springproject.test1.KnightApp.main(KnightApp.j ava:13)

    I do not want to use the ProxyFactoryBean approach in my current app. I am also not able to find sufficient document to help setup AspectJ compiler for Weblogic8.1 hence would want to use Spring AOP.

    Please let me know if there is anything I can do to resolve this issue.

  • #2
    Spring AOP - JSK1.4

    You have two choices:

    1. Update your xalan and xerces libs. Create endorsed directory in your $java_home/lib and copy xerces and xalan that suppport xsd. That should fix the problem. You may have to do the same on your servlet container lib.

    2. run maven dependency:tree and check where crimson dependency comes from and add an <exclusion> to the dependency that required crimson.

    3. I had the same problem and used #1 to solve the problem.

    hope this helps

    .anil

    ps: run

    java org.apache.xalan.xslt.EnvironmentCheck to determine the xalan version your jdk defaults to.

    Comment

    Working...
    X