i am using eclipse server to the publish my web application to my local tomcat server.Whenever i modify
java or non java resource, it gets published to server(as i have selected automatically publish when resource change).But problem
is as soon as resource is published, server gets restarted which i want to avoid as it takes ample amount of time. How to avoid server restart ?
I think you are looking for hot deployment?
Heres a good tutorial I seen a while ago http://www.mkyong.com/eclipse/how-to-configure-hot-deploy-in-eclipse/
Whenever you change your code, Automatically eclipse detect your source has modified, and start redeploying your actual code into server. So that Tomcat server is restarting in a particular time interval.
You can configure tomcat for reload automatically, configure the attribute reloadable to true of the Context.
For do Tomcat 7 you must do.
Edit CATALINA_HOME/conf/context.xml
Change:
<Context>
For:
<Context reloadable="true">
Where CATALINA_HOME is your tomcat installation.
clicks on the “Module” view, make sure “Auto Reload” is “Disabled“. Default is enabled. It will stop the auto restart.
To do it in one go for all modules
In server options, uncheck option Modules auto reload by default
Also have a look at Stop Eclipse restarting my web app on file save
Related
I am new to using the JBoss 7.1.1 server and am confused by a behavior that I have observed.
My JBoss server is deploying the six jBPM .war files (designer, drools-guvnor, jbpm-form-builder, jbpm-gwt-console, jbpm-gwt-console-server, jbpm-human-task-war) which I have placed in the .\jboss-as-7.1.1.Final\standalone\deployments folder.
When I launched the server for the very first time it detected these files and deployed them. I see the deploymentNNN and tempNNN folders appear in the .\jboss-as-7.1.1.Final\standalone\tmp\vfs folder. This is similar to the behavior I'm familiar with from my use of the tomcat server.
I then shut the server down and observe that the two folders created in .\jboss-as-7.1.1.Final\standalone\tmp\vfs are retained but their contents are automatically deleted. When I restart the server it once again deploys the six jBPM files into a new pair of folders in .\jboss-as-7.1.1.Final\standalone\tmp\vfs.
This is very surprising because no changes have been made to the six jBPM files and the problem is that this redeployment takes 3 to 4 minutes.
If this was just happening in a "production" environment then perhaps this would not be much of an issue. However, I am trying to integrate the JBoss server into use with Eclipse Kepler in a development environment and having to wait 3 to 4 minutes for each code change and server launch is not practical.
1) Can anyone explain why JBoss goes to the trouble to redeploy files that have not been changed?
2) Is this a behaviour that can be changed through a configuration setting?
3) Is there any settings where we can stop the jboss to redeploy the war files when it restarted
Thank you,
All
In order to stop JBoss from re-deploying your apps (and deleting on shutdown),
try deploying the apps in unpacked form.
extract the files to {name}.war directories (e.g /designer.war, /drools-guvnor.war)
and then deploy these directories (i.e copy them to the deployments folder)
Alternatively, try to deploy them using the JBoss CLI
Deploying differently won't change the fact that at startup JBOSS reloads your application to the JVM.
This can take time because your application stores data from database to your server memory. (You could as well be hitting this WFLY-925 bug... Or the one they are talking about here...)
The thing is you normally don't need to restart your server completely when redeploying. You can hot-deploy your module - see also full doc. at Auto-deploy mode. (make sure the feature isn't disabled
If you need some context to be reloaded, I advise you have a specific procedure in your code that you can call to reload all cached info. instead of restarting completely (e.g. have a call to a specific URL from your application do it...)
I'm trying to update a couple of JAR files after my web application starts and doing a restart for the changes to take effect.(requirement)
The problem is , the session information is being persisted by tomcat. Yes, I do have a "sessionEventListener" listener in my application, but that shouldn't be a problem IMHO.
I want everything to start afresh from tomcat ( running standalone) , be it sessions, cache, or any information about the web application given to tomcat, except for the WAR file of course.
Any help would be appreciated.
During development (in Eclipse) I usually use 'Clean Tomcat Work Directory' option found when right clicking on Servers view. That will wipe all session related data.
In your tomcat 7 context.xml you can add/uncomment this line to clear all sessions on tomcat restart.
<Manager pathname="" />
I developed an application having mailing operation in it, I am using tomcat 6 for deploying the application, I have ant script for building the war.
Now my problem is whenever I build the project, mailing stops working until I restart the server, and I came to know from one of professional saying that mailing context needs to be reloaded hence when you restart server the mailing works again.
But I don't want to restart the server every time I deploy new build, at the same time mailing should work. Is there any way to reload the mailing context when ever I build the project and deploy?
To make context reload on application file modification change the context.xml configuration file
from
<Context>
to
<Context reloadable="true">
My company is preparing a new production box while the current one is running. I would like to proactively install applications in Tomcat container of the new production box but would like to keep them disabled (similar to the feature present in Websphere) - this is very important because some of the applications poll for the data from the database and starting an application would interfere with current production deployment. They would be enabled at the time of production switch-over.
How would I accomplish this? Any insight would be greatly appreciated.
You can simply rename de WEB-INF directory inside the webapp that you don't want to auto-start to some other name like Disabled-WEB-INF, before starting tomcat.
Later on, if you wish to start that app, while tomcat is running, simply rename back the directory to WEB-INF.
add deployIgnore attribute in <Host>, and the value is the regular expression of the dirs you want to ignore, if you want to ignore foo,just set deployIgnore="foo" and you want to ignore more dirs,use regular expressions to set the values
In the <Host> element of your conf/server.xml put deployOnStartup="false". Reference: Tomcat Host documentation
You can use tomcat web application manager; this webapp does let you stop any application inside tomcat from running.
I would like to know if its possible to deploy java class files without restarting JBoss server. I am using jboss v4.2.2.
Also, when I try to deploy jsp files, it works fine and server picks up the changes almost instantly.
Thanks a lot in advance :)
I'm better with Tomcat than JBoss, but it should be possible (as in Tomcat) to restart the application without restarting the app server. If the server has a "development mode" and this is active, then it should be possible to trigger an app restart simply by touching WEB-INF/web.xml, i.e. updating its timestamp. That should get your previously replaced class file loaded.
Theoretically, you never have to restart the whole server, you only restart specific applications (ear-s). JBoss (with default settings) will automatically redeploy your ear if it notices any changes in it. Just copy the new version over it.
If you're not using it already, check out JBoss Tools set of eclipse plugins, to simplify whole process of deploys during development: http://www.jboss.org/tools
Yes, it is possible to re-deploy your class files without stopping and starting the server each time.
The only thing you have to do is to make a junction or a symbolic link to the application directory (in eclipse is usually "WebContent") and put the name you want in Jboss.
I've made a step-by-step tutorial here.
Deploy the app as exploded (project.war folder), add in your web.xml:
<web-app>
<context-param>
<param-name>org.jboss.weld.development</param-name>
<param-value>true</param-value>
</context-param>
Overwrite the web.xml every-time you deploy:
set PRJ_HOME=C:\Temp2\MyProject\src\main\webapp
set PRJ_CLSS_HOME=%PRJ_HOME%\WEB-INF\classes\com\myProject
set JBOSS_HOME= C:\Java\jboss-4.2.3.GA-jdk6\server\default\deploy\MyProject.war
set JBOSS_CLSS_HOME= %JBOSS_HOME%\WEB-INF\classes\com\myProject
copy %PRJ_CLSS_HOME%\frontend\actions\profile\ProfileAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\ProfileAction.class
copy %PRJ_CLSS_HOME%\frontend\actions\profile\AjaxAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\AjaxAction.class
ECHO.>>%JBOSS_HOME%\WEB-INF\web.xml