Announcement Announcement Module
Collapse
No announcement yet.
Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'att Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'att

    Hi all,
    I've got a exception when startup
    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 20 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'attribute group' component.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:124)
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:93)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:130)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:467)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:397)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4135)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:546)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:637)
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:563)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:498)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1277)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:321)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:445)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
    Caused by: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'attribute group' component.
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.reportSchemaErr(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.getGlobalDecl(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDAttributeGroupTraverser.traverseLocal(Unkno wn Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDAbstractTraverser.traverseAttrsAndAttrGrps( Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDComplexTypeTraverser.processComplexContent( Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDComplexTypeTraverser.traverseComplexContent (Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDComplexTypeTraverser.traverseComplexTypeDec l(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDComplexTypeTraverser.traverseGlobal(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.traverseSchemas(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.travers ers.XSDHandler.parseSchema(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maLoader.loadSchema(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.findSchemaGrammar(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDriver.next(Un known Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(Unknown Source)
    at org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 75)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:388)
    ... 37 more
    can anyone give me some suggestions ?
    Thanks,
    fenix

  • #2
    And here is the applicationContext file:

    <?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:jpa="http://www.springframework.org/schema/data/jpa"
    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/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schem...ontext-3.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schem...ing-tx-2.5.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schem...spring-jpa.xsd
    ">
    .......
    <jpa:repositories base-package="com.fhpt.gframe.dao" />

    </beans>

    Comment


    • #3
      well the error is self explanatory:
      -> Line 20 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid
      -> Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'attribute group' component.

      Comment


      • #4
        To gwa,
        the error just when I add these content into applicationContext.xml:

        xmlns:jpa="http://www.springframework.org/schema/data/jpa"
        http://www.springframework.org/schema/data/jpa
        http://www.springframework.org/schem...spring-jpa.xsd

        so I think the error message may not exact, here is an other error message may be useful:
        org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 20 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:transactional-repository-attributes' to a(n) 'attribute group' component.

        fenix

        Comment


        • #5
          Can you set the tx namespace to a spring 3.0 namespace version?

          Comment


          • #6
            I fixed it, but still not work. The exception stack is:
            Caused by: java.lang.reflect.MalformedParameterizedTypeExcept ion
            at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.validateConstructorArguments(Unknown Source)
            at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.<init>(Unknown Source)
            at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.make(Unknown Source)
            I checked the libs and sure not use spring-2.5 jar.

            Comment


            • #7
              It's a new exception?
              Can you copy/paste the start of the stack trace?

              Comment


              • #8
                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authDao': Post-processing failed of bean type [class org.springframework.data.jpa.repository.support.Jp aRepositoryFactoryBean] failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcept ion
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyMergedBeanDefiniti onPostProcessors(AbstractAutowireCapableBeanFactor y.java:803)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:493)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
                at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
                at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
                at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
                at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
                at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
                at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
                at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
                at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
                at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
                at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
                at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4135)
                at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4630)
                at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
                at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
                at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:546)
                at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:637)
                at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:563)
                at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:498)
                at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1277)
                at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:321)
                at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
                at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
                at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785)
                at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
                at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:445)
                at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519)
                at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
                at org.apache.catalina.startup.Catalina.start(Catalin a.java:581)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
                at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
                Caused by: java.lang.reflect.MalformedParameterizedTypeExcept ion
                at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.validateConstructorArguments(Unknown Source)
                at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.<init>(Unknown Source)
                at sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl.make(Unknown Source)
                at sun.reflect.generics.factory.CoreReflectionFactory .makeParameterizedType(Unknown Source)
                at sun.reflect.generics.visitor.Reifier.visitClassTyp eSignature(Unknown Source)
                at sun.reflect.generics.tree.ClassTypeSignature.accep t(Unknown Source)
                at sun.reflect.generics.repository.ClassRepository.ge tSuperclass(Unknown Source)
                at java.lang.Class.getGenericSuperclass(Unknown Source)
                at org.springframework.core.GenericTypeResolver.getTy peVariableMap(GenericTypeResolver.java:261)
                at org.springframework.core.GenericTypeResolver.resol veParameterType(GenericTypeResolver.java:82)
                at org.springframework.beans.GenericTypeAwareProperty Descriptor.getWriteMethodParameter(GenericTypeAwar ePropertyDescriptor.java:147)
                at org.springframework.beans.GenericTypeAwareProperty Descriptor.getPropertyType(GenericTypeAwarePropert yDescriptor.java:129)
                at org.springframework.beans.factory.annotation.Injec tionMetadata$InjectedElement.checkResourceType(Inj ectionMetadata.java:132)
                at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor$PersistenceElement.<init> (PersistenceAnnotationBeanPostProcessor.java:617)
                at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.findPersistenceMetadata(P ersistenceAnnotationBeanPostProcessor.java:394)
                at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.postProcessMergedBeanDefi nition(PersistenceAnnotationBeanPostProcessor.java :320)
                at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyMergedBeanDefiniti onPostProcessors(AbstractAutowireCapableBeanFactor y.java:798)
                ... 36 more

                Comment


                • #9
                  public interface AuthDao extends JpaRepository<Auth, Long>{

                  }

                  Comment


                  • #10
                    @Entity(name="Auth")
                    @Table(name="Auth")
                    public class Auth implements java.io.Serializable {
                    /** @pdOid 53fbfd59-e586-46a5-a752-f4c49ce416d1 */
                    @Id
                    @GeneratedValue(strategy=GenerationType.IDENTITY)
                    @Column(name="authId", nullable=false, insertable=true, updatable=true)
                    private Long authId;
                    /** @pdOid 31786005-e936-4bd8-be4f-b4ee8de12a65 */
                    @Basic(optional=true)
                    @Column(name="authName", insertable=true, updatable=true, length=32)
                    private String authName;
                    /** @pdOid 6e4382dd-a275-45ad-af9c-f2ff989282c7 */
                    @Basic(optional=true)
                    @Column(name="pubModel", insertable=true, updatable=true, length=1)
                    private String pubModel;
                    /** @pdOid 4a20e2c8-f78e-4d32-927b-256e6e2a1747 */
                    @Basic(optional=true)
                    @Column(name="url", insertable=true, updatable=true, length=100)
                    private String url;
                    /** @pdOid cf2c2e35-1429-4d4d-876c-c7a88ec62abd */
                    @Basic(optional=true)
                    @Column(name="seqno", insertable=true, updatable=true)
                    private Integer seqno = 0;

                    @OneToMany(mappedBy="authA")
                    /** @pdRoleInfo migr=no name=Auth assc=rsPnode coll=java.util.Collection impl=java.util.HashSet mult=0..* */
                    public java.util.Collection<Auth> authB;
                    @ManyToOne
                    @JoinColumn(name="pauthId", referencedColumnName="authId", nullable=true)
                    /** @pdRoleInfo migr=no name=Auth assc=rsPnode mult=0..1 side=A */
                    public Auth authA;
                    ........
                    }

                    Comment


                    • #11
                      Which jpa implementation do you use (vendor, version)?

                      Comment


                      • #12
                        Attached is my project without jars.

                        jar list:
                        antlr-2.7.6.jar
                        aopalliance-1.0.jar
                        aspectjrt-1.6.3.jar
                        bonecp-0.7.0.jar
                        com.springsource.javax.ejb-3.0.0.jar
                        com.springsource.javax.jdo-2.1.0.jar
                        com.springsource.net.sf.cglib-2.2.0.jar
                        commons-beanutils-1.8.0.jar
                        commons-collections-3.2.1.jar
                        commons-fileupload-1.2.1.jar
                        commons-io-1.3.2.jar
                        commons-lang-2.4.jar
                        commons-logging-1.1.1.jar
                        dom4j-1.6.1.jar
                        freemarker-2.3.16.jar
                        google-collections-1.0.jar
                        gson-1.7.1.jar
                        hibernate-jpa-2.0-api-1.0.0.Final.jar
                        hibernate-jpamodelgen-1.1.1.Final.jar
                        hibernate3.jar
                        javassist-3.7.ga.jar
                        jstl-1.1.2.jar
                        jta-1.1.jar
                        log4j-1.2.15.jar
                        mysql-connector-java-5.1.7-bin.jar
                        ognl-3.0.jar
                        ojdbc14.jar
                        org.springframework.aop-3.1.0.M1.jar
                        org.springframework.asm-3.1.0.M1.jar
                        org.springframework.aspects-3.1.0.M1.jar
                        org.springframework.beans-3.1.0.M1.jar
                        org.springframework.context-3.1.0.M1.jar
                        org.springframework.context.support-3.1.0.M1.jar
                        org.springframework.core-3.1.0.M1.jar
                        org.springframework.expression-3.1.0.M1.jar
                        org.springframework.instrument-3.1.0.M1.jar
                        org.springframework.instrument.tomcat-3.1.0.M1.jar
                        org.springframework.jdbc-3.1.0.M1.jar
                        org.springframework.jms-3.1.0.M1.jar
                        org.springframework.orm-3.1.0.M1.jar
                        org.springframework.oxm-3.1.0.M1.jar
                        org.springframework.test-3.1.0.M1.jar
                        org.springframework.transaction-3.1.0.M1.jar
                        org.springframework.web-3.1.0.M1.jar
                        org.springframework.web.portlet-3.1.0.M1.jar
                        org.springframework.web.servlet-3.1.0.M1.jar
                        org.springframework.web.struts-3.1.0.M1.jar
                        slf4j-api-1.5.0.jar
                        slf4j-log4j12-1.5.0.jar
                        spring-data-commons-core-1.0.0.M2.jar
                        spring-data-jpa-1.0.0.M2.jar
                        spring-orm-ibatis3-0.0.1-SNAPSHOT.jar
                        standard-1.1.2.jar
                        struts2-core-2.2.1.1.jar
                        struts2-spring-plugin-2.2.1.jar
                        xwork-core-2.2.1.1.jar

                        Comment


                        • #13
                          And which version of hibernate do you use? (version of hibernate3.jar)

                          Comment


                          • #14
                            hibernate-distribution-3.6.0.Final

                            Comment


                            • #15
                              Spring Data JPA 1.0.0.M2 needs Spring Data Commons 1.0.0.M5 (as declared in the pom.xml).

                              Cheers,
                              Ollie

                              Comment

                              Working...
                              X