JBoss Hot-Deployment with Eclipse

I'm searching for a usable solution to hot-deploy a web project with Servlets, JSPs and a lot of dependent Java Projects and JAR files into Jboss.  I hope I use the right words for it. I mean I want to just save a JSP or a Java class in Eclipse and it should be used by JBoss right away. Without running Ant-Tasks  and without restarting Jboss and without restarting the web context.

I used MyEclipse for  it which worked fine but now I have reasons to no longer use MyEclipse. So I have a standard Eclipse 3.4.1 (with WTP) here and I don't find a nice solution. When I use WTP for the deployment then hot-deployment works fine for Java classes but every time I modify a static file then Eclipse rebuilds a WAR archive and moves it into the jboss which then restarts the web context. This is not usable. My web application is pretty huge and building the WAR takes lots of seconds and starting the web context also takes pretty long.

So is there any other possibility?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaitu chaituCommented:
u said for normal java classes hot deployment is working fine.for which files its rebuilding?what do u mean by static file? are you touching web.xml file for restarting the server?
kayahrAuthor Commented:
I mean HTML, JSP, CSS, JS, PNG, stuff like that.
You can redeploy the web application from administrator console

Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

kayahrAuthor Commented:
Well, I don't want to redeploy the web application. I try to explain again. I'm talking about local deployment during development. Deployment on a production server is not a problem. We have scripts for that and we restart Jboss for it anyway so no need to hot-deploy here. I'm just talking about a local JBoss installation where we test our stuff during development. And we just want to save our files and press F5 in the browser and we want to see our changes right away.

With myEclipse it worked like that: The web was deployed ONCE and after that each file modification was "hot-deployed" into the jboss. So if I modified a java class then the change was immediately visible in Jboss so I could just hit F5 in the browser and it worked. When I modified a JSP or some other static file then MyEclipse copied this file immediately to the deploy directory of jboss so the file was immediately visible when I hit F5 in the browser. So development is pretty fast with MyEclipse: Save your changes and test it immediately in the browser without doing a full deployment and without the need of reloading the web context or restarting Jboss or whatever.

Now I have reasons to no longer use myeclipse and I'm searching for an alternative. The alternatives I have found so far are:

1. Using Ant build scripts. Everytime I change a file I run an Ant target which copies the modified files into the JBoss deploy directory. Works, but is pretty slow because the Ant target must walk through ALL files to find out which one is new/modified. So this solution has two problems: I must start an ant target everytime I want to test my changes AND I must wait a long time for this ant target to complete.

2. Using WTP in Eclipse. This partially works. Like in MyEclipse I do a full deploy once and after that changes done to Java classes are magically hot-deployed into the Jboss. But this does not work for static files (HTML, JSP, ...) Everytime I save a static file in Eclipse the following happens: WTP creates a new WAR which takes pretty long (because the project is pretty large) and then it copies this WAR into the deploy directory of jboss. So Jboss now sees a new WAR and redeploys the web which also takes pretty long. It's possible to deactivate this behavior in Eclipse but then changes to static files are not communicated to JBoss at all.

3. Using a complex structure of symlinks to link all classes, libsand static files directly into the jboss deploy directory. This works great on Linux (And should work for Mac, too). No need to deploy the stuff, no need for a special Eclipse extension. Only problem is: it doesn't work on Windows because this stinking operating system has no symlinks (NTFS Junctions are not a full replacement and have some serious problems with data integrity).

So all three alternatives have problems. And I'm searching for more alternatives. Hoping that there is one that works.
Given the constraints you have the ideal way to do it to write a eclipse plugin, which would may not be preferable. The other option you can choose is to use ant scripts and set preservetimestamps attribute to true while copying the file so as it will copy only the modified files.

You can also set the ant file as builder so whenever any file gets modified, it will be invoked. The way to do that:

1. Select the project and right click
2. Select Properties on the context menu
3. Goto Builder on section
4. Click on New button on right hand side
5. Select "Ant Builder"
6. It will open a dialog where you can select the ant file and the target you want to run on each eclipse build operations like clean, manual build, auto build.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kayahrAuthor Commented:
@Ajay: I know the preservetimestamps attribute and this is already used if we use Ant for deployment. Problem is our Project is so large that even "scanning" the project for new files takes too much time. So maybe writing an eclipse plugin would be a better option... Well, I'll wait some time for more answers. If nothing better comes the way then you'll get the points.
chaitu chaituCommented:
we are also using myeclipse for hotdeployment in jboss quite successfully.i think hotdeployment is possible only with jboss-myeclipse combination.if i go for another server like oc4j,websphere etc then may be hotdeployment is not possible even with myeclpise also .am i correct?if i want to acheive hotdeployment with other servers what changes do i make?writing eclipse plugin is only one option?

tomorrow we  can also shift from myeclipse to eclipse so whatever things you are doing  if you can share with us it will be helpful for the future purposes?. what do you say?

kayahrAuthor Commented:
As I said I give the points to Ajay because no better solution than writing an eclipse plugin was mentioned. Before we try to write an eclipse plugin we are going to use Junctions and Hardlinks on Windows to link the projects into the JBoss (Have to tell the Windows developers that they MUST NOT delete these links with Explorer...)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.