简体   繁体   English

如何在Eclipse中的Jboss上重新部署应用程序?

[英]How to redeploy an application on Jboss within Eclipse?

I'm developing a spring-based application with facelets and Java Server Faces which works on Jboss Application Server. 我正在使用Facelets和可在Jboss Application Server上运行的Java Server Faces开发基于Spring的应用程序。 As a development Framework, I'm using Eclipse Ganymede Platform Version: 3.4.2 , which integrates the Web Standard Tools and therefore offers support for different servers, like Jboss 5.0. 作为开发框架,我使用的是Eclipse Ganymede平台版本:3.4.2,该版本集成了Web标准工具,因此为不同的服务器(例如Jboss 5.0)提供支持。

I'm deploying my app on Jboss within Eclipse. 我正在将我的应用程序部署在Eclipse的Jboss上。 First time it runs fine, but when I try to make some changes and republish my application, it just doesn't get it, so I'm forced to restart the server. 第一次运行正常,但是当我尝试进行一些更改并重新发布我的应用程序时,它没有显示,因此我被迫重新启动服务器。 This is quite annoying since it takes about a minute or so each time I have to restart JBoss. 这很烦人,因为每次我必须重新启动JBoss都需要一分钟左右的时间。

So, the question is: is there any means to redeploy apps on Jboss without having to restart it? 因此,问题是:是否有任何方法可以在Jboss上重新部署应用程序而不必重新启动它?

Consider the use of JBoss tools plugin. 考虑使用JBoss工具插件。 It significantly improves the experience of development with Eclipse and JBoss. 它极大地改善了使用Eclipse和JBoss进行开发的经验。 http://www.jboss.org/tools http://www.jboss.org/tools

If you manage the JBoss (start/stop) using the eclipse you should be able to redeploy directly form the eclipse. 如果使用Eclipse管理JBoss(启动/停止),则应该可以直接从Eclipse重新部署。

If you are deploying to the deploy directory, then running over the original war/ear will cause it to re-deploy. 如果要部署到deploy目录,则在原始war / ear上运行将导致其重新部署。 Notice that depends on your app size you may encounter OutOfMemoryErrors. 请注意,可能会遇到OutOfMemoryErrors,这取决于您的应用程序大小。

What we do (though it doesn't always work) is that we deploy an ear, run the JBoss and debug remotely using the JPDA. 我们要做的(尽管并不总是可行)是部署一个耳朵,运行JBoss并使用JPDA进行远程调试。 When we make a change (as long as you do not change the signature of a method) it hot swaps the class to the one with the change. 当我们进行更改时(只要您不更改方法的签名),它将与更改进行热交换。

If your deploying a WAR file then the easiest way is to use the 'servers' plugin in eclipse. 如果您要部署WAR文件,那么最简单的方法是在Eclipse中使用“服务器”插件。 MyEclipse comes pre-configured. MyEclipse已预先配置。

Here you will be able to select your servlet container and will have full control within eclipse. 在这里,您将能够选择servlet容器,并在eclipse中拥有完全控制权。 No need for any ANT files or need to leave your Eclipse IDE. 不需要任何ANT文件,也无需离开Eclipse IDE。

In order for this setup to work, your project needs to be a 'Web Project'. 为了使该设置起作用,您的项目必须是“ Web项目”。

Once you have setup your web project, hit the configuration button in the servers window, select your web project and add it. 设置完Web项目后,在服务器窗口中单击“配置”按钮,选择您的Web项目并添加它。

Then hit the run/debug button on the servers screen. 然后点击服务器屏幕上的运行/调试按钮。

The only gotcha is, you need to make sure your source classpath points to WEB-INF/classes not target/classes in order for hot deploy to work. 唯一的难题是,您需要确保源类路径指向WEB-INF /类而不是目标/类,以便热部署正常工作。 The maven plugin eclipse:eclipse resets this so beware. Maven插件eclipse:eclipse会重置此设置,因此请当心。

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

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