【踩坑心得】java开发、spring工程、maven工程相关控制台报错

【本帖会持续更新

1.控制台报错信息:Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.2.RELEASE::repackage failed: Unable to find main class

【maven打包问题】解决方案:注意是Unable to find main class:

1)如果是一个springboot工程,那么检查我们的工程目录下,是否出现两个或者缺少main方法(注解缺少),在控制台信息中,常常会指出是哪个模块缺少的main方法。(由于题主的工程结构是一个springboot工程下拆分api和service模块,写了两套pom依赖文件,并且粗心的在两个pom中都添加了maven的打包依赖,所以报错)

2)如果已确认main方法存在,那么就是你的pom文件中缺少了以下的依赖,添加上去即可

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

 

2. javax.servlet.jsp.JspException cannot be resolved to a type 或者

The superclass "javax.servlet.http.HttpServlet" was not found on the Java

【eclipse使用报错】解决方案:这个错误可能是服务器自带的servlet库未导入的原因。

右键项目属性,转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决。

 

11.14更新

3.在使用npm对vue工程的运行过程中,出现了以下错误

'vue-cli-service' 不是内部或外部命令,也不是可运行的程序
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! srm-web-ui@1.0.0 serve: `vue-cli-service serve --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the srm-web-ui@1.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

【vue依赖包问题】解决方案:删除工程中的node_modules文件夹之后,重新使用cnpm install去下载依赖包,这大概就是99%的电脑问题都可以通过重新开机/重装解决吧。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值