简体   繁体   English

带有glassfish服务器4.1.1的autodeploy Web服务Java?

[英]autodeploy web service java with glassfish server 4.1.1?

我如何做自动部署Web服务,我有webService.war文件?我正在使用glassfish 4.1.1,并使用外部库postgresql-9.4-1203.jdbc4.jar,但我不知道如何部署。战文件谢谢。

Not sure what you mean by deploy automatically, however, DeshanR's suggestion is still workable even for 4.1.1. 不知道自动部署意味着什么,但是,即使对于4.1.1,DeshanR的建议仍然可行。 You also have two other options: 您还有两个选择:

You can deploy the war file from the browser by pointing your browser to yourdomain :4848. 您可以通过将浏览器指向yourdomain :4848从浏览器部署war文件。 This will bring you to the glassfish admin console (provided glassfish is up and running and your glassfish is set to use port 4848, which by default it should be). 这将带您进入glassfish管理控制台(提供的glassfish已启动并正在运行,并且您的glassfish设置为使用端口4848,默认情况下应为端口4848)。 You can then deploy your war file under the applications menu. 然后,您可以在应用程序菜单下部署war文件。

If this is a dev environment you can also deploy to your local glassfish from your IDE. 如果这是一个开发环境,则还可以从IDE部署到本地glassfish。 This is an example for Eclipse . 这是Eclipse的示例 Connecting your IDE to your local glassfish has the advantage of allowing you to publish changes as you make them. 将您的IDE连接到本地glassfish的优点是允许您在进行更改时发布更改。

If you're using the postgres jar file for the JDBC driver and Glassfish's Connection Pool, you will need to restart the server to deploy that file after copying it in to your domain/ext/lib directory. 如果将postgres jar文件用于JDBC驱动程序和Glassfish的连接池,则在将文件复制到domain / ext / lib目录后,需要重新启动服务器以部署该文件。

For the WAR, there is the asadmin command line client, your IDE may have direct support to deploy it from there, you can use the GF administration console, or you can copy the WAR in to the domain/autodeploy directory (assuming you have autodeploy enabled, which is it by default). 对于WAR,有一个asadmin命令行客户端,您的IDE可能直接支持从那里部署它,可以使用GF管理控制台,也可以将WAR复制到domain / autodeploy目录(假设您具有autodeploy启用(默认情况下为启用)。

There are also HTTP and JMX interfaces, but those are probably not what you're looking for. 也有HTTP和JMX接口,但是这些接口可能不是您想要的。

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

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