Announcement Announcement Module
Collapse
No announcement yet.
auto-registration and eclipse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • auto-registration and eclipse

    I'm trying to improve my old spring 2.0 file and add new features.
    I added auto registration:

    <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/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.1.xsd">

    <context:annotation-config />
    <context:component-scan base-package="actualis.web" />



    but now when I launch my testng tests I get this weird error

    FAILED CONFIGURATION: @BeforeClass setUp
    org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from class path resource [actualis/web/test/applicationContext.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.core.type.asm.AnnotationMetada taReadingVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/StringV
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:375)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:303)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:280)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:142)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:158)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:184)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:112)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:79)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:101)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:406)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:338)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:91)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:75)
    at org.springframework.test.AbstractSingleSpringConte xtTests.loadContextLocations(AbstractSingleSpringC ontextTests.java:138)
    at org.springframework.test.AbstractSingleSpringConte xtTests.loadContext(AbstractSingleSpringContextTes ts.java:125)
    at org.springframework.test.AbstractSpringContextTest s.getContext(AbstractSpringContextTests.java:104)
    at org.springframework.test.AbstractSingleSpringConte xtTests.setUp(AbstractSingleSpringContextTests.jav a:75)
    at actualis.web.test.SpringTestCase.setup(SpringTestC ase.java:21)
    at actualis.web.test.AbstractSpringEnabledTestCase.se tUp(AbstractSpringEnabledTestCase.java:39)
    Caused by: java.lang.AbstractMethodError: org.springframework.core.type.asm.AnnotationMetada taReadingVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/StringV
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.springframework.core.type.filter.AnnotationTyp eFilter.matchSelf(AnnotationTypeFilter.java:53)
    at org.springframework.core.type.filter.AbstractTypeH ierarchyTraversingFilter.match(AbstractTypeHierarc hyTraversingFilter.java:54)
    at org.springframework.context.annotation.ClassPathSc anningCandidateComponentProvider.isCandidateCompon ent(ClassPathScanningCandidateComponentProvider.ja va:195)
    at org.springframework.context.annotation.ClassPathSc anningCandidateComponentProvider.findCandidateComp onents(ClassPathScanningCandidateComponentProvider .java:167)
    at org.springframework.context.annotation.ClassPathBe anDefinitionScanner.doScan(ClassPathBeanDefinition Scanner.java:182)
    at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.parse(ComponentScanBeanDefi nitionParser.java:153)
    at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:69)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1252)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1242)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:133)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:90)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:458)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:353)
    ... 40 more
    ... Removed 22 stack frames


    I have not a clue where this might come from. Is the auto loading compatible with Eclipse class loading?

    Henri.

  • #2
    Any chance you've got still got an old Spring JAR on the classpath?

    Comment


    • #3
      Originally posted by karldmoore View Post
      Any chance you've got still got an old Spring JAR on the classpath?
      Find it out! This is a wicked dependency issue. It is due to the versions of asm. Hibernate comes with an old version of asm (linked to cglib) and spring requires asm 2.x. I think the solution will be to change the cglib to the cglib-nodep.

      Henri

      Comment

      Working...
      X