idea中springboot部署常见问题

摘要:
src/main/webapp<META-INF/资源<弹簧靴起动器腹板<org.springframework.boot<弹簧靴启动器测试<版本>/版本>--servlet依赖包的jar包开始--&gt!

1.org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zhiyou.han.dao.UserMapper.selectByExample

碰见类似的问题:一般检查以下的配置文件

idea中springboot部署常见问题第1张

1.如果文件未编译,

  idea中的jsp页面和src下的.xml都不会编译,需要在pom中加入以下配置

  

  <build> 
    <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.*</include> </includes> </resource> <resource> <directory>src/main/webapp</directory> <targetPath>META-INF/resources</targetPath> <includes> <include>**/*.*</include> </includes> </resource> </resources>
  </build> 

2.service 自动注入报错:其实代码没问题,也可以运行,但是一直报错,亲测可行

idea中springboot部署常见问题第2张

idea中springboot部署常见问题第3张

SpringBoot中pom.xml基础部署依赖包和设置编译目录的方法

 <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!--添加配置-->
        <!-- JSTL (JSP standard Tag Library) JSP 标准标签库 -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <!--servlet 依赖包的jar包start-->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <!-- servlet 依赖包的jar包start -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!--引入spring boot内嵌的tomcat对jsp的解析包-->
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <!-- <scope>provided</scope>-->
        </dependency>
        <!-- tomcat 的支持. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- 加载mybatis整合的springboot -->
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.1</version>
        </dependency>
        <!-- mysql的驱动jar包 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.3</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <resources>
            <resource>

                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>

                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
            <resource>

                <directory>src/main/webapp</directory>
                <targetPath>META-INF/resources</targetPath>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>

    </build>

免责声明:文章转载自《idea中springboot部署常见问题》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Young GC和Full GC分别在什么情况下会发生?JM8.6中三个RDCost函数的对比分析下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

php 安装教程

php 安装教程  本文采用php7.0.1作为样例,进行安装。 系统环境:   CentOS6.7.   gcc 4.8.2   libzip 1.0.1 在安装之前,可以先更新CentOS系统。 yum -y update 下载相应依赖文件 wget "http://cn2.php.net/distributions/...

小米8的MIUI11通过抓取日志查看屏幕型号

如上,标题就是本次的测试环境,小米8手机(18年9月购入),MIUI11系统, 众所周知,MIUI11已经不再“硬件信息”里显示屏幕的厂家信息了(不知道是不是心虚了), 所以之前那些进入“cit模式”或者“*#*#6484#*#*、*#*#284#*#*”之类的已经都不行了, 现在只能通过抓取手机测试日志的方式自己找到有关屏幕型号的信息, 下面开始吧 如下...

js前端使用jOrgChart插件实现组织架构图的展示

项目要做组织架构图,要把它做成自上而下的树形结构。  需要购买阿里云产品和服务的,点击此链接领取优惠券红包,优惠购买哦,领取后一个月内有效: https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=fp9ccf07 一、说明 (1)通过后台查询数据库,生成树形数组结构,返回到前台。...

boost正则库匹配ASII编码的中文、全角字符示例

首先,boost正则库(regex)不支持形如 [0-9] 这样的表达式,貌似会崩溃。    现在查网上正则匹配中文的例子,都是讲用 \uFF00-\uFFFF ; 拜托,\u是unicode编码,能用于我常用的ansii编码(如GB18030,GBK,GB2312等等)吗?举例时也不说清楚。    再次查看正则语法,发现 \xnn 比较有用,\x匹配AS...

JAVA实现聚类指标的计算Purity、NMI、RI、Precision、Recall、F值。

第一个:计算NMI的: package clusters; import java.io.*;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map; /** * DATE: 16-6-18 TIME: 上午10:00 */...

easyUI-增删改查

页面整体效果 首先是页面层: 因为数据中涉及到Date类型的字段,所以在一开始先做了一个拼装装换日期格式的方法 因为在easyUI的JSON解析的Data是一个long型的数字长串,关于解析的数字长串具体含义,自己查,不做多说。 让后定义点击按钮的初始情况为添加“add”,用于下面的判断,到底是添加还是修改,因为这里公用了一个弹出对话框 下面就是具体显...