下午做一个spring用jdbc连接数据库的小程序,报了个莫名其妙的错误,求解答:
异常信息:
Exception in thread "main" org.aspectj.apache.bcel.verifier.exc.AssertionViolatedException:
FOUND:
INTERNAL ERROR: Oops!
Exiting!!
at org.aspectj.apache.bcel.verifier.exc.AssertionViolatedException.main(AssertionViolatedException.java:102)
Spring配置:
<context:annotation-config />
<context:component-scan base-package="com" />
<aop:aspectj-autoproxy />
<bean id="log" class="com.aop.log"></bean>
<aop:config>
<aop:aspect id="logAspect" ref="log">
<aop:before method="before" pointcut="execution(public * com.service..* .addUser(..))"/>
</aop:aspect>
</aop:config>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/test" />
<property name="username" value="root" />
<property name="password" value="731950" />
</bean>
Spring JDBC 数据库
------解决方案--------------------
org.aspectj这个包。
------解决方案--------------------
你把
<aop:config>
<aop:aspect id="logAspect" ref="log">
<aop:before method="before" pointcut="execution(public * com.service..* .addUser(..))"/>
</aop:aspect>
</aop:config>
注释掉,不要aop的操作时候看还会不会报错