SweetInk / jrebel-mybatisplus

A hook plugin for Support MybatisPlus that reloads modified SQL maps.
MIT License
171 stars 32 forks source link

Eclipse下 java.lang.NullPointerException #9

Closed Zhang-0952 closed 4 years ago

Zhang-0952 commented 4 years ago

开发环境:Mac Eclipse:4.14.0 mybatis-plus 版本:3.3.1 解压jar包:/Users/zx/Documents/server/JrebelHotReload 添加该项目的VM参数:-Drebel.plugins=/Users/*/Documents/server/JrebelHotReload/jr-mybatisplus.jar

输出多了一句日志:JRebel: Ready config JRebel MybatisPlus plugin... 但是仍然无法自动更新,错误如下 image

SweetInk commented 4 years ago

看下你的mybatis-plus配置文件,以及你使用的jr-mybatisplus.jar版本是多少?

Zhang-0952 commented 4 years ago

jr-mybatisplus.jar 就是3.3.1

    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus</artifactId>
        <version>3.3.1</version>
    </dependency>

配置文件:

<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean">
    <!--引入数据源  -->
    <property name="dataSource" ref="dataSource"/>
    <!--引入mybatis配置文件  -->
    <property name="configLocation" value="classpath:/mybatis/mybatis-config.xml"/>
    <!--引入映射文件  -->
    <property name="mapperLocations" value="classpath:/mybatis/mappers/*.xml"/>
    <!--引入别名包 -->
    <property name="typeAliasesPackage" value="com.jt.manage.pojo"/>
   <!--  <property name="globalConfig" ref="globalConfig"/>  非必须  -->
</bean>

<bean id="globalConfig" class="com.baomidou.mybatisplus.core.config.GlobalConfig">
<property name="dbConfig" ref="dbConfig"/> <!--  非必须  -->

</bean>

<bean id="dbConfig" class="com.baomidou.mybatisplus.core.config.GlobalConfig.DbConfig">
    <property name="tablePrefix" value="tb_"/>
</bean>

<!--为Mapper接口生产代理对象  -->
<bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <!--指定包名 为其创建代理对象  -->
    <property name="basePackage" value="com.*.*.mapper"/>
</bean>
SweetInk commented 4 years ago

jr-mybatisplus.jar我目前发布的最新版本才1.0.2 所有Release

Zhang-0952 commented 4 years ago

应该说,是mybatis-plus 版本:3.3.1 之前下载的不是最新包 下载最新的包1.0.2后可以了,谢谢