Announcement Announcement Module
Collapse
No announcement yet.
Spring and AspectJ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and AspectJ

    HI ALL,
    i would like to use AspectJ aspects in spring...
    when i tried long time ago (about year ago, spring 1.2.6) i needed to run aop compiler on my source classes in order to have aspectj's aspect applies..

    is it still the case with spring 2.0?

    with kindest regards
    marco

  • #2
    Hi Marco

    You can do load time weaving in AspectJ, and Spring has support for this too. Here is the link to the current section of the Spring manual that describes this support:

    http://static.springframework.org/sp...tml#aop-aj-ltw

    However, that section is wayyyyyyy too short, and is being rewritten... check out the next release, the documentation describing the load time weaving support will be much better.

    Cheers
    Rick

    Comment


    • #3
      hello,
      thanks for the reply..
      i have an additional question as i am trying to get LTW to work.
      all docs mentions about a spring-aspects.jar file... but i am unable to find it
      anywhere
      i came across this article

      http://www.aspectprogrammer.org/blog...cal_gui_2.html

      which says that spring 2.0M1 should contain classes previously on spring-aspects.jar

      but from web i can only download spring 2.0.6, will that be fine too?

      regards
      marco

      Comment


      • #4
        Hi Marco

        I just downloaded the spring-2-0-6 release zip from SourceForge, and the spring-agent.jar file is included in said release.

        You can find it in this folder of the unzipped directory structure:

        Code:
        spring-framework-2.0.6/dist/weavers
        Cheers
        Rick

        Comment


        • #5
          hello rick,
          and i suppose i need to have it on the classpath to make LTW working, correct?

          because i tried 2 versions of same aspect (modified accordingly), and right now i can make my aspect work only when it is a 'pure spring' aspect, while LTW does not seem to work for me.
          i am guessing i am forgetting something in classspath, as i have configured in aop.xml

          <weaver options="-showWeaveInfo"/>

          but nothing gets in output (i m using IDEA, i followed steps on how to configure JVM for LTW)


          with kindest regards
          marco

          Comment


          • #6
            Hi Marco

            Ah, the pain and pleasure of being an early adopter

            The documentation regarding the use of the spring-agent is not yet finished. Find attached to this issue the current (70% finished but not peer-reviewed) documentation that describes usage of the spring-agent. (It's a HTML file inside a ZIP cos the file size is too large while unzipped to attach - how very Stoke-on-Trent).

            That's the best I can do at the moment I'm busy writing tests to verify that it actually works in any environment, hence it not being finished yet. You may get better mileage for your LTW buck by doing standard LTW using AspectJ's agent. This is described here.

            Let me sidestep here: can I ask why you are using LTW as opposed to compile time weaving? Is it a requirement, you're doing research, or what exactly?

            Cheers
            Rick

            Comment


            • #7
              Hello,
              well, i am doing research for my world domination plan

              i am actually using it at work in my experimental project.. there is old legacy code which is very tied to database, using hardcoded statement for stored procedures.
              i want to write an aspect so that i change completely the flow of the program to call my stored procedures instead.
              code is existing, and using ant
              @home i have always used aspectj compiler (wiht maven) to weave aspects at compile time, but here somehow i am constrained to use ant, and when i tried the iajc task it failed because of classpath..
              so, after reading spring docs, i figured out that surely spring is that smart to allow to integrate aspectj easily without requiring compile-time weaving..
              ..

              regards
              marco

              Comment


              • #8
                Error in using AspectJ / LTW

                hi all,
                this post is the following of this one

                http://forum.springframework.org/showthread.php?t=41090

                i m trying to run my aspectJ aspect usign LTW, within JUnit Tests of INtelliJ IDEA.

                here's my setup

                - i have enabled instrumetation by declaring this vm parameter in my junit test
                -javaagent:C:/aspectj1.5/lib/spring-agent.jar
                - here's my aop.xml
                Code:
                <aspectj>
                    <weaver options="-showWeaveInfo"/>
                
                    <aspects>
                        <aspect name="com.aop.ResultSetFactoryAdvice"/>
                    </aspects>
                </aspectj>
                - here's my app Context (the one who is blowing up)
                Code:
                <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"
                       xsi:schemaLocation="
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.1.xsd">
                
                
                    <!-- ApplicationContext file for AOP -->
                    <bean id="resultSetFactoryAdvice"
                        class="com.bnpparibas.collateral.db.aop.ResultSetFactoryAdvice"/>
                
                    <context:load-time-weaver/>
                
                </beans>
                when i run my JUnit test i receive following exception:
                Code:
                org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from URL [file:/C:/COLLSVNTRUNK/nba/classes/aopContext.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl@1e4cbc4] 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@1e4cbc4] 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.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:101)
                	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
                	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
                	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
                	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317)
                	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
                	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
                	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:167)
                	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
                	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
                	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
                	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292)
                	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
                	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
                	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:182)
                	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:152)
                	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
                	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:83)
                	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
                	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
                i m running with jdk1.5, i have removed xerces.jar and xercesImpl.jar from my classpath, but i am still getting this exception

                could anyone help me out?

                thanks in advance and regards
                marco

                Comment


                • #9
                  a quick note on the prev one..
                  i mistakenly have cut by mistake the package in the first code i have posted.. in reality everything has been declared correctly....

                  Comment


                  • #10
                    It isn't related to xerces there is another xml parser somewhere around in your classpath which gets loaded before the xerces parser. Remove the wrong one and replace it with xerces.

                    Comment


                    • #11
                      hi,
                      ok i went thru all jars and removed the suspicious ones (i had jaxp etc)..
                      now i have only xeercesImpl in the classpath.
                      however, when i run i am getting this exception
                      Code:
                      2007-07-19 09:17:38,607 [main] WARN  org.springframework.beans.factory.xml.XmlBeanDefinitionReader [] - Ignored XML validation warning
                      org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-2.1.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>.
                      	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
                      	at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
                      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                      	at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
                      	at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(Unknown Source)
                      	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
                      	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
                      	at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
                      	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
                      	at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
                      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
                      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                      	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                      	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                      	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                      	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                      	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
                      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
                      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
                      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317)
                      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
                      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
                      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:167)
                      	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
                      	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
                      	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
                      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292)
                      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
                      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
                      	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:182)
                      	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:152)
                      	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
                      	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:83)
                      	at junit.framework.TestCase.runBare(TestCase.java:125)
                      	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
                      	at junit.framework.TestResult$1.protect(TestResult.java:106)
                      	at junit.framework.TestResult.runProtected(TestResult.java:124)
                      	at junit.framework.TestResult.run(TestResult.java:109)
                      	at junit.framework.TestCase.run(TestCase.java:118)
                      	at junit.textui.TestRunner.doRun(TestRunner.java:116)
                      what's wrong this time?

                      if i remove the context schema, my test runs just fine.....


                      with kindest regards
                      marco

                      Comment


                      • #12
                        hi,
                        i did little more debug...
                        well, everything works fine if i remove this line
                        Code:
                        <context:load-time-weaver/>
                        then the test does not blow up

                        but as soon as i put it in, i am getting again
                        Code:
                        2007-07-19 09:23:01,460 [main] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader [] - Loading XML bean definitions from URL [file:/C:/COLLSVNTRUNK/nba/classes/commonApplicationContext.xml]
                        2007-07-19 09:23:01,726 [main] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader [] - Loading XML bean definitions from file [C:\COLLSVNTRUNK\nba\classes\testApplicationContext.xml]
                        2007-07-19 09:23:01,742 [main] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader [] - Loading XML bean definitions from URL [file:/C:/COLLSVNTRUNK/nba/classes/aopContext.xml]
                        2007-07-19 09:23:01,929 [main] WARN  org.springframework.beans.factory.xml.XmlBeanDefinitionReader [] - Ignored XML validation warning
                        org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-context-2.1.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>.
                        	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
                        	at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
                        	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                        	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                        	at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
                        	at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(Unknown Source)
                        	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
                        	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
                        	at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
                        	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
                        	at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
                        	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
                        	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                        	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                        	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                        	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
                        	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                        	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                        	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                        	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:167)
                        	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
                        	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
                        	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
                        	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292)
                        	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
                        	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
                        	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:182)
                        	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:152)
                        	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
                        	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:83)
                        	at junit.framework.TestCase.runBare(TestCase.java:125)
                        	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
                        	at junit.framework.TestResult$1.protect(TestResult.java:106)
                        	at junit.framework.TestResult.runProtected(TestResult.java:124)
                        	at junit.framework.TestResult.run(TestResult.java:109)
                        	at junit.framework.TestCase.run(TestCase.java:118)
                        	at junit.textui.TestRunner.doRun(TestRunner.java:116)
                        	at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
                        	at junit.textui.TestRunner.doRun(TestRunner.java:109)
                        	at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
                        	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
                        	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        	at java.lang.reflect.Method.invoke(Method.java:585)
                        	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
                        
                        org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from URL [file:/C:/COLLSVNTRUNK/nba/classes/aopContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:load-time-weaver'.
                        Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:load-time-weaver'.
                        	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                        	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                        	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)
                        	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:317)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:125)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:141)
                        	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:167)
                        	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
                        	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
                        	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
                        	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:292)
                        	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
                        	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
                        	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:182)
                        	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:152)
                        	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
                        	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:83)
                        	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
                        	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        	at com.intellij.rt.execution.application.AppMain.main(
                        any help?

                        thanks and regards
                        marco

                        Comment


                        • #13
                          hello,
                          i have another update to this..
                          i found on the web a post saying that spring 'validates' or 'read' schemas from its spring.jar/META-INF directory.

                          Well , in that directory for spring2.0.6 the URL related to context schema is missing..
                          will i have to download spring 2.1? or the my problem has nothing to do with that?

                          thanks and regards
                          marco

                          Comment


                          • #14
                            hello,
                            yep that fixed it. i downloaded spring2.1.. now i am having another exception

                            Code:
                            java.lang.NoClassDefFoundError: org/aspectj/weaver/loadtime/ClassPreProcessorAgentAdapter
                            	at org.springframework.context.weaving.AspectJWeavingEnabler.postProcessBeanFactory(AspectJWeavingEnabler.java:54)
                            	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:521)
                            	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:504)
                            	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:340)
                            	at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:199)
                            	at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:179)
                            	at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:158)
                            	at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
                            	at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:87)
                            	at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
                            	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
                            i have included in my lib aspectjlib.jar, aspectjrt.jar, aspectjweaver.jar and spring-agent.jar.......

                            i m going to debug it more, but in meantime i'll appreciate if anyone can give me some hints..
                            thanks andr egards
                            marco

                            Comment


                            • #15
                              hello all,
                              ok it worked now!!!!

                              thanx to Rick for documentation and all others for help!

                              cause of my problem was that i didnt include aspectj libraries from spring distribution (i took them straight from aspectj.org)

                              thanx again and regars
                              marco

                              Comment

                              Working...
                              X