CodeMartain 2021-05-13 20:26 采纳率: 76.3%
浏览 38
已结题

为啥不能创建dataSource,后面的advisor通知引用错误?哪位大神给看一下呀?

package com.DataBase.day006;

import java.util.List;

public interface Person {
    public int addUser(Userinfo userinfo);
    public int updateUser(Userinfo userinfo);
    public int deleteUser(Userinfo userinfo);
    public Userinfo findUserById(int id);
    public List<Userinfo> findAllUser(Userinfo userinfo);
    public void transfer(String outPerson,String inPerson,Integer jifen);

}
package com.DataBase.day006;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import java.util.List;

public class PersonImpl implements  Person{


    private JdbcTemplate jdbcTemplate;//

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    private Integer jifen;



    @Override
    public int addUser(Userinfo userinfo) {//考虑插入数据,怎么插入?需要操作数据库,就需要JdbcTemplate的实例来操作

String sql="insert into userinfo values(?,?,?)";//定义插入语句
Object []obj =new Object[]{
        userinfo.getId(),userinfo.getName(),userinfo.getPassword()
};//用OBJ接受插入得信息,可变参数
        int num =jdbcTemplate.update(sql,obj);
        System.out.println("成功插入了"+num+"条信息");
        return num;
    }

    @Override
    public int updateUser(Userinfo userinfo) {
String sql="update userinfo set id =? where username=?";
Object []obj=new Object[]{
  userinfo.getId(),userinfo.getName()
};

        return 0;
    }

    @Override
    public int deleteUser(Userinfo userinfo) {
        String sql="delete from userinfo where username=?";
        Object[]obj=new Object[]{
          userinfo.getName()
        };
        int num =jdbcTemplate.update(sql,obj);
        System.out.println("成功删除"+num+"条信息");
        return num;
    }

    @Override
    public Userinfo findUserById(int id) {
        String sql="select * from userinfo where id=?";
        RowMapper<Userinfo> rowMapper = new BeanPropertyRowMapper<>(Userinfo.class);
return this.jdbcTemplate.queryForObject(sql,rowMapper,id);
    }

    @Override
    public List<Userinfo> findAllUser(Userinfo userinfo) {
        String sql="select * from userinfo";
        RowMapper<Userinfo> rowMapper = new BeanPropertyRowMapper<>(Userinfo.class);
        return this.jdbcTemplate.query(sql,rowMapper);
    }

    @Override
    public void transfer(String outPerson, String inPerson, Integer jifen) {
        //接受积分
        this.jdbcTemplate.update("update userinfo set jifen=jifen+? where username=?,jifen,inPerson");
        //int i=1/0;//模拟系统突发问题

        /*
        如果没有事务控制,那么在transfer()方法之后接收积分的用户积分会增加,赠送积分的用户积分会因为系统出现问题而不变,
        如果增加事务控制,那么在transfer()方法之后 接受积分和赠送积分的用户积分都应该保持不变
         */
        //赠送积分
        this.jdbcTemplate.update("update userinfo set jifen=jifen-? where username=?,jifen,outPerson");
    }
}
package com.DataBase.day006;

public class Userinfo {
    private String name;
    private String password;
    private int id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    private  int jifen;
    public int getJifen() {
        return jifen;
    }

    public void setJifen(Integer jifen) {
        this.jifen = jifen;
    }
}
<?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:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">
       <bean id ="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
       <property name="driverClassName" value="org.postgresql.Driver"/>
       <property name="url" value="jdbc:postgresql://localhost:5432/shop"/>
       <property name="username" value="postgres"/>
       <property name="password" value="955945"/>
       </bean>
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <bean id ="person" class="com.DataBase.day006.PersonImpl">
        <property name="jdbcTemplate" ref="jdbcTemplate"/>
    </bean>
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="*" propagation="REQUIRED" isolation="DEFAULT" read-only="false"/>
    </tx:attributes>
    </tx:advice>
    <aop:config>
        <aop:pointcut id="txPointCut" expression="execution(* com.DataBase.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/>
    </aop:config>
</beans>

这里xml配置有什么问题?

package com.DataBase.day006;

import org.springframework.context.support.FileSystemXmlApplicationContext;

public class TestSW {
    public static void main(String[] args) {
        FileSystemXmlApplicationContext file =new FileSystemXmlApplicationContext("src/aplicationContextSW.xml");
     Person person =(Person) file.getBean("person");
     person.transfer("王五","王二",200);
     System.out.println("赠送积分成功");
    }
}

运行结果显示如下

为啥不能创建dataSource,后面的advisor通知引用错误?哪位大神给看一下呀?

 

"C:\Program Files\Java\jdk-15.0.2\bin\java.exe" "-javaagent:D:\IDEA\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar=53494:D:\IDEA\IntelliJ IDEA 2021.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\Administrator\IdeaProjects\DataBase.Day005\target\classes;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-tx-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aop-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jms-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-orm-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-oxm-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-web-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-core-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jdbc-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-test-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-beans-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aspects-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-messaging-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-websocket-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-expression-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-tx-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-tx-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aop-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aop-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jms-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jms-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-orm-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-orm-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-oxm-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-oxm-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-web-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-web-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-core-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-core-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jdbc-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-jdbc-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-test-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-test-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-beans-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-beans-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-portlet-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aspects-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-aspects-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-support-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-tomcat-4.3.6.RELEASE.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-messaging-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-messaging-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-websocket-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-websocket-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-expression-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-expression-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-portlet-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-webmvc-portlet-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-support-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-context-support-4.3.6.RELEASE-sources.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-tomcat-4.3.6.RELEASE-javadoc.jar;C:\Spring\spring-framework-4.3.6.RELEASE-dist\spring-framework-4.3.6.RELEASE\libs\spring-instrument-tomcat-4.3.6.RELEASE-sources.jar;C:\PostgreSQL\jdbc\postgresql-42.2.20.jar;C:\Spring\commons-logging-1.2-bin\commons-logging-1.2\commons-logging-1.2.jar com.DataBase.day006.TestSW
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
5月 14, 2021 10:31:17 上午 org.springframework.context.support.FileSystemXmlApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@1c6b6478: startup date [Fri May 14 10:31:17 CST 2021]; root of context hierarchy
5月 14, 2021 10:31:17 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from file [C:\Users\Administrator\IdeaProjects\DataBase.Day005\src\main\webapp\applicationContextSW.xml]
5月 14, 2021 10:31:18 上午 org.springframework.context.support.FileSystemXmlApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [C:\Users\Administrator\IdeaProjects\DataBase.Day005\src\main\webapp\applicationContextSW.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'txPointCut' while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txPointCut': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [C:\Users\Administrator\IdeaProjects\DataBase.Day005\src\main\webapp\applicationContextSW.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'txPointCut' while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txPointCut': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:479)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
	at com.DataBase.day006.TestSW.main(TestSW.java:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'txPointCut' while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txPointCut': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1531)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92)
	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101)
	at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:103)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:248)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1037)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1011)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:473)
	... 10 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txPointCut': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:325)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
	... 26 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1147)
	... 32 more
Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3296)
	at java.base/java.lang.Class.getConstructor0(Class.java:3501)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2711)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
	... 33 more
Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 38 more

Process finished with exit code 1

以上是错误信息,

  • 写回答

3条回答 默认 最新

  • CSDN专家-三岁丫 2021-05-13 20:38
    关注

    你这个 txPointCut 也没有配呀

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 9月27日
  • 已采纳回答 9月19日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效