Update an existing war on jboss EAP 7 without redeploy - deployment

On my Jboss EAP 7 server an application.war is deployed. Now i want to update and add some class and jsp files.How can i update existing war without deploying whole war?

#ehsavoie as per your suggestion I can change only jsp file but for Web-Content files I need to restart the application and here is the catch that Jboss maintain the checksum of every deployed application but you copy your new file at an already exploded application. This doesn't affect checksum so, now after restart it explodes your last .war and your changes reverted.
Efficient way to partial deployment is use deployment:add-content command in cli mode.
/deployment=DEPLOYMENT_NAME.war:add-content(content=[{target-path=/path/to/FILE_IN_DEPLOYMENT, input-stream-index=/path/to/LOCAL_FILE_TO_UPLOAD}]
Here is the link if you want to read more.

Related

How to deploy two war files onto Jboss 6.4.0

I have two war files msg-producer and msg-consumer. How to deploy these two war files onto jboss 6.4.0 simultaneously?
currently deploying one war file like this:
copy war file into EAP\standalone\deployments folder
Run standalone.bat from EAP-6.4.0\bin.
Yes, you can deploy two or multiple WAR files into EAP\standalone\deployments folder.
Each web application will have a different context root, using context root you can access the application.
Yes, You can deploy two or more WAR/EAR files in the JBoss Application server.
Please go through the $JBOSS_ROOT/standalone/deployments/README.txt
There are two different modes 1. auto-deploy mode and 2. manual deploy mode
Manual deployment relies on a system of marker
files, with the user's addition or removal of a marker file serving as a sort
of command telling the scanner to deploy, undeploy or redeploy content.
Auto-deploy mode: The scanner will directly monitor the deployment content,
automatically deploying new content and redeploying content whose timestamp
has changed.
Read the README.txt for more details.
The simplest way I recommend is
Login the JBoss admin console
Under deployments tab, click on "add" and select the required msg-producer and msg-consumer war files. "Enable" checkbox to be selected.
Access the application http://localhost(or_servername):8080/contextroot/

what will happened if I put same or different name war in running jboss server

I am really new to jboss and I need to know some behaviors of jboss.
Here is my scenario, we are using jboss-6.1.0.Final
I am using jetkins for preparing war, now war is ready now I have planned to use FTP plugin to upload war on server. Up to this everything is fine but what I need to know is
I have ftp root path is C:\jboss-6.1.0.Final\server\RCM\deploy.
So if I deploy same war(or with same war with changing name) without stopping server because jetkins takes time to prepare war so I don't want to stop it until war is ready.
So my main query is what will happened if I put same or different name war in running server? will it stop currently running server?
Any help will highly appreciated.
It will not stop running server. It could start redeploying war if war name is same.
if it has different name then It could start deployment of new war.

How to do hot deployment in Jboss5

I have got a maven project.
So when ever there is a changes done in java file, we take a rebuild of the application .
Put our ear file in deploy folder of jboss and restart the Jboss.
This waste our lot of time in restarting jboss again and again .
I heard about hot deployment in Jboss .
Can any one tell how to do in my case .
Hot deploy is enabled by default in JBoss AS 5.
It should start automatically a couple of seconds after you put ear in deploy folder.
Maybe someone had previously disabled hot deployment on your instance.
Then see Turning off JBoss hot deploy service? and do the opposite.
As I understand, u need a class reloading solution, not auto redeployment.
I recently work out a solution with JBoss 4.x. It probably work with JBoss5.x too. In most of time when I change my code, it reflects immediatly and no redeployment in JBoss.
Here is how:
Turn off JBoss hot deploy service, u can google how.
Create a folder named project.war under JBoss deploy folder, it just works like a war file.
User a file sychronize tools(like FreeFileSync) to sychronize your_project_web_root folder to the project.war folder.
The most important part, use spring-loaded. It's easy and no need to change anything in your project.
4.1 Download springloaded.jar
4.2 If u are using eclipse, just add the following code in the VM arguments of the JBoss Run Configuration.
-javaagent:/springloaded-{VERSION}.jar -noverify
That's it. Now u modify/add methods or fields in a class and then sychronize the class file to the project.war folder, JBoss will reload it and the changes reflect immediately. But springloaded still got some limitation, read the FAQ.

JBoss 7 as deploys automatically

I put my jboss on the linux server, exported the war file and placed it on the deployments folder and it automatically deployed. I didn't even had to do it via command line. How is this working?
My jboss has ssl to it.
From the Application Deployment documentation:
The standalone/deployments directory in the JBoss Application Server 7 distribution is the location end users can place their deployment content (e.g. war, ear, jar, sar files) to have it automically deployed into the server runtime.
So, if you put a war file in standalone/deployments, JBoss will detect it and act as if you had manually deployed it. The documentation page has a lot more info about configuration if you want to change the defaults.

Can someone explain what GlassFish does with deployed directories

I have an exploded directory that I am editing in eclipse (created via setting location to directory location when creating New Project, deployed directory already existed). When I deploy this directory from the command line, it does not seem to save it locally (anywhere within glassfish\domain_
If I create a Java EE application in eclipse from scratch and deploy it from Eclipse Run -> on server, it copies it to glassfish\domains\domain1\eclipseapps
Is there a way to have GlassFish save deployed directories locally without using the GlassFish plugin magic?
Short Answer: No.
The whole point of directory deployment is speed and development convenience.
You tell GlassFish to not copy any files at all but to, instead, use the files already laid out on disk.
If you want to run from a copy of your app then just deploy the archive (war/rar/ear/jar) file.