简体   繁体   English

部署使用Jersey API创建的War文件

[英]Deploying war file created using jersey api

I am completely new to Java ( Beginner Java Developer). 我是Java的新手(Java初学者)。 Our previous proj was created using Jersey API. 我们以前的项目是使用Jersey API创建的。 I am trying to understand the project as I was not in the team of that project developers. 我试图了解该项目,因为我不在该项目开发人员的团队中。

My Question is.. I have created the War file to that application and deployed it in tomcat. 我的问题是..我已经向该应用程序创建了War文件,并将其部署在了Tomcat中。 But whenever I click that project from the list, it returns an error (Requested resource is not available). 但是,每当我从列表中单击该项目时,它都会返回错误(请求的资源不可用)。 I want know if I can deploy Jersey API web app in Tomcat or not? 我想知道是否可以在Tomcat中部署Jersey Jersey Web应用程序吗? Also If I can, What may be reasons for that error? 另外,如果可以的话,该错误的原因可能是什么? I tried everywhere and looked into all other threads but could not understand anything. 我到处尝试,并调查了所有其他线程,但是一无所知。

Also there is a in web.xml of our project. 在我们的项目的web.xml中也有一个。 What is the use of this? 这有什么用?

Please help me. 请帮我。 Thanks a ton in advance. 在此先感谢一吨。

I want know if I can deploy Jersey API web app in Tomcat or not? 我想知道是否可以在Tomcat中部署Jersey Jersey Web应用程序吗?

Yes, you can. 是的你可以。 You should check your version of Tomcat, and which libraries are required to work with Jersey (usually Jersey jar itself and some common utilities). 您应该检查Tomcat的版本,以及使用Jersey所需的库(通常是Jersey jar本身和一些常用实用程序)。 However, I didnt quite understand "was created using Jersey API". 但是,我不太了解“是使用Jersey API创建的”。 Did you use some Jersey-specific code? 您是否使用了一些特定于泽西岛的代码? Because Jersey is just an implementation of some specification (namely JSR-311). 因为Jersey只是某些规范(即JSR-311)的实现。

What may be reasons for that error? 该错误可能是什么原因?

Path is not specified properly, resource not initialized, etc. 路径指定不正确,资源未初始化,等等。

Also there is a in web.xml of our project. 在我们的项目的web.xml中也有一个。 What is the use of this? 这有什么用?

It is a file that is responsible for the settings of 1 application. 它是负责1个应用程序设置的文件。 In your case, your war-archive. 就您而言,您的战争档案。 In web.xml you can specify the path to your war resources. 在web.xml中,您可以指定战争资源的路径。 Nowadays, all resources can be specified with annotations, and no need to modify web.xml exists. 如今,所有资源都可以使用批注指定,并且无需修改web.xml。

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

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