如何在其中包含.jar文件的Eclipse之外的远程tomcat服务器上部署Web项目 [英] How to deploy web project on remote tomcat server outside Eclipse with .jar files in it

查看:115
本文介绍了如何在其中包含.jar文件的Eclipse之外的远程tomcat服务器上部署Web项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Rest API项目A ,该项目使用项目B和项目C进行数据库检索

I have Rest API Project A which uses Project B and Project C for Database retrieval

项目B 项目c ,其中JPA用于数据库.项目A在Eclipse中工作,因为我在以下位置添加了项目B和项目C的依赖项:

Project B, Project c In which JPA is used for DB. Project A is working in Eclipse as i have added Project B and Project C's dependency at following places:

  1. 属性-> 部署程序集->添加->项目B和C
  2. 调试配置->类路径->用户条目->添加项目B和C,其中自动包括B和C的所有.jar.
  3. 将项目B和C添加到项目->属性
  1. Properties -> Deployment Assembly--> Add -> Project B and C
  2. Debug Configurations -> Classpath -->User Entries --> Add Projects B and C which includes all .jars of B and C automatically
  3. Added project B and C to Projects--> Properties

现在,我希望我的Web项目在没有Eclipse的 Localhost上运行.

Now i want my web project to run on Localhost without Eclipse.

我制作了ProjectA.war文件,并将其放入tomcate的webapps文件夹中并运行tomcat.

I made ProjectA.war file and put it in tomcate's webapps folder and run tomcat.

它执行正常的功能,例如是否要打印Hello.是的.

It performs normal function like if i want to print Hello. it does..

但是当我尝试运行任何函数时又调用了已查询数据库JPA的项目B和C的函数时,它不起作用.它不返回任何数据.

But when i try to run any function which in turn call project B and C's function which has query to Database JPA its Not working.It doesn't return any data.

在tomcat中部署.war在项目A中后,仅出现我在Properties -> Deployment Assembly--> Add -> Project B and C中添加的.jar.

After Deploying .war in tomcat In Project A webapps\ProjectA\WEB-INF\lib only .jar which i added in Properties -> Deployment Assembly--> Add -> Project B and C Appears.

我该如何同时使用项目B和C.请帮助我还需要包含哪些.jars或依赖项,以及在何处?

How can i make it work to use project B and C also. Please Help what .jars or dependencies should i also need to include and where??

推荐答案

您需要为项目B&创建一个jar.将它们放置在您的项目A的WEB-INF \ lib下的tomcat webapps目录中.

You need to create jars for your project B & C an place them under the WEB-INF\lib of your project A in tomcat webapps directory.

或者,如果您不为项目B&然后,C用WEB-INF/classes复制具有适当包结构的类.

Or if you don't create jars for your project B & C then copy the classes with proper package structures in WEB-INF/classes.

您始终可以检查Tomcat/logs目录中出了什么问题.

You can always check what is going wrong in Tomcat/logs directory.

一条建议: 熟悉诸如maven和ant之类的构建工具.我建议您学习有关Maven,其依赖项管理和构建插件的知识.借助这些工具,您确实可以使您的生活更轻松.

A piece of advice: Familarize yourself with use of build tools such as maven and ant. I would recommend you to learn about maven, its dependency management, and build plugins. You can really make your life easier with such tools.

这篇关于如何在其中包含.jar文件的Eclipse之外的远程tomcat服务器上部署Web项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆