gpt4 book ai didi

java.lang.IllegalAccessError : org. apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z

转载 作者:行者123 更新时间:2023-11-29 07:34:16 25 4
gpt4 key购买 nike

我尝试将 spring 和 mybatis 集成。

jdk:1.8

运行我的测试:

    @Test
public void testFindUserById() throws Exception{
UserMapper userMapper=(UserMapper)applicationContext.getBean("userMapper");
User user=userMapper.findUserById(1);
System.out.println(user);
}

和错误:the full stacktrace

java.lang.IllegalAccessError: org.apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z

spring配置文件:

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/custom?useSSL=false" />
<property name="username" value="root" />
<property name="password" value="qqwe5631652" />
<property name="maxIdle" value="5" />
</bean>

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:SqlMapConfig.xml" />

</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="mapper" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>

<bean id="userDao" class="dao.UserDaoImpl">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />

</bean>
</beans>

file's structure all of ‘.jar’

关于权限的java.lang.IllegalAccessError?我不知道

最佳答案

我把 commons-dbcp-1.2.1.jar 改成 commons-dbcp-1.4.jar ,现在可以了!

关于java.lang.IllegalAccessError : org. apache.commons.dbcp.DelegatingPreparedStatement.isClosed()Z,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49725650/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com