Turnaround Time in Spring JBoss Eclipse - eclipse

I am currently writing a site in Spring, Thymeleaf, JBoss and I am using Spring Tool Suite. The turnaround time is horrible. I have to recompile and package the app, every time I make a change and then push it out to the server. How to make my turnaround time quicker?

Try JRebel. You can get it free if you spread some social media love for them.
http://zeroturnaround.com/software/jrebel/

Consider using a tool which supports continuous integration, and which supports working on an exploded war file.
For example, sbt supports that mode. It integrates jetty, and the webapp is restarted, if a source file changes (resources like .html, .css and .jsp do not restart the container).
As for details look here: Eclipse + Tomcat - Serve webapp directly from workspace. This question shows other possibilities as well.
If you use EJB features like session beans, you can split your project. If the EJB and pressentation is kept separate, the turn around times for redeploying EJB ears are acceptable.

Related

Glassfish: Fast hot deployment setup

What is a good setup for really fast hot deployment of a Java EE application to Glassfish, so the changes are visible in less than e.g. 1 second?
Currently I'm using Eclipse Luna to develop a JSF2.1 application on Glassfish 3.1.2. When I change something in a jsf, a managed bean or an ejb, it takes ages to deploy the changes. I've already found some good advise,
GlassFish (real) hot deployment of JSF pages and resources (CSS etc.) in Eclipse
Glassfish taking 20s to do hot deployment, is that right?
but I don't think I can speed up my setting to get the deployment under e.g. < 1sec. Also I think "directory deployment" is not supported in GF3.
So what setup can you recommend? Should I switch to Netbeans? Or are there any hidden Eclipse settings to speed this up? Or do you reach fast hot deployments with Eclipse Luna and I'm just missing some properties?
Some more information: I have to use GF3.1.2 Furthermore I use maven, the backend jar and the front end war are bundle together in an ear file. I use EJBs and JPA to connect to a DB2 database. So except GF nothing special.
As far as I know, Glassfish does not support hot deployment. You would need something like JRebel to accomplish that. In case you're not bound to glassfish you might consider switching to wildfly or some other AS that supports this feature.

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.

Glassfish webapp auto-deployment

I am using Eclipse with Glassfish plugin with a complex project consisting of several webapps and EJB projects.
Each time I change some smallest thing in JSP or CSS, the whole webapp is redeployed, which wastes a lot of development time on waiting.
In Tomcat, which I use in parallel (also as an Eclipse "Server" added through Eclipse GUI), things work like a snap - everything is deployed right away without delay.
So, is there a way to enable partial/changes-only deployment of web applications for Glassfish v3.1 and latest Eclipse?
How do you quickly deploy your projects using Glassfish v3/Eclipse combination?
This does not really answers your question but an alternative approach is suggested.
I have not seen the Glassfish plugin but while I use MyEclipse that contains deployment customization options. We do it using exploded deployment
Go to manage deployment
select externally launched
Hit Add - Select Project
Select the "Exploded deployment" (development mode)
This should take care of your faster deployment.

How to create stand-alone lift web application?

How to make a standalone lift application? Which tools/libraries to use? How does the performance compare to using lift application as a war in some application server?
With onejar maven plugin http://onejar-maven-plugin.googlecode.com/svn/mavensite/usage.html and maven I could package jetty and project with dependencies inside one jar.
The part of the question on performance doesn't really fit with the rest. You are primarily asking how to package the Lift application as a single JAR/WAR. This doesn't have anything to do with the runtime.
At runtime you will still be running inside a Servlet container (could be Jetty, Tomcat or a full-blown Java EE server). How you package your application won't affect the performance.
You could take a look at Hudson (a great Continuous Integration Server) to see how they deliver as a single WAR file that contains an embedded Servlet container. You can download the WAR file and run it from the command line: java -jar hudson.war
I know this is an old question, but...
If you are using sbt, I wrote a plugin to produce 'executable' wars like those mentioned above.
https://github.com/glenford/sbt-jetty-embed

Speeding up Eclipse and JSF+Tomcat development

Is there any way I can speed up the development of JSF in Eclipse and Tomcat?
Basically I'm looking for a way to make the client-side changes (.jsf, .html, .css, .js) to happen a lot faster, and with out having to restart tomcat.
And if possible, also a way to make tomcat (or any other Windows + Eclipse compatible Servlet Container), restart a lot faster.
Because if I compare to my experience with ASP.NET/Visual Studio/IIS, it feels like I'm spending half the day waiting for Tomcat to restart, and sometimes I even get 404 in the browser, since it's not going fast enough.
There MUST be some other way to be more productive, and still allow more test driven development.
Just in case you use Maven to build your project, you can use this command line to test in Tomcat:
mvn clean war:exploded tomcat:run
That will run a slim instance of Tomcat (tomcat:run) taking the changes of your web files (.jsp, .html, .css, .js) directly from the source you're editing (war:exploded), so you'll just hit F5 in your browser
A quick and dirty way to force Tomcat to recompile/reload your pages is to delete Tomcat's working directory. In my limited testing it works fine but obviously, I wouldn't recommend this in production. :)
I believe MyEclipse, if configured correctly, will let you update applications running in Tomcat without restarting Tomcat. It is unfortunately a commercial product though.
Oracle JDeveloper had a copy of OC4J bundled and it was possible to make changes on-the-fly without restarting the container, again this may not be possible given your environment.
If I'm not mistaken you can just copy your client-side changes (.jsf, .html, .css, .js) to the webapps folder of your application, whilst it is running. The jboss J2EE version of Eclipse I'm using allows hot replacement of some java code.
You can use some other container, not tomcat, which not needed to be restarted when you make some changes in you project. It's can be Jboss. Also If you will use some tools, for example JBoss Tools, you develop much faster and easy :-)
As for me, when you make changes just in .css or .xhtml page, you shouldn't restart tomcat, you should just republish you application. In JBoss Tools you can make it using JBoss Tools server view.
put this in your web.xml.
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>1</param-value>
</context-param>
This means : "how often will the app server recompile my JSP". The value is in seconds.
You should use Dynamic Web Projects and tell Eclipse Java EE to deploy to a suitable Tomcat instance. This will allow Eclipse to help all it can (but that is still not blazing speed though).