How to deploy on JBoss exploded web application from Eclipse Galileo? - eclipse

Is it possible to deploy on JBoss exploded web application(not archived war file) from Eclipse Galileo?

JBoss Tools supports exploded deployment with both "native" Web Tools(WTP) style projects (i.e. those projects created by the Dynamic Web Project based wizards) and via the generic Project Archives plugins.
If you already got a WTP style project then you simply just need to install jboss tools and create a server from the "JBoss Community" or "JBoss Enterprise Platform" category (The "JBoss" one is the WTP generic server which is very incomplete) and deploy your project to the server and it will by default be deployed exploded.
If you want to deploy in zipped form there is an option for this in the server editor (double click on the server in the server view and look in the deployment section)

We are using MyEclipse plugin for eclipse which has this specific capability, but it's a commercial plugin.
If you deploy your application only on JBoss, then you have the JBoss tools plugin for eclipse. According to their documentation they also support this mode and this plugin is free, but I have never tried it.

It has been a long time since I used it but, according to this post, it should be possible using JBoss Tools (previously known as JBoss IDE, before the merge with Exadel). Quoting the blog post:
One of my favorite feature in JBoss Tools is the "Project Archives" which provides automatic and incremental archiving of arbitrary directories into a zipped archive (jar,zip,war,etc) or into an exploded directory. Usable for any development that wants hot and/or exploded deployment.

Related

Integrating JBOSS and Eclipse

I have JBOSS server. I used to make web applications using just notepad++. I used to create the necessary folders like web-inf and files like web.xml. For larger projects doing all this and manually compiling has become cumbersome. I want to use eclipse for that. I saw this tutorial - http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html . But I don't understand how to make a server. I already have a server. What I want to do is write JSPs and Servlets in eclipse and the build should automatically be deployed in jboss server.
How to to this?
Install JBoss Tools
After that follow the instructions from here to get started and deploy apps to JBoss Server.
To automatically deploy apps after the build you could use a build tool such as ANT or Maven.
I wrote a tutorial for this some time ago: Setting up web development environments with Eclipse
It shows how to setup JBoss within Eclipse (in addition, it also shows how to setup Tomcat and Weblogic), and also shows how to build a simple sample Servlet to verify the proper installation.
If you already use JBoss on the server side, then have a look at the client side as well: http://www.jboss.org/developer
(I haven't tried it myself, but...)
Just open eclipse then go to:
"Help-> Check For Updates" It will check for eclipse updates and installs new availables.
Now "Help -> Eclipse Market Place" Search for "Jboss tools" from search result select one(as your eclipse version) and install it. It will add adapter for new jboss versions.
Now add new server from server view select Jboss version then next add your Home directory of jboss. Then finish.
Step 1 is optional but it sometime it helps.

Running Ear Project Out of Eclipse

My team is taking over an existing web product that is made up of 3 Maven projects: one for a WAR, one for a couple of EJBs, and one that contains a few JBoss config files and builds an EAR that contains the WAR and EJB-JAR from the other two projects. We use Eclipse Helios and are currently building the projects individually with maven install and copying the resulting EAR to an instance of JBoss AS 6 for testing. While that process works, I am exploring the possibility of somehow streamlining that process; ideally a setup where small changes are automatically published to JBoss. Can anyone recommend a resource for configuring our projects/Eclipse to publish changes to JBoss automatically?
Get yourself "Eclipse IDE for Java EE Developers" and install JBoss Tools. The combination of the two will allow you to configure projects and server instances such that it is easy to deploy and test incremental changes.
Note that for this to work, your projects need to be WTP conformant. If you aren't using WTP already, take a look at the structure and metadata of projects created with Dynamic Web Project, EJB and Enterprise Application Project wizards. Either copy your source into new projects or copy the metadata files and fragments (very carefully).

How do I - Incrementally deploy in debug mode and other wise using Eclipse Helios and JBoss Tools

Environment
Win7
Eclipse Helios, Eclipse 3.6.1
Java 6
Jboss Tools version 1.0.0.v20110123-0129-H10-CR1 from the nightly builds
Jboss 4.2.3
In the past I used MyEclipse, which is a paid tool. In myEclipse, it's easy to configure a JBOSS Server and then deploy
your webproject in it. While in debug mode, if I change a java class (OR JSP), its changes are immediately reflected under Jboss and
I can test that change, without doing any explicit redeployment
So myeclipse had these features working outof the box....
I'm trying to accomplish same functionality with Eclipse Helios and Jboss Tools
Case 1
I added the Jboss Server via Java EE perspective->Add Server etc...
And then added my WebProject to this Jboss Server
When I right click on this added project and publish from here, it runs an ant script, to create a single (Standard) war file...and it always does the whole thing over.
I dont get a choice to deploy it expanded and anything to specify an incremental deployment
Case 2
Since Case 1 didnt allow exploded war and anything incremental, I decided to use JBOSS Tools
So I opened, Window->Show View->Other->Jboss Tools->Project archives
Selected my webproject, after which it showed up in the "Project archives" tab
So then....Right click on the project name in "project archives" tab.....->New Archive->WAR...and I added my project to deploy in exploded form. ok.
Now if I right click on the added WAR and click "Build Archive (full)"....it deploys the whole web project. Everytime it does the whole thing, instead of incremental.
Since that option didnt do it incrementally, so I right clicked and clicked "Publish to Server". The window that pops up, doesnt show me any servers...from where do i add to this?
In summary....
A) I havent seen any way to incrementally deploy
B) When I'm in debug mode, my java file changes dont reflect immediately...I dont mind redeploying, but since its not incremental, its annoying to do the whole thing over and over.
So question is ...
1) How do I do an incremental deployment?
2) How do I configure this, such that my changes in java classes are reflected immediately when in debug mode.
btw I have seen people suggest an alternate soln to use a custom ANT script....But will ANT script incrementally deploy, if I use it's copy command?
Thanks
Amit
It's MUCH simpler than this.
Forget about JBoss tools Archives, simply use the WTP adapter that JBoss tools provides. This one does incremental deployment (like MyEclipse).
Make sure you install JBossAS Tools from JBoss tools (yes the name sucks). Its description is:
Provides a WTP adapter for JBoss AS 4.x and 5.x. Supports incremental and exploded deployment.
Dish the WTP Server adaptor you created earlier from "Add Server etc..." and do it again, but this time don't choose from "JBoss" but choose from the new folder "JBoss Community". You'll see several new adapters there with the red logo and a slightly different name (e.g. WTP bundled is JBoss v5.0 but the one supplied by JBossAS Tools is JBoss AS 5.0).
Alternatively you can also use JRebel, which does incremental deployment no matter what WTP adapter you use (you disable the automatic deployment in that case).

Integrate War-Plugin for m2eclipse into Eclipse Project

I set up a small web project with JSF and Maven. Now I want to deploy on a Tomcat server. Is there a possibility to automate that like a button in Eclipse that automatically deploys the project to Tomcat?
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process (eclipse/m2eclipse).
Can you link me to help or try to explain it. Thanks.
I set up a small web project with JSF and maven. Now I want to deploy on a Tomcat Server.
During development I recommend to use Eclipse Web Tools Platform (WTP). M2Eclipse provides support for it (assuming you have Maven Integration for WTP installed) and your project should be recognized as a Dynamic Web Project runnable on a Server.
So, declare Tomcat as a Server (show the Servers view and right-click in it to add a Server via New > Server). And deploy your project to it (right-click on your project then Run > Run on Server).
There are other options like using the Tomcat Maven Plugin or the generic Cargo Maven Plugin but I wouldn't use them for development and, since you are a Maven beginner, I don't recommend them at all. Use your IDE.
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process.
Actually, the Maven War Plugin is only responsible of the packaging of your webapp project (it is bound automatically on the package phase when using a <packaging>war<packaging> for your project). It isn't used for deployment. But as I said, use your IDE to deploy your application during development.
The war plugin is for generating war files, not for deploying them. What you are asking for may be provided by the Cargo Plugin. Another interesting candidate for you could be the jetty-maven-plugin.

How to redeploy the web app using the Eclipse IDE

Im new to Eclipse. I use Tomcat as my run time server, but every time I modified the jsp pages, Eclipse was still displaying the older one. Just wondering how to redeploy the application so the changes can be reflected.
Eclipse: Eclipse IDE for Java EE Developers 1.2.1.20090918-0703
Tomcat: Tomcat 6.0
Thanks
Doubleclick the server instance in question in the Servers view to open its configuration. Now, in the right top you should see a section called Publishing. Open it to verify and configure autopublishing settings.
Eclipse should do that automatically for you.
Otherwise, on the Servers view (Menu Window->Show View->Servers), you can right click on your Tomcat instance and hit "Publish" or "Restart"
Make sure you have the "JST Server Adapters" ("Web, XML and Java EE Development category") feature installed.
Eclipse's publishing functionality requries the project to be a "web project", and in some cases requires additional configurations.
Go to Windows > Preferences > Server > Runtime environments and add your tomcat
Either try using publishing, or (better I think) use the FileSync plugin. There you can tell which folders from your project should be copied (live) to what directory on your machine (the tomcat/webapps/yourapp). With a little more effort the filesync configuration can be made machine independent (only using one parameter as TOMCAT_ROOT), in case you want to check-in the project to a repository where others will use it.
Get the Tomcat plugin. It was nice because you can install Tomcat on your system and then associate your web app with that instance of Tomcat. The plugin will let you stop/start Tomcat and define a server such that when you do a build it knows how to deploy the changes. There may be some newer plugin but the Tomcat plugin worked for me and was fairly simple to install and use. Here is a page from IBM on using Eclipse and Tomcat. Inside that page it points you to the following: http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/