What it is the best combination for fast development Java EE projects in Eclipse.
What i try to get is
Fast application server start
Hot deploy in both web-app and ejb modules.
Editing jsp without server restart
I found out for myself that best choice when developing webapp application is using WTP for Eclipse with maven plugin.
It give me all feature of WTP and also provide with up-to-date building script, that can be used outside of Eclipse, and also it simplify jar management.
I'm looking for something similar when developing Java EE application. What is the best combination of Java EE server(should i use Jboss or Glassfish) and Eclipse plugins ?
WTP is completely sufficient:
it allows you to start and stop servers and redeploy applications (see the Servers view)
allows hot swap - i.e. replace the class on save (unless you have made structural changes) (just start the server in debug mode)
jsp pages can be edited without restart with default configuration of most servlet containers.
Related
I am new to Java EE. I want to setup Java EE environment to begin developing web applications. I read through articles on internet but they seems to be confusing. My question is that is there any one time installer for Java EE development environment setup? I mean like we have for PHP is that WAMP, XMPP, LAMP etc.
There is no single installer, but two will be enough - you will need an IDE - the most popular are Eclipse and NetBeans. And you will need a Java EE distribution which comes in the form of a Java EE compliant application server - the most popular ones are JBoss and Glassfish. With both IDE and server all you have to do is unpack them into folders of your choice.
The JavaEE distibution of NetBeans already includes GlassFish - even less to do for you ;)
As a prerequisite, you will need an installed JDK, a JRE won't do.
EDIT : In order to control the server and deploy from eclipse you will have to tell it where your application server is - there are according plugins for Glassfish and for JBoss.
I'm not sure about JBoss integration with NetBeans - never done it, but NB intagrates seamlessly with Glassfish.
Glassfish incldes a Derby (JavaDB) distribution, and JBoss includes a H2 DB distribution which both will be enough to start.
Using MySQL or other databases will require a bit of configuration, so if you're just starting - don't bother yet.
You might want to use Eclipse Juno Eclipse IDE for Java EE Developers,
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1
I'm interested in doing some Java web development but I'm not really interested in using Eclipse. I have used Eclipse in the past and to me it seems to add a layer of abstraction that I'm not really interested in. However, I'm having a bit of upstart problems.
Does anyone have any good references/tutorials in getting up and running with Java web development without using Eclipse (or any other IDE for that matter)?
Create a maven project and use one of the embedded web servers like jetty or Glassfish.
Also, this approach allows you to work with the command line directly or use either Netbeans, Eclipse or IntelliJ as your IDE as they support Maven projects. I do not think that JDeveloper can yet.
(Eclipse may require the m2e plugin from the marketplace, and it handles all the Eclipse configuration transparently and directly. Highly recommended).
You can easily do java web development using notepad only. The extra work is, you have to write some extra code (like in servlet you have to write web.xml http://www.tutorialspoint.com/servlets/servlets-first-example.htm). Same in Struts, Hibernate and Spring framework, you have to write config file in notepad.
I use Eclipse "Dynamic Web Project" to create and test web application. It will publish my application on application server in convenient way. I don't need to write script, just wizard.
However, I am wondering it is a decent way to deploy a web application. What's your opinion? Thanks!
(I used to use Ant script to deploy my application, it's standard way.)
plus: Dynamic Web Project uses its specific directory layout which is different with Maven standard directory layout.
This is fine for deploying to a dev or test server. Its a convenient way to quickly deploy to have a look at changes you've made and to do tests.
I would definitely not allow this for any other environment, eg live, pre-production etc. You should have an established process (eg documented change control) to deploy to these environments.
I have heard it's still recommended to cold deploy and restart the server for not having a trouble with memory leaks, dynamic class loaders. For myself I think comfortable to deploy from Eclipse to most environments. Basically Eclipse WTP server adapter can run the same deploy command as the other processes. When I use clouds like GAE or Beanstalk I do deploy from Eclipse plugin, it is the same like command line.
I have a simple web application which will be running on machines which don't have internet connectivity.
I would like to support the ability to install, remove and support migration of WAR at a later stage. This would be our deployment scenario:-
The machines might not have Java and we would probably have to install it before deploying the application.
The web application (WAR) runs on top of jboss application server.
The application server needs to be run as a Windows service
The entire application will be shipped in a CD.
I don't want to spend too much time on building an installer, but what should we do support the above scenario? Are there any tools which help in handling this?
I recommend using a MSI package with an EXE bootstrapper which supports prerequisites. This should cover all your requirements.
Regarding a setup authoring tool, it depends on what you want (free or commercial, with a GUI or with scripting etc.). You could use a Visual Studio setup project and Orca, but a commercial tool will be easier.
I am developing a GWT application that uses EJB and other Java EE 6 technology as the backend. I am currently using the GWT 2.0 plugin for Safari.
When I change my GWT client side code and save in my IDE (NetBeans), all that's required is a simple reload in the browser for the changes to become active. That works great!
However, often I work on the server-side (the EJBs, GWT server code, etc) and then something in on the GWT client side. Any changes done to the server-side do not appear to incrementally deploy to the Glassfish V3 server. Currently I close the GWT Development Mode application, and then recompile the EJBs, and then go back into GWT Development mode. That is tedious.
Any better way of doing this? I tried the "deploy on save" option in NetBeans but it does not seem to do the trick.
The trick is to create an exploded ear directory (instead of an ear file) and deploy that in your application server. It works in JBoss and Weblogic, and should work in glassfish, but haven't tried it.
The idea is that you don't use any archives at all. In you war directories, create a WEB-INF/classes folder, and configure your IDE to write the class files in this directory. That way, when you change a java file in your IDE, it will write to your classes directory and the JVM will hot-deploy your classes.
There are some restrictions with this approach. If you change a method signature or add a class or new method, JVM cannot pick it up. In such cases, touching web.xml redeploys the WAR. This in itself is an improvement from restarting the entire application server.
It takes an hour or two to get the right setup, but after that you will just love it.