how to get jboss tools to not automatically deploy on server start - eclipse

ive just upgraded to eclipse 3.6 and i have a seam application running on jboss 5 with the latest version of jboss tools. my problem is that when i opened an xhtml page it asked me to activate the jsf components. i went ahead and did so and now my problem is that when i start jboss inside of eclipse it automatically deploys an exploded version of my app. i don't want this, i use ant to build and deploy the app and just use jboss tools to start and stop the server. i need to turn this feature off, does anyone have an idea how to do it?

Double click the server and select the radiobutton that says "Never publish automatically"
btw. you can also enable "Deploy projects as compressed archives" if your problem is that the deployment is exploded.

Related

JBoss ejb3.0 instant hot deployment

I am newbie with jboss-eclipse. I have to work on javaEE5 with JBoss AS 5.1.0.GA. I don't want to use JRebel at the moment.
I installed "Eclipse Java EE IDE" with "JBoss Tools". I added the JBoss 5.1 Runtime server on eclipse and added a new ear project with :
an EJB3.0 class in ejb project;
a javabean class and index.jsp in web project.
I noticed when I make a modification in the jsp file, I can see instantly the changes after refreshing the web browser. That's ok.
When I modify EJB and javabean classes, there is no instant hot deployment. I have to restart the ear application (without restrating jboss server) or "full publish" the ear via eclipse to see changes.
Is there any way to have instant hot deployement for EJB and javabeans?
PS: I tried "incremental" publish but it hasn't worked.
Thank you!
You do need 3rd party tools for that, the most notable being JRebel. Without advertising I have to say this tool has saved me lots and lots of hours already while developing EE applications.
In jboss AS 7.1.1 you just have to go to the as admin console at localhost:9990 and select: Profile -> Core -> Deployment Scanners -> Auto-Deploy Exploded . You might also want to change the scan interval to something smaller. Afterwards, you may deploy your application for the first time by selecting "Run on Server". From this time on, your application will get automatically deployed whenever you change a file and it manages to compile.
I do not know if Jboss 5.1 has this feature, and if I were you I'd consider using 7.1.1 for development when it does not have it.
The hot deployment works fine with JBoss when publishing new files in your deploy folder, only class exchange will not happen in your currently deployed application.
That's why you see changes to all static content like HTML files immediately, but not changes to your java code.
In order to do activate them, you'll have to restart your application (not the whole JBoss, only your application, done for example in JBoss server view).
I have no practical experience with JRebel and I do believe that it saves you time, but you have to be careful with such tools, as they can introduce new problems which you spend much times in debugging, ending up in restarting the container and everything works fine.

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.

One click build and deploy using Eclipse/Maven/JBoss AS 7

I was wondering if it is possible to make a Java EE application being managed by Maven and automatically deploy it to JBoss all from Eclipse. To my knowledge I current right click on my project and select "Make install". After that completes, I open the server pane and right click on my deployed ear and either select "Full Publish" or "Incremental Publish". Is there a way to condense these actions into one click? I tried to write a windows batch file but I didn't have much luck with that, and it would only work for our devs working on Windows machines. I know I can make run configurations but when I try to make one it is very intimidating and I get frustrated and give up.
Thanks for your help!
You can use JBoss Tools 3.3.0 (Current milestone M4) with the maven integration to easily deploy projects (wars or ears) to your AS7 server.
Once you defined your AS7 instance in eclipse, all you have to do is right click on your project > Run As ...> Run on Server. It'll start your app server if it's stopped, or just deploy your app if it's already running.
See http://vimeo.com/25768303
and http://community.jboss.org/en/tools/blog/2011/11/09/jboss-tools-shift-happens-in-m4
If you are using maven, you can use the cargo plugin: http://cargo.codehaus.org/Maven2+plugin
You just configure where the JBoss is installed, set the plugin to run in the phase you want (or make a new one) and you are all set.
You can also create different configurations for different profiles, so you have local, integration, test, production, etc... And just by running with the selected profile deploys the ear in the server, remote or local.
If you want more control, you can set the path of the container as a variable that you pass in the Eclipse run configuration, that way each developer can have their servers in different paths.

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).

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/