Spring Mybatis 打包Jar应用执行问题

tqz 发布于 2017/04/16 13:37
阅读 360
收藏 0

<mybatis.version>3.4.1</mybatis.version>
<mybatis-spring.version>1.3.0</mybatis-spring.version>
<spring.version>4.3.3.RELEASE</spring.version>

执行语句:
java -cp .:./libs/commons-beanutils-1.9.3.jar:./libs/commons-codec-1.10.jar:./libs/commons-collections-3.2.2.jar:./libs/commons-compress-1.12.jar:./libs/commons-lang-2.6.jar:./libs/commons-logging-1.2.jar:./libs/druid-1.0.14.jar:./libs/fastjson-1.2.28.jar:./libs/httpclient-4.5.2.jar:./libs/httpcore-4.4.4.jar:./libs/httpmime-4.2.1.jar:./libs/jsoup-1.9.2.jar:./libs/log4j-1.2.17.jar:./libs/mybatis-3.4.1.jar:./libs/mybatis-spring-1.3.0.jar:./libs/mysql-connector-java-5.1.34.jar:./libs/slf4j-api-1.7.12.jar:./libs/slf4j-log4j12-1.7.12.jar:./libs/spring-aop-4.3.3.RELEASE.jar:./libs/spring-beans-4.3.3.RELEASE.jar:./libs/spring-context-4.3.3.RELEASE.jar:./libs/spring-context-support-4.3.3.RELEASE.jar:./libs/spring-core-4.3.3.RELEASE.jar:./libs/spring-expression-4.3.3.RELEASE.jar:./libs/spring-jdbc-4.3.3.RELEASE.jar:./libs/spring-tx-4.3.3.RELEASE.jar:./libs/xxx.jar -Xms216M -Xmx512M org.xxx 

Mybatis配置:
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="configLocation" value="classpath:mybatis-config.xml"/>
        <property name="mapperLocations" value="classpath*:**/mapper/*Mapper.xml"/>
    </bean>
  
    <bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="**.mapper"/>
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
    </bean>

Exception:
sted exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for org.mdmooc.clawer.dao.mapper.ClawContentMapper.BaseResultMap

我在开发中(IDEA)执行没问题,以Jar的方式执行就报错;
求租大神解决

加载中
0
kentxp
kentxp

为啥要搞的这么麻烦 不打个可执行的JAR包不就结束了

返回顶部
顶部