简体   繁体   English

运行时在Maven项目中出现问题

[英]Issue in Maven project while running

First of all, I am newbie in maven. 首先,我是Maven的新手。

My Maven project suddenly started giving me 4o4 error on browser when I am running it. 运行我的Maven项目时,突然在浏览器上给我4o4错误。

I created one maven project with maven archetype:webapp and started putting my stuff there, it was successful, but now something is wrong there. 我创建了一个具有maven原型:webapp的maven项目,并开始将我的东西放在那里,它成功了,但是现在那里有些问题。

In web.xml, I have mentioned welcome file as index.html 在web.xml中,我提到了欢迎文件为index.html

My directory structure as below: 我的目录结构如下:

在此处输入图片说明

The error which I am facing is below: 我面临的错误如下:

在此处输入图片说明

Can anyone help me, whats wrong here? 谁能帮我,这是怎么了?

Thanks in advance!! 提前致谢!!

it seems you renamed the context from "InterApp" to "interApp_Accounting_v1" - can you try to access the webapp using that new name? 似乎您已将上下文从“ InterApp”重命名为“ interApp_Accounting_v1”-您可以尝试使用该新名称访问网络应用吗?

So I would guess: http://localhost:8080/interApp_Accounting_v1/ 所以我猜: http:// localhost:8080 / interApp_Accounting_v1 /

The name is derived from the finalName inside the pom.xml: 该名称是从pom.xml内部的finalName派生的:

<finalName>${project.artifactId}-${project.version}</finalName>

see: https://maven.apache.org/pom.html 参见: https : //maven.apache.org/pom.html

It can be changed using the finalName in the pom or via the maven war plugin: https://maven.apache.org/plugins/maven-war-plugin/usage.html 可以使用pom中的finalName或通过Maven War插件对其进行更改: https ://maven.apache.org/plugins/maven-war-plugin/usage.html

Otherwise you need to have a look in the log files if the war file could not be deployed. 否则,如果无法部署war文件,则需要查看日志文件。

问题出在web.xml中,我给出了/ *之类的url模式,如果匹配则重定向到服务类,这就是为什么它无法呈现欢迎页面的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM