290 likes | 432 Views
Lessons Learned from using GlassFish and NetBeans BOF2764. Nathan Howard and Mark Stephens IDRsolutions. Who is talking. Full time Java Developers at IDRsolutions Work on PDF, HTML5, SVG in Java Make extensive use of NetBeans and GlassFish Involved in NetBeans 7.3/7.4 testing.
E N D
Lessons Learned from using GlassFish and NetBeans BOF2764 Nathan Howard and Mark Stephens IDRsolutions
Who is talking... • Full time Java Developers at IDRsolutions • Work on PDF, HTML5, SVG in Java • Make extensive use of NetBeans and GlassFish • Involved in NetBeans 7.3/7.4 testing....
Talk will consist of… • Introduction to NetBeans/GlassFish and why we use it • Interactive demos (Hello GlassFish!) • Hints and tips • Any questions • Stunned silence at end
Official disclaimer We will deny anything that we say in this talk (even if it is on video) No kittens were harmed (or neglected) during the making of this presentation.
What is NetBeans What does this mean?
NetBeans has come a long way • 15 years young. • It is not just Java and it is not just an IDE! • Fast development pace • First place many developments appear like JavaFX • A natural platform for GlassFish....
What is GlassFish? What does this really mean?
No Glass and no fish….
GlassFish consists of... • The actual GlassFish program • A server instance of this (which can be on your computer with NetBeans for development/testing or a remote server on the internet). • One or more web applications running on the server • Multiple client sessions running on client computers/phones/etc talking to the web applications You can run all on a single machine for testing and development
Client Applications Can be written in JSP, HTML, or any computer language Users may not even know you are using GlassFish...
Deployment Is installing the software or an update to the server. You cannot just overwrite the file...
2 use case scenarios • Make it very easy for client side applications to communicate in a secure way with Java code on our server, including file transfer • Allow non-Java developers to access our Java server application via web services (we can sell Java to non-Java users!) • GlassFish takes care of all the details.... Its a magic door...
Why did no-one tell us • RAD on NetBeans with local GlassFish is very fast • It is very easy to mix and match technologies (HTML5/CSS/Java) • System.out.println(“”) goes to server not project • What is the difference between a jar and a war file?
Demos • Hello GlassFish • Fundamentals - Tour of GlassFish • While Nathan was doing that, here is what I did...
TIPS A selection for GlassFish and NetBeans...
Does CapiTalisAtion and Spealing matter? When deploying a .war file, make sure as good practice it has the correct spelling and is case sensitive. This will save you lots of hassle on UNIX
Always uninstall NetBeans properly There are several ‘hidden’ directories which will all be properly removed. If you just delete NetBeans they will not...
Problem accessing GlassFish When accessing GlassFish from a URL, it’s important to include the correct port numbers, for example: https://glassfish.idrsolutions.com:4848 for the admin GUI
I do not use Netbeans because I already know all the shortcuts for Eclipse, IDEA, Vi, Emacs
3 War tips • Cleaning & Building Cleaning will delete the .war file, whilst building it will build the .war file. In the event where the glassfish server can't be stopped, make sure you clean and build the glassfish project at least twice. • Checking the Last Modified Time After you have built the .war file, navigate to the dist directory and ensure that the last modified time of the .war file matches the current system time. If the clean was not performed correctly then the .war file may not be replaced. • Deployment Always deploy a war in the correct way. GlassFish should always be stopped before you clean the project, otherwise you might get some dependency errors where a .jar is still in use by GlassFish.
Gotcha on builds • Make sure you have a stable build When building the .war file, make sure you build from a stable external .jar and not the linked project in Netbeans, otherwise it will compile the Netbeans project. • Remove the external .jar If you don’t do this then any future changes you make in the project won’t be visible as it’s working off the stable .jar instead of the linked project.
You may need to refresh the browser In NetBeans, the moment you save a code file, the GlassFish project is re-deployed, so you have to refresh your browser window to notice the changes.
NetBeans Community Testing (NetCat) • I could give you all the selfless reasons about all being in it together, saving kittens, making the world a better place... • We found lots of features we did not know existed • Higher profile for our developers • We got Oracle to fix all the bugs which mattered to us • It made a really good end of day task • We influenced development according to our requirements....
Details and links http://www.netbeans.org http://glassfish.java.net/ http://blog.idrsolutions.com http://convert.idrsolutions.com Stand 5174