[英]Auto start glassfish with RESTless service
I've been looking for instructions on how to automatically start my GlassFish server with my RESTful application on top of it. 我一直在寻找有关如何使用我的RESTful应用程序自动启动GlassFish服务器的说明。 I have it installed via the NetBeans IDE and I normally control it through NetBeans but I need to transition away from the dev environment to a test environment.
我通过NetBeans IDE安装它,我通常通过NetBeans控制它,但我需要从开发环境转换到测试环境。 Links to tutorials would be appriciated.
教程的链接将受到关注。
Create a WAR or EAR and put it in the autodeploy folder in the domain. 创建WAR或EAR并将其放在域中的autodeploy文件夹中。
Then it will start every time Glassfish is started. 然后每次启动Glassfish时它都会启动。
Additionally under Windows you can use the asadmin create-service
facility to create a service (.NET required). 此外,在Windows下,您可以使用
asadmin create-service
工具来创建服务(需要.NET)。
How to start a Glassfish instance when the server starts: that's operating system dependent, on Windows it involves registering Glassfish as a service , for Linux you can follow this tutorial . 如何在服务器启动时启动Glassfish实例:这取决于操作系统,在Windows上它涉及将Glassfish注册为服务 ,对于Linux,您可以按照本教程进行操作 。
How to start an application with Glassfish, or how to migrate an application from the instance embedded in Netbeans to a production server: two easy ways 如何使用Glassfish启动应用程序,或者如何将应用程序从嵌入Netbeans的实例迁移到生产服务器:两种简单的方法
Build
a project in Netbeans, a dist
subdirectory will be created in the project directory - switch to the Files tab to see it. Build
项目时,将在项目目录中创建dist
子目录 - 切换到“文件”选项卡以查看它。 That directory will contain the compiled and packaged projet (jar, war or ear depending on the project type). dist
subdirectory. dist
子目录上载文件。 Personally I prefer option 2 but that may be a matter of taste. 我个人更喜欢选项2,但这可能是一个品味问题。 Thorbjørn already explained yet another possibility, via the autodeploy folder.
Thorbjørn已经通过autodeploy文件夹解释了另一种可能性。 Whichever you choose, the application will start once deployed and will automatically start every time the Glassfish server starts.
无论您选择哪个,应用程序将在部署后启动,并在每次Glassfish服务器启动时自动启动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.