Česky   |  Deutsch   |  English   |  Español   |  Français   |  Indonesia   |  日本語   |  한글   |  Polski   |  Português (BR)   |  Türkçe   |  中文   |  正體中文   |  Your Language  
PlanetNetbeans
Planet NetBeans is an aggregation of NetBeans related musings from all over the Blogosphere.
Feeds
[RSS 1.0 Feed] [RSS 2.0 Feed]
[FOAF Subscriptions] [OPML Subscriptions]
Do you blog about NetBeans ? Add your blog to PlanetNetBeans.
Feed Subscriptions
NetBeans Zone - The social network for developers (feed)
pandaconstantin's blog (feed)
pkeegan's blog (feed)
APIDesign - Blogs (feed)
ludo's blog (feed)
hansmuller's blog (feed)
richunger's blog (feed)
tball's blog (feed)
timboudreau's blog (feed)
David R. Heffelfinger (feed)
Carsten Zerbst's Weblog (feed)
Winston Prakash's Weblog (feed)
Need to find a title (feed)
Roger Searjeant's blog (feed)
Optonline Webmail (feed)
Michael's blog » NetBeans (feed)
DukeScript (feed)
ProNetBeans (feed)
Tim Boudreau (feed)
Paulo Canedo » NetBeans English (feed)
Bistro! 2.0 (feed)
Anchialas' Java Blog (feed)
markiewb's blog (feed)
Anuradha (feed)
Netbeans6/6.5 my best practices (feed)
Java Evangelist John Yeary (feed)
Java, business and... NetBeans ! [[ Jonathan Lermitage ]] - NetBeans IDE (feed)
Neil's Dev Stuff (feed)
Category: NetBeans | Software and Science (feed)
Computer says null; (feed)
NetBeans Adventures, Java and more (feed)
Inspiration and Expression » Netbeans (feed)
John O'Conner » NetBeans (feed)
Koberoi Oracle (feed)
Adam Bien (feed)
Ignacio Sánchez Ginés » NetBeans (feed)
Bernhard's Weblog (feed)
Michel Graciano's Weblog (feed)
Ramon.Ramos (feed)
Ozone and Programming » netbeans (feed)
NetBeans Ruminations » NetBeans (feed)
Tiplite » netbeans (feed)
Arun Gupta, Miles to go ... (feed)
Geertjan's Blog (feed)
.JARa's Bilingual Weblog (feed)
JavaFX Composer (feed)
The Java Jungle (feed)
Jesse Glick (feed)
Martin Grebac (feed)
The NetBeans Community Podcast (feed)
NetBeans Profiler (feed)
NetBeans for PHP (feed)
NetBeans Web Client (feed)
Rechtacek's (feed)
Virtual Steve (feed)
My First Blog - Satyajit Tripathi (feed)
The Aquarium (feed)
Tinuola Awopetu (feed)
Insert Witty Irony Here (feed)
Gualtiero Testa » Netbeans (feed)
James Selvakumar's Blog » netbeans (feed)
nB gUru » NetBeans (feed)
Newsintegrator Blog » netbeans (feed)
Praxis LIVE » NetBeans (feed)
TechAshram » NetBeans (feed)
There's no place like 127.0.0.1 » Netbeans (feed)
mkleint (feed)
NetBeans Community Docs Blog (feed)
The Netbeans Experience (feed)
NbPython/ jpydbg / pymvs (feed)
Shanbag's Blog (ರಜತ ಲೋಕ) (feed)
Wade Chandler's Programming Blog (feed)
Devlin's Lab (feed)
Big Al's Blog (feed)
Code Snakes (feed)
In perfect (spherical) shape (feed)
Van Couvering Is Not a Verb (feed)
Diego Torres Milano's blog (feed)
Vroom Framework (feed)
Messages from mrhaki (feed)
Jeff's Blog (feed)
Oliver Wahlen's Blog (feed)
Shuttle between Galaxies (feed)
Welcome to my live... (feed)
Netbeans IDE Blog by Tushar Joshi, Nagpur (feed)
Devel Blog (feed)
diamond-powder (feed)
Manikantan's Netbeans (feed)
Antonio's blog (feed)
Where's my Blog?!

Powered by:    Planet

Last updated:
March 31, 2015 10:05 PM
All times are UTC

Sponsored by
sponsored by Oracle

visit NetBeans website
Praxis LIVE » NetBeans - March 31, 2015 06:23 PM
Code fragment editing in NetBeans RCP

So, you’ve got a String property that’s a fragment of Java code, and you want to open and edit it within the NetBeans editor; you want access to code completion, hints, and all that NetBeans goodness; and, you want your … Continue reading

Geertjan's Blog - March 31, 2015 07:58 AM
YouTube: Debugger for JDK8’s Nashorn JavaScript in NetBeans IDE

Since the release of JDK 8 and NetBeans IDE 8, NetBeans has provided a built-in debugger for JDK8's Nashorn, the new lightweight high-performance JavaScript runtime built on top of the JVM.

With NetBeans IDE, you can add breakpoints to your Nashorn scripts and go through them when debugging your Java application. When you're debugging, you can step where no developer has stepped before: from your Java code into your JavaScript code.

To see this in action, watch this quick 5 minute screencast. Together with seeing Java and Nashorn being debugged together seamlessly, you'll see that Nashorn can also be integrated into a NetBeans module, i.e., you're able to extend NetBeans IDE via JavaScript!

Adam Bien - March 31, 2015 02:17 AM
A Java EE 7 Startup: Virtualizing Services with hubeo.com

Could you please briefly introduce Hubeo.com and yourself?

My name is Wojciech Ozga. I am 25 years old, living currently in Krakow, Poland. I am interested in different areas of Computer Science, starting from software engineering going through computer networks and finishing on cloud computing and linux system administration.

I started my adventure with programming when I was kid, I got Microsoft Visual Basic 6 Pack from my father. Then I was experimenting mostly with c/c++ till 2004 when I entered the path of PHP. After one year I finished works on Cracow-Apartments.com, one of the first online booking system of apartments in Poland.

Since 2009 I have spent most of my time in the JVM world with small exceptions for python and shell scripting languages. In mid 2012 I started the design and the implementation of Hubeo.com. I decided to keep as close as possible to Java EE stack, and it was good ;)

Hubeo.com is a global web platform for virtualization of services like: accommodation, tours, transportation, medical treatments etc. Complex system logic is hidden behind user friendly web page with modern and fresh design.

What makes hubeo.com stand out from other booking platforms is the ability of its users to advertise, promote, find and book a wide range of services in one place. Main features are:

  • selling own services
  • buying services of other users
  • affiliation
  • automatic booking settlements (with anti-fraud protection)
  • reviews

You told me, you read the book realworldpatterns.com and used the ideas to implement a prototype. What is exact the story behind?

I started to take a deeper look into Java EE on my studies. We had classes where outdated ways of coding and usage of Java EE were introduced to students. That time I was thinking that programming in Java EE is a nightmare. I found some online tutorials to give it a try and I remember one which scared me a lot.

The simple code was surrounded by all the patters coming from "old j2ee times". I had to write the same thing 3 times, encapsulating everything. Moreover I was shown to use ale the xml configurations which I just had to "click and fill" in Eclipse. I was really happy passing the exam and being able to forget about Java EE world. But then I found your books. I read two of them: "Real World Java EE Patterns - Rethinking Best Practices" and "Real World Java EE Night Hacks". The second one made so big impression on me that I decided to give it a try implementing the first prototype version of "cloud market" (the antecedent name of hubeo.com). What I liked the most reading them is that they are written from the programmer point of view: keep it simple, stupid, do not repeat your self. Skip the unnecessary boiler code, write it the simple way so every one can understand. Some times I had an impression that you are more agile then Agile :) Since that time I recommended them to few friends of mine. I think it is obligatory to read them!

You also told me that your colleague was fascinated by the simplicity of the code and wanted to join forces with you. Could you tell the story to the readers?

One friend of mine - Mateusz Krzyszton - was working previously in a big company as JSF programmer. They had a lot of issues with it, large views and server was responding slowly. They were implementing a lot of hacks to make it work. I needed someone to take care of implementing the front-end part, and I knew Mateusz is a brilliant, experienced programmer. That time we met in Lisbon. I told him the basic idea and I showed the very early mock-ups. He was not convinced. Months later we met again in Warsaw where I showed him the skeleton of the web project, implemented in JSF 2.0 with Primefaces and Omnifaces. He browsed through the source code, looked at the implementation of business logic and he decided to reinforce the team! He was really impressed about, how things can be easily done using modern version of Java EE and JSF following patterns from your books.

What surprised you in Java EE the most?

What I like the most is avoiding of writing the boiler code again and again. At the beginning I created few classes, I wrote few lines of code and I added annotations. The very simple, but working, 3 layer application has been implemented! With no magic I had a simple CRUD application with MySQL engine behind! Every programmer with a bit of experience in linux administration can quickly make business application accessible to everyone in a very easy way.

On the other hand I was really disappointed about the security models. I could not find any suitable for hubeo.com. I read official Oracle tutorials 20 times and I did not find JASS as a good solutions for modern web applications. I took a deep look into Apache Shiro but it did not convinced me neither. Modern web systems require much more complex management of roles and permissions. I hope that it will be done with Java EE 8.

What about the Java EE performance? Did you have to perform particular measures to improve the performance?

Performance! Yes, we did several measurements, using JMeter, Selenium and VisualVM. We found few issues but they were mostly related to our implementation. We focused also on the memory usage of our front-end application. I can say that creating complex views, with many components and ajax is not a way to go with JSF. Between requests, JSF stores the component tree of views on the server. Depending on configuration, JSF can store even few hundreds views per user. Having views build with many components we can finish up with few Mb of memory taken by an individual user. That made us thinking about the number of users we can handle during the duration of the user session.

For now we did not find important issues related to the JPA performance, but in the business logic we avoid eagerly loading of collections.

What were the most interesting challenges?

Designing Hubeo.com from scratch was really interesting challenge :) Considering the principles, the design of the database was a really difficult part. I needed a good common schema to store information about services like apartments, tours, dentist treatments and many more. All of those services had to be represented in a similar way to allow design of the algorithm to calculate availability and prices.

Probably the most difficult part of the implementation was the business component responsible for service order and booking management.

Moreover I was really excited discovering Amazon Cloud. Two years ago, together with Jose Java EE Coarasa Perez (blog, @coarasa, LinkedIn), we build one of the biggest implementation of cloud using OpenStack on CMS farm (one of the experiments at CERN) It was a great adventure but after using Amazon services I see how immature OpenStack was that time.

Which IDEs / tools are you using?

At the beginning of my Java EE journey I was using Eclipse. It was a nightmare. After reading your books I switched to NetBeans and I was really happy. Things were just working! Right now I am using IDEA IntelliJ. We use maven and Nexus to store artifacts. For continuous integration server we have Jenkins. The application runs on WildFly 8.2. We also use the relational database: MySQL. Hubeo.com is hosted in Amazon Cloud. We use EC2 to run VMs, S3 to provide common storage for all VMs and RDS for the database. CloudFront helps us to make our static resources easily accessible around Europe and US.

If you had the chance to start-over, would you use Java EE again?

Definitely yes. I could rethink the usage of JSF for that kind of application, but the business logic would be definitely implemented in Java EE.

Do you have any other (secret) startup ideas, which you would like to share with the readers? :-)

I was asked to implement the idea of a simple web page, where people can see the map with different trails indicating interesting points in the city, related to some topics. User can select the trail, search for places, and select specific marker to read details. This is the classical CRUD application. I decided to implement it with Java EE 7 and it took me one day. It runs on WildFly on some really small server (1gb of memory), waiting for a better times - some investor to push it forward.

Any web links / resources?

  • Hubeo.com - virtual market of "real world services". Register your service and start earning money with us ;)
  • Szlaki miejskie - urban trails, application implemented in 1 day using Java EE 7 and Wildfly

Wojciech, thank you for the interview and good luck with your next project!


Real World Java EE Workshops [Airport Munich]>

Java Evangelist John Yeary - March 30, 2015 03:43 PM
JSF 2.x Tip of the Day: Implementing a ViewMapListener

A map of the lands where the Trobadors flourished. 
"France 1154-en" by Reigen - Own work
Licensed under CC BY-SA 4.0 via Wikimedia Commons.

Introduction


There are a number of SystemEvents supported by JSF 2.x. A question that comes up frequently is how to implement them. In a number of cases on stackoverflow, it is implemented using a PhaseListener. I was looking for a way to cleanup the view map, or just get values from it before it was destroyed. I decided that the simplest way to do so was to implement a ViewMapListener. I also noticed that there were very few posts on how to implement it using the faces-config.xml so I decided to use that approach since it was instructive and more clear to me.

Implementation


The basic implementation requires that you add our listener implementation to the faces-config.xml. The example I have here is designed to get called on a PreDestroyViewMapEvent which is called on a normal navigation. We can force it though by adding a @PreDestroy annotation to a method to invoke before being destroyed. Inside the method we would need to get the UIViewroot view map, and call clear(). This would cause our listener to be invoked too. It would be a good cleanup mechanism for cleaning up resources on session expiration too, but at the moment this does not work on JSF 2.1. The @PreDestroy is not called on session timeout on JSF 2.1. This is expected to be an enhancement in JSF 2.2+.

The code for the project can be downloaded from Bitbuket here: viewmaplistener-example

faces-config.xml


ViewMapListenerImpl.java



Conclusion


The example above is just one mechanism of using a SystemEvent listener. You may decide to read values from the map, and add them to the session, or manipulate it in some other way before the data is destroyed.

Geertjan's Blog - March 30, 2015 12:24 PM
Extending NetBeans with Nashorn

Let's take our JavaScript/JavaFX code (for running Yeoman and displaying results in JavaFX) and integrate it into a NetBeans module. At the end of this blog entry you'll have a NetBeans module that looks as follows:

The 'yeoman.js' file is similar to the one blogged about here. Slightly tweaked, it's at the end of this blog entry.

It's registered in the layer file above like this:

<folder name="nashorn">
    <file name="yeoman" url="nbres:/org/netbeans/modules/yeoman/yeoman.js"/>
</folder>

And here's the code in an Action (e.g., invoked from a menu item) that finds the JavaScript file and evaluates it via Nashorn:

Import statements:

import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;

Here's the JavaScript, i.e., runs Yeoman and displays results in JavaFX:

/* global $OUT, generator, FXCollections, javafx, $STAGE */
var WebView = javafx.scene.web.WebView;
var StackPane = javafx.scene.layout.StackPane;
var Scene = javafx.scene.Scene;
var FXCollections = javafx.collections.FXCollections;
var Label = javafx.scene.control.Label;
var ComboBox = javafx.scene.control.ComboBox;
var VBox = javafx.scene.layout.VBox;
var HBox = javafx.scene.layout.HBox;
var stage = javafx.stage.Stage;
$EXEC("C:/Users/gwieleng/AppData/Roaming/npm/yo.cmd");
var output = $OUT;
var cleanedOutput = [];
output = output.substring(81, output.length - 553).split("\n");
for each(generator in output) {
    if (generator.length > 0) {
        cleanedOutput.push(generator);
    }
}
options = FXCollections.observableArrayList(cleanedOutput);
selectedGenerator = new Label();
selectedGenerator.setFont(javafx.scene.text.Font.font(24));
comboBox = new ComboBox(options);
comboBox.setValue(options[0]);
comboBox.valueProperty().addListener(new javafx.beans.value.ChangeListener({
    changed: function (observableValue, oldSelection, newSelection) {
        selectedGenerator.setText(newSelection);
    }
}));
var root = new VBox(10);
var box1 = new HBox(10);
var box2 = new HBox(10);
box1.children.addAll(new Label("Choose a generator: "), comboBox);
box2.children.addAll(selectedGenerator);
root.children.addAll(box1, box2);
var stage = new javafx.stage.Stage();
stage.scene = new Scene(root, 400, 300);
stage.title = "Yeoman Generator";
stage.show(); 

Further reading:

http://stackoverflow.com/questions/26873201/enable-scripting-mode-for-nashorn-in-java

Adam Bien - March 30, 2015 05:33 AM
Enterprise Nashorn--Free Article

The Enterprise Nashorn article presents Nashorn features beyond standard (ECMAScript-262 Edition 5.1) JavaScript capabilities. From embedding in Java code and Bean Validation, to operating system task automation, hot deployment and implementation of Java interfaces with JavaScript.

See also Playing With Nashorn screencast.

Feedback is, as always, highly appreciated.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Praxis LIVE » NetBeans - March 29, 2015 06:43 PM
Praxis LIVE v2

So, after months of development (and not much blogging!), Praxis LIVE v2 is finally released into the world.  And after some radical changes in its underlying architecture, Praxis LIVE is now getting much closer to my original vision of a … Continue reading

Adam Bien - March 29, 2015 10:21 AM
March's Airhacks Live Event Shifts to Tuesday

Caused by the massive amount of easter eggs, the March Airhacks Live event is going to shift one day from Monday 6 P.M. CET to Tuesday, 7th April 2015, 6 P.M. CET (subscribe).

This time you get one day more to prepare lots of questions.

Also checkout past episodes--lots of questions were already answered.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 28, 2015 01:20 PM
Combining Nashorn Scripting with JavaFX

Following from yesterday's blog entry, the question I had was: "Can I use -scripting and -fx at the same time?"

The answer is yes:

 /* global $OUT, generator, FXCollections, javafx, $STAGE */
load("fx:base.js");
load("fx:graphics.js");
load("fx:controls.js");
$EXEC("C:/Users/gwieleng/AppData/Roaming/npm/yo.cmd");
var output = $OUT;
var cleanedOutput = [];
output = output.substring(81, output.length - 553).split("\n");
for each(generator in output){
    if (generator.length>0){
        cleanedOutput.push(generator);
    }
}
options = FXCollections.observableArrayList(cleanedOutput);
selectedGenerator = new Label();
selectedGenerator.setFont(javafx.scene.text.Font.font(24)); 
comboBox = new ComboBox(options);
comboBox.setValue(options[0]);
comboBox.valueProperty().addListener(new javafx.beans.value.ChangeListener({
    changed: function (observableValue, oldSelection, newSelection) {
        selectedGenerator.setText(newSelection);
    }
}));
var root = new VBox(10);
var box1 = new HBox(10);
var box2 = new HBox(10);
box1.children.addAll(new Label("Choose a generator: "), comboBox);
box2.children.addAll(selectedGenerator);
root.children.addAll(box1, box2);
$STAGE.title = "Yeoman Generator";
$STAGE.scene = new Scene(root, 280, 100);
$STAGE.show();

The above runs Yeoman on the command line via JavaScript, thanks to Nashorn, and displays the result in JavaFX:

And this is how the code above looks in NetBeans:


Indeed, this would appear to be the start of a shell script enabling Yeoman to be used from JavaFX.

By the way, to do the above, and to use the info in Adam's recent screencast and in my blog entry from yesterday, you need a NetBeans development build and then use the Nashorn tab that has been introduced there, i.e., this is not in NetBeans IDE 8.0.2 but in a development build for the next release:


Adam Bien - March 27, 2015 02:49 PM
Playing With Nashorn Scripting Features

Nashorn is shipped with Java 8 and can be used as a system scripting language with seamless Java integration.

One of the killer features is the IDE support. In contrary to batch files or shell scripts, Nashorn is JavaScript (ECMA-262, edition 5.1) and is supported in the IDE with syntax highlighting, code-completion and direct integration with Java ecosystem. Even executable native system scripts can be easily debugged:

Static Page Generator (SPG) is another example of executable Nashorn script example.

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich Airport, Terminal 2, particularly at HTML 5 for Java Developers or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 27, 2015 08:13 AM
JavaFX in JavaScript

Did you know you can code JavaFX in JavaScript? See here, click to enlarge it:

Even simpler than the above, it can also be expressed in JavaScript like this:


For some context, see Adam Bien's latest YouTube clip:

Tip: When using JavaFX with Nashorn, set the '-fx' flag in the place where Adam uses '-scripting' above.

As Adam shows, you can debug Nashorn:

Finally, the code snippets in the screenshots above come from this repository by Bruno Borges, which I learned about from him in an excellent session by Bruno about Nashorn at JavaLand this week:

https://github.com/brunoborges/nashorn

Adam Bien - March 26, 2015 05:00 PM
Installing Oracle JDBC-Driver On Wildfly / JBoss

  1. Download the driver: ojdbc[VERSION].jar
  2. Create subfolders [WILDFLY_HOME]/modules/system/layers/base/com/oracle/main/
  3. Copy the downloaded ojdbc[VERSION].jar into the freshly created folder
  4. Create a file module.xml, in the same folder as above, with the contents:
    
    <module xmlns="urn:jboss:module:1.1" name="com.oracle">
      <resources>
        <resource-root path="ojdbc[VERSION].jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
    
    
  5. In the configuration file standalone.xml add the entry:
    
    <driver name="oracle" module="com.oracle">
     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    </driver>
    
    
    within the <drivers> tag.
  6. Add a datasource definition within the <datasources> tag (next to ExampleDS):
    
    <datasource jndi-name="java:/[NAME]" pool-name="OracleDS" enabled="true">
     <connection-url>jdbc:oracle:thin:@[HOST_NAME]:1521:[SID]</connection-url>
      <driver>oracle[has to match the driver name]</driver>
      <pool>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>5</max-pool-size>
       <prefill>true</prefill>
      </pool>
      <security>
       <user-name>[USER]</user-name>
       <password>[PWD]</password>
      </security>
    </datasource>
    
    

Now enjoy the simplicity of Java EE :-)

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 26, 2015 03:47 PM
Mobile Boilerplate and NetBeans IDE

It turns out NetBeans IDE has even more powerful tools than you thought...

Geertjan's Blog - March 25, 2015 07:00 AM
NetBeans Day Brazil: Monday, June 22, 2015!

During JavaLand, Vinicius and Yara and I decided... that the day before JavaOne Brazil (23 to 25 June in Sao Paolo) will be... NetBeans Day Brazil!

Here's a pic I took of them today at JavaLand: 

Watch this space for news and announcements about NetBeans Day Brazil! 

Geertjan's Blog - March 24, 2015 07:00 AM
A Simple Starter Project With Grunt

In your package.json file:

{
    "name": "simple-app",
    "private": true,
    "version": "0.0.0",
    "description": "A Simple Starter Project With Grunt",
    "repository": "https://github.com/angular/angular-seed",
    "devDependencies": {
        "grunt-contrib-copy": "0.4.x",
        "grunt-contrib-clean": "0.4.x"
    }
}


In your Grunt file:
/* global module */
module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy:{
            build:{
                cwd:'public_html',
                src:['**'],
                dest:'build',
                expand:true
            }
        },
        clean:{
            build:{
                src:'build'
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.registerTask(
        'build',
        'Compiles all the assets and copies the files to the build directory.',
       [ 'clean', 'copy' ]
    );
};

Geertjan's Blog - March 23, 2015 09:42 AM
29th May: (Free) NetBeans Day UK!

As announced at NetBeans Day during JavaOne 2014, we're holding multiple NetBeans Days throughout the world, in part to celebrate the 20th year of Java's existence.

In December, we had NetBeans Day Germany, in February NetBeans Day Netherlands, in March NetBeans Day Germany again, in April NetBeans Day Greece is coming up, and May... is NetBeans Day UK:

Sign up and join in: https://blog.idrsolutions.com/2015/03/netbeans-day-uk-friday-29th-may-2015

And what will happen in June? Where in the world will NetBeans Day be held in June, July, etc? That's up to you! Propose a place where it should be held and the NetBeans community will work with you to set it up. 

Adam Bien - March 23, 2015 04:04 AM
A Java EE Startup: Fashion with Stylight

Interview with Anselm Bauer, STYLIGHT co-founder, passionate Java EE developer and airhacks.com alumni:

Anselm, please briefly introduce yourself

Hi, I’m Anselm, co-founder of STYLIGHT and computer scientist. I live in the best city in the world, Munich, and I have the chance to work in the best team I imaginable. I am a passionate musician, love sports, and nature.

What is stylight.com and how did it start?

STYLIGHT is the place to discover and shop fashion you love from the best online stores. I founded the company together with three friends in 2008 as students. Currently STYLIGHT employs over 150 people across three offices (Munich, London, and New York).

You’re a co-founder and your development skills are impressive, how important is it for management to technically understand the developers?

The founders of STYLIGHT have backgrounds in economics, electrical engineering, business administration, and computer science. We know that success is only possible when all disciplines work together to reach their goals, that is why appreciation is one of our three core values. We don’t have an engineering department anymore at STYLIGHT, but instead have cross-functional teams, in which engineers work together with marketing, design, sales etc.

How many developers are working on the application?

We have about 30 developers currently working at STYLIGHT. They are distributed over multiple teams along our value chain to create cross-functional teams with the maximum of autonomy and flexibility.

The UI is completely rendered on the server, why?

To guarantee a great experience and performance across all browsers, devices and networks we currently render most of the UI on the server. In addition, most search engines are still not doing a good job at crawling one page applications yet. We like the concept and use it for internal tools, though, together with JS frameworks like Angular.

How many users per day visit the website? What were the peak transactions / second value?

Over six million people visit STYLIGHT every month and find their favourite fashion items. We normally see huge peaks during our TV campaigns.

Which hardware / infrastructure are you using?

Parts of our infrastructure are hosted at a local provider in Munich but the majority of servers are at AWS. We currently migrate all of our infrastructure to AWS to be more flexible and use their great services. We love docker for local development environments as well as for our production deploys.

Is Java EE fast enough for a popular website?

A lot of popular websites use the power of the JVM even if the don’t use Java as a language. We use Java EE features mainly for our business logic where it relieves us from thinking about things like transactions, concurrency etc. Since a lot of our content is a static catalog we can cache a lot of our pages.

Your started straight with the Java EE stack. Was it a good decision?

I think the Java EE stack today is not comparable to the J2EE technologies that were around when we started, and are actually much better than the reputation it has. Back then the amount of boilerplate code was much higher and a script language stack like RoR would have done the trick as well. Today I am glad to use the power of the JVM and the features of Java EE.

Is Java EE productive enough for a startup?

The learning curve is still steeper and we are still fighting against long compile cycles, so for rapid prototyping I may chose something else. In the long run, I think we benefitted from the robustness.

The monitoring capabilities of your system were impressive. What is monitored? Does monitoring pay off?

We monitor servers and applications with several tools and metrics. We use, for example, datadog for general server monitoring, loggly for exceptions, requests, load times etc, and new relic for everything else. Monitoring definitely pays off in finding errors and bottlenecks but also opportunities for refactoring.

We met for the first time at airhacks.com. Have you got any ideas for simplification during the workshops?

Definitely. I got a lot of food for thought, especially regarding the testing of Java EE applications and simple patterns like the Entity Control Boundary Pattern.

You recently migrated to Java 8, Java EE 7. How hard was the migration?

We migrated to Java 8, Java EE 7 and are running on the new Wildfly application server. The migration was fairly easy, we did not have to change more than a hundred lines of code.

How much code could you delete during the migration?

We are deleting code iteratively, to avoid a big bang release. But especially for features like asynchronous behaviour we were able to delete a lot of code.

Did you had the chance to chat with other airhacks attendees? If yes, what was the most interesting project / application / problem?

It’s always interesting to see companies from totally different industries like stock exchange and logistics and how they deal with their problems.

If you could start over, would you choose Java EE again?

That is a very difficult question, since it depends very much on the domain I would start something. Although I like working with Java EE, I’m still a computer scientist and I would maybe choose something else, only out of curiosity.

I'm constantly asked by my clients, whether I know any Java EE developers. Are you also looking for passionate Java EE hackers?

Definitely, we currently have open positions for Java EE developers, specialists for RESTful APIs and search technologies on our jobs page http://www.stylight.com/Jobs/.

Anselm, thank you for the interview!


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 21, 2015 10:24 AM
Asset Management on NetBeans

I recently visited an asset management firm in the Netherlands, where various internal applications are created by the internal IT department. Here's their main application, used for asset management, i.e., stock trading and similar activities:

The above is yet another NetBeans Platform application. Especially the Window System, i.e., the docking framework, of the NetBeans Platform is considered to be very useful by the developers.

In the above application, data is pulled in from various web services, and managed in the application, which is basically a container for data. In fact, you could look at it as a highly customized browser. Had the application been a web app in FireFox, or some other existing browser, there wouldn't have been enough control over its functionality. Therefore, the developers created their own browser, to have maximum control over every aspect of the application. That's all that such desktop applications are and it explains the continuing need for desktop applications.

Here you see the application in action by one of its users, i.e., if you're managing assets, you typically have multiple monitors, showing multiple different applications. One of these, you can see on the far right, is the application shown above.

Other applications are being created on the NetBeans Platform by the same organization. For example, here you see an internal document management system, for printing, and similar activities. What's interesting is the lower part of the screenshot below, which is a JavaFX WebView component, containing a JQuery form in the bottom right. That means that a NetBeans Platform application can even integrate with JQuery; that's pretty cool, I think.

I always find it really interesting to come across applications such as the above two. They have in common that they're in the back office of an organization, that you're never going to read about them on the organization's website. In fact, I've been asked not to mention the name of the organization nor where it is.

In short, let's not base our understanding of the popularity of a technology on the analysis of GitHub or on seeing what people are using at conferences or using Google trends or things like that. Instead, if we want to know what's actually being used and done in the software domain, we need to really become anthropologists and go out into the field and meet people at the organizations where they work and see what they're actually doing. From the lowlevel subjective view, something higher level objective can maybe be extrapolated, and not the other way round. Indeed, that's a lot of work and much more difficult than running some scripts to analyze GitHub. But any other approach simply neglects the scenarios I've been describing in this blog over the past 10 years, where few of the applications I've encountered are on GitHub, even fewer are described on the company website, and almost none of the developers go to conferences, so all of these use cases fall under the radar.

APIDesign - Blogs - March 20, 2015 04:04 PM
NetBeans History: University Beginnings

The original name of the project was Xelfi and it started at MatFyz faculty of Charles University in middle of 90-ties. However it was so successful that it had to turn into something as successful as NetBeans. In case you are satisfied with your IDE, consider reading about its root...

--JaroslavTulach 16:04, 20 March 2015 (UTC)

Adam Bien - March 20, 2015 09:47 AM
Injecting ThreadPool Statistics Into HTTP Headers With Java EE and Porcupine

Porcupine "spy" 0.0.4 injects statistics of the thread pools automatically into HTTP headers of JAX-RS resources:

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 20, 2015 07:01 AM
Human Rights, Amnesty International, and NetBeans IDE

At the headquarters of Amnesty International  in the Netherlands, quite a lot of interesting work is being done with NetBeans IDE. In this blog post, I'd like to briefly share the basic details of one of these projects.

With the Urgent Action App, created by Amnesty in Amsterdam, currently only available in Dutch though that will change, you're able to very quickly become engaged in human rights campaigns by efficiently signing petitions and sending e-mails to protest human rights abuses.

The app can be installed onto either Android or iPhone.

The technology stack for the backend of the Urgent Action App includes Java, Java EE, GlassFish, and NetBeans IDE. RESTful web service calls from the frontend, created in AppMachine (appmachine.com) are integrated into a Java EE backend that does the following:

  • collects registration data from users of the app who join the action network by filling in their details
  • stores data when  users sign forms in support of an action around human rights abuses
  • periodically creates a petition list from the support forms and presents them to applicable organizations and representatives
  • helps to show the level of support for a particular action and ensures that a petition can't be signed more than once

Below, you see a photo of Amnesty International software developers, from left to right, Bert Menting and Ed van Velzen, with NetBeans IDE 8.0.2 on their laptop, in the Amsterdam HQ office of Amnesty International in the Netherlands. 


Among many other features that they like in NetBeans IDE are the smooth integration of NetBeans IDE with GlassFish, the ease with which RESTful web services can be developed via helpful templates in NetBeans IDE, together with advanced Java coding features, such as "Find Usages" and the built-in free Java Profiler. They also appreciate the fact that NetBeans IDE is free and open source software. 

Great to see human rights work being enabled and empowered through tools and technologies that include Java, Java EE, GlassFish, and NetBeans IDE!

Geertjan's Blog - March 19, 2015 12:23 PM
NetBeans at JavaLand

Next week I'll be at JavaLand. Looks like most of the "thought leaders" in the whole Java world will be there, when you look at the program:

http://www.javaland.eu/1/javaland-2015/

A session I'm doing is on Tuesday, 24 March, from 12:00 to 12:45. Looking forward to it!

I interviewed Markus Eisele from the JavaLand organization when it was launched, last year:

https://blogs.oracle.com/geertjan/entry/say_hello_to_javaland

Geertjan's Blog - March 18, 2015 05:54 PM
Microservices, Java EE, and Adam Bien at Blue4IT

Blue4IT is a software organization specialized in Java, based in the Netherlands. Last night they hosted the always entertaining and profound Adam Bien:

http://www.blue4it.nl/index.php/nieuws2/blue4it-presenteert-adam-bien-17-maart-2015

I thought he was really in top form, especially since he'd just flown in from Munich after having done the keynote session at NetBeans Day Germany the day before.

At some point I started tweeting his pithy wisdom and unfortunately at some later point my battery died. Until that stage, here's the key thoughts I picked up from him in his typically "lean" manner of looking at things:

No one embodies "lean" more than Adam Bien. Hmmm. "Adam Lean" would be a more descriptive name. The evening was really enjoyable, great catering too, looking forward to more of these at Blue4IT.

Adam Bien - March 18, 2015 08:44 AM
The Porcupine Spy v0.0.4 and Porcupine v0.0.4 Released

Version 0.0.4 of porcupine is available:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>porcupine</artifactId>
	<version>0.0.4</version>
	<scope>compile</scope>
</dependency>

This version comes with minor bug fixes and improvements and a single major feature: the minQueueCapacity statistic. It is the "lowest watermark" of the queue capacity and an early indicator of thread pool overloading / upcoming rejections.

The new attribute is available from method Statistics#getMinQueueCapacity()

porcupine-spy was also released with the same version:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>porcupine-spy</artifactId>
	<version>0.0.4</version>
	<scope>compile</scope>
</dependency>

You can use the above dependency instead of the regular porcupine. The porcupine-spy extension injects automatically the statistics to the HTTP headers of all JAX-RS resources.

All requests are going to be extended with the x-porcupine-statistics-[THREADPOOL_NAME] HTTP header:


x-porcupine-statistics-light: {"pipelineName":"light","activeThreadCount":1,
"completedTaskCount":1,"corePoolSize":8,"currentThreadPoolSize":2,"largestThreadPoolSize":2,"maximumPoolSize":16,
"rejectedTasks":0,"remainingQueueCapacity":100,"minQueueCapacity":100,"totalNumberOfTasks":2}
Content-Type: text/plain
Date: Wed, 18 Mar 2015 07:50:20 GMT

Porcupine comes without any additional external dependencies and fully relies on Java EE 7 / Java 8 what makes it lean. Both JARs together are only 20kB.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - March 17, 2015 04:20 PM
Trip Report: NetBeans Day Germany 2015 (Part 1)

Not long ago, in December 2014, the Oracle office in Munich, Germany, was used for the first time to host a NetBeans Day. It was a big success. At that event, we immediately decided we wanted to have another day just like it and soon! In the meantime, NetBeans Day Netherlands has taken place, while NetBeans Day Greece, NetBeans Day UK, NetBeans Day Belgium, NetBeans Day Poland, and NetBeans Day Sweden are being planned, over the coming months, leading up to the next NetBeans Day at JavaOne later this year, which might be prefaced by a NetBeans Day in San Diego, too! (Missing your country in that list? No worries, contact me if you want help in setting up an event in your part of the world.)

Yesterday was the second Oracle-sponsored NetBeans Day in Germany, i.e., in the same place as where we were in December last year. There were a lot of topics to attend throughout the day, so during the lunch break the room was split into two, so that we were able to run two tracks, both of which were well attended, with a wide range of topics, from HTML5 to Raspberry Pi to Oracle Developer Cloud Service and more.

It was a fun time!

Rock star Adam Bien's view, on one side of the room, was as follows:

This was the whole group before lunch, i.e., before the room was split:

Adam Bien started the day by talking about HTML5 and JavaFX. Using a development build of NetBeans from the day before, he showed several cool new features, such as Gulp support, as well as Nashorn debugging in NetBeans IDE:

Kirk Pepperdine, performance guru and more, talked about the latest features in Java 8, focusing on a range of topics, though not sticking primarily to Lambdas and Streams, as normally happens at Java 8 sessions, for example, this was handy and illuminating:


Dalibor Topic, project manager of the OpenJDK, talked about the current state of OpenJDK and JDK 9, as well as explaining some interesting concepts and processes, such as the Java Enhancement Process:



After lunch (lots of healthy fruit and sandwiches), the room was split and several interesting sessions were held, such as by Jens Deters on Java embedded and the Raspberry Pi:


And Thomas Kruse showed a lot of code in his presentation on AngularJS and NetBeans IDE:

It was pretty cool to see Thomas using the "Dark Look & Feel Themes" plugin while talking about HTML5, i.e., like a lot of (most? all?) JavaScript developers, Thomas likes a dark background in his development tools:

Despite the dark background, the code was clearly visible throughout the room, the font size being enlarged so that those in the back could see it too.

One of the other sessions focused on Duke's Choice award winning "DukeScript", a new technology for creating cross-platform mobile,  desktop and web applications, which was explained in detail and with code by Toni Epple himself:

Paul and Gail had an excellent session on JavaFX and the NetBeans Platform, half of which you can view right here (the other half was not recorded because the disk was full):

Paul and Gail are from San Diego in the US and are interested in holding a NetBeans Day there, right before JavaOne, that would be great, I think. They also brought two copies of their great heavy new book with them "JavaFX Rich Client Programming on the NetBeans Platform", one of which was won by Stefan Gürtler from Transver in Munich:

Other sessions, of which I have no photos since I was one of the speakers or at a conflicting session, including a session on teaching with NetBeans IDE, mainly by Karsten Sitterberg, about how NetBeans is well suited as a tool for teaching Java. In that context, I introduced the NetBeans Education Community and the NetBeans Teachers Community on Google+. At the same time, Benno Markiewicz, the most prolific NetBeans plugin developer in the world, was explaining to a packed out room how to use the NetBeans APIs and create new plugins similar to the awesome ones he has been making.

I also did a session on the Oracle Developer Cloud Service (ODCS). I went through the features offered by ODCS which is a really comprehensive development platform in the Cloud, including Git, a bug tracker, Hudson, and Wiki. Watch the videos shown during the presentation here.

For those who stayed a bit longer, the day ended with a really nice Greek meal!

Almost forgot to mention one thing because it's such a typical occurrence to me at this stage—I again met a whole bunch of people I had never heard of before using the NetBeans Platform. It continues to surprise me in all the shortsighted "the browser is everything now" assumptions that greenfield projects, i.e., from scratch, are starting up all the time on the Java desktop for all the old reasons, that continue to be true, e.g., cross-platform, reliability, stability, etc, which when coupled with the modularity of the NetBeans Platform, together with its rich set of GUI components and programming techniques, makes for an absolutely killer combination.

It was a really enjoyable day, amazing how much was packed into it, many thanks to all the speakers and attendees! Special thanks to those who came from far, such as Allesandro from AirMosaic in Italy, Michal from Sabre in Poland, and Paul & Gail from the US. The next NetBeans Day, i.e., part 2 of this blog series, will be sometime after JavaOne this year, which will include content from JavaOne. Many thanks to the Oracle office in Munich, especially Peter Doschkinow, for making these events possible.

Adam Bien - March 17, 2015 03:32 AM
JAX-RS 2: Adding HTTP Headers With WriterInterceptor

With a WriterInterceptor implementation you can easily post process the response and so modify or add HTTP headers:

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>

Adam Bien - March 16, 2015 01:42 AM
A Java EE Startup: 200 Schools on safsms.com

An interview with Faiz Bashir (@faizbash), Java EE entrepreneur and almost an airhacker.

Faiz, could you please introduce yourself? How did you started with Java / Java EE?

As FlexiSAF’s CEO, I am responsible for FlexiSAF’s day-to-day-operations, as well as leading the company’s product development and technology strategy. I co-founded FlexiSAF and has been the CEO since 2009 when the company began its full operations. I am ambitious and enthusiastic in improving the quality of education using technology.

I started learning Java in 2000 using Java How to Program by Deitel & Deitel which was given to me by my Uncle, Eng. Aziz. Since then I never looked back again. It was in 2008 that I started paying attention to Java EE. All my projects are now Java based. I am Sun Certified Professional with the following certifications: Sun Certified Business Component Developer, Sun Certified Developer for Java Web services, Sun Certified Web Component Developer and Sun Certified Java Programmer.

How Java is doing in Nigeria? Are there any meetups, JUGs etc.?

Based on my interaction with developers in Nigeria, I think people shy away from Java. They feel the learning curve is very steep. However, I think big enterprises use Java EE but I am not sure of the market share between Java EE and .Net. With technologies like Android however, Java is gaining more popularity. There is JUG in Abuja since 2011 which is being headed by my Friend Bulama Yusuf. However there hasn't been a meetup for sometime now. There are JUGs in 2 other cities in Nigeria (Lagos and Port Harcourt). Bulama informed me that they have been communicating with Oracle Nigeria to organise a nationwide conference but that has been slow.

Could you please briefly introduce your application?

We have a number of applications for schools, but the most popular one is SAF School Management Software (SAFSMS). It is a web-based application for managing school's processes and students' records. Currently over 200 schools are using SAFSMS. It is completely based on Java EE on the server side and Google Web Toolkit on the client side. We are now working on a cloud version for SAFSMS which is going to be Software as a Service (Saas)

Many are thinking, Java EE is not appropriate for startups. What is your opinion about that?

I think it is a very wrong opinion because I have seen startups that use other technologies and eventually find it difficult to scale and have to migrate to Java EE. Java EE is really straight forward and takes care of the so many complexities ordinarily you have to worry about.

Which Java EE / SE versions are you currently using?

We use Java EE 7 for our current projects. We still use Java SE 7 but will soon migrate to 8.

Is there anything to simplify in you code base (legacy interfaces, superfluous patterns etc.)?

I think there's nothing really to simplify because all our code base is post J2EE1.4. We keep everything simple.

What tools, servers, IDEs, operating systems are you using?

Most of us are Linux guys, we use Ubuntu. But a few of our designers use Windows. We were using Mercurial for SCM but recently migrated to GIT. I think I prefer GIT's branching model to Mercurial's. We now use Gradle for our build tool. Netbeans is our preferred IDE. GWT is our preferred UI tool and we also recently adopted GWTP as the framework for our GWT. We have also adopted Arquillian for our unit tests and use Arquillian Drone for integration tests. We use Docker to encapsulate the full stack that our applications need to make them portable. We haven't really done full CI but are considering Jenkins for that now. Amazon EC2 is our preferred cloud computing platform.All our applications are deployed on Glassfish, however we are thinking of following Arun Gupta (to Wildfly).

Any lessons learned?

I think the most important lesson I learned is to always use tools and automate whatever needs to be automated. It will greatly cut down the cost of running your business and obviously increase revenue.

If you had the chance to start-over. Would you choose Java EE again?

I will choose Java EE always without any hesitation

Where can readers find more about your system. Do you have any links, resources to share?

www.safsms.com

Faiz, thank you for the interview!


Real World Java EE Workshops [Airport Munich]>

APIDesign - Blogs - March 15, 2015 03:56 PM
Gradle belongs to Stone Age!

My friends keep talking about the greatness of Gradle. It is hard to stand it, especially knowing there is a significant flaw introduced in Gradle's core.

The flaw is so huge that I rank Gradle along Ant. Into Ant-age!

--JaroslavTulach 15:56, 15 March 2015 (UTC)

Geertjan's Blog - March 13, 2015 04:41 PM
Royal Netherlands Navy on NetBeans

A few days ago I had the opportunity to visit the headquarters of the Royal Netherlands Navy in Den Helder, which is in the tip of the most northern part of the Netherlands. That's where naval ships such as the following are managed:

The various military components on naval ships like the above are controlled by programs coded via an MDA (Model Driven Architecture) methodology based on the Shlaer-Mellor methodology, comparable to Executable UML. An in-house Shlaer-Mellor MDA and an ASL implementation are used for coding. The models and the ASL are compiled by an in-house compiler into C code, which is then compiled into an executable via a C compiler.

An in-house IDE has been developed for the in-house implementation of the Shlaer-Mellor/Executable UML methodology, by SATS Den Helder, which is part of the Defence Material Organisation, for the approximately 40 in-house internal developers who are working with these modeling methodologies. The IDE is used for modeling, as well as for the related ASL code, providing the rich features expected of a modern IDE, in addition to the modelling features you see below, this includes a full-blown ASL editor, with syntax coloring, code completion, refactoring, find usages, code navigation, compilation, and diffing of models.

Guess what that in-house IDE, specifically created for those 40 developers, looks like? Click to enlarge it:

What you see is a complete development environment created on NetBeans for the usage of the Shlaer-Mellor/Executable UML methodology together with the in-house implementation of ASL, created with the key idioms that NetBeans provides, e.g., Module, TopComponent, Lookup, etc. However, there's no project system, because each application is stored in a single XML file. Everything you see above is extrapolated from a single XML file.

The developers told me they'd never have created the above application without NetBeans, since it provides an enormous amount of plumbing, especially the window system that you see above. The Visual Library is used, for the modeling, as well as JFreeChart (which might potentially become JavaFX). The immediate professional appearance that an application on NetBeans gains out of the box was a key reason for using it.

Prior to using the NetBeans Platform as the basis of this application, extensive analysis was done in comparing it with Eclipse RCP. Clearly, NetBeans won. Other applications have been developed, while others are being started from scratch, by the Royal Netherlands Navy on the NetBeans Platform. Being able to share modules between different applications is a big win and that's something that the development team is leveraging as they develop more applications that do similar things. I have some more screenshots of these that I'll share in the coming days.

Adam Bien - March 13, 2015 03:15 AM
Dealing With Overload in Java EE 7 and Porcupine

porcupine comes with a conventional RejectedExecutionHandler implementation, which converts all handler calls into CDI events.

See also porcupine intro and configuring porcupine screencasts.

Visit porcupine at github.com

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Real World Java EE Workshops [Airport Munich]>