NutzCN Logo
问答 cmd命令行运行mvn package打包的jar包,发起请求出现下面异常
发布于 2205天前 作者 小约翰 3184 次浏览 复制 上一个帖子 下一个帖子
标签:
[DEBUG] 14:39:31.476 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [GET] path=/ : MainLauncher.index(MainLauncher.java:16)
[DEBUG] 14:39:31.477 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) - Get 'mainLa
uncher'<class io.nutz.demo.MainLauncher>
10 回复

这不是异常,这叫日志

哦哦,这是什么问题呢,在eclipse直接run as 是可以访问的,打成jar包就不行了

页面显示啥

HTTP Status 404 – Not Found
Type Status Report

Message /index.html

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/8.5.29

哦, tomcat, 改成jetty试试

换成jetty后就可以了,为何tomcat不行呢?

得查查才知道

对了,我导入项目的时候,pom.xml文件是报错的,删除了以下内容才可以,会不会跟这个有关


<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <mainClass>io.nutz.demo.MainLauncher</mainClass> </manifest> </archive> </configuration> </plugin>

这个没关系, 可以删掉的

添加回复
请先登陆
回到顶部