Finally version 5.0 of the growing popular Ajax-Web-Framework is released. Quite a number of new and updated features certainly drives up the number of users and pushes the community further. Find more information at zkoss.org. As usual the Netbeans plugin will most probably follow in a few days time. Keep you updated.
Category Archives: java
Java EE 6 Online Codecamp
Starting next week (Monday 12th) there is a one-week codecamp on the Java EE6 features. I did previously the “online” seminars from Sang Shin at www.javapassion.com. Find more info at here.
Java EE6 Virtual Conference
For those who could not attend the conference (sorry, not my timezone!), here the screencasts (you need a SDN account)
Netbeans 6.8, Glassfish V3 and JavaEE6 released
The waiting is over, finally we get our hands on a production release of EE6 and Glassfish V3. Last week (Dec 10th) released, you also get it together with Netbeans 6.8. There is lot of attention and coverage on the latest version of the enterprise platform, so I spare you from my personal views, though I was really looking forward to use it beyond previews and beta’s. I am excited to work with the matured and now “rightsized” framework. Time to get active on writing tutorials and books.
Some useful links with more details:
How to add Javadoc to Netbeans
You are wondering why Netbeans give you code completion but no javadoc, rather saying “javadoc not found” ? It is not part of the Netbeans Installer or the regular JDK package. You need to download it separately (link), copy the zip file to a folder of your choice and configure the javadoc in Java platforms.
News: Java JDK 6 Update 12 out
Latest version from SDN (link).
How to get started with Prefuse and Netbeans
I was looking for a java based visualization toolkit for quite a while. Either they are very static (image rendered and delivered without any interaction) or cost too much money or badly documented or plain buggy and incomplete. I found a toolkit called prefuse (link) on sourceforge which is an amazing piece of work done by Jeffrey Heer (link) of Berkeley University Stanford. Thanks for this and to the people in the forum (link) to continue the effort to answer questions.
Though it’s last release if dating 2007.10 it is feature complete and not really need to carry the beta tag, but never mind. The project migrated to flare (link) based on Flash and AS, but unfortunately that is not always the first choice, even more powerful in terms of graphics. But I wonder what would be missing. It is open source, so with community effort things can be implemented or even added.
It is released under BSD and can be used freely for commercial and non-commercial applications.
I am a true Netbean nerd, aka NB user and spent some time to get started with prefuse.
Today I wan to share with you the steps (i did) to get a running with prefuse and Netbeans running Windows.
(Please note, it might not be the perfect or smartest approach. I dont claim its the right way or complete, but I got it to work this way. )
I am sure this is very basic information for the prefuse experts, but other beginners might need to go through the same steps.
1. Donwload the file prefuse-beta-20071021.zip (link).
2. Unzip the file to folder.
3. Check for a properly set JAVA_HOME path, like
E:\Documents and Settings\SAM>echo %JAVA_HOME%
E:\Program Files\Java\jdk1.6.0_10
4. Open the file build.bat with text editor of your choice and change the follwoing line
%JAVA_HOME%\bin\java.exe -Dant.home=…
to
java.exe -Dant.home=…
(I removed the JAVA_HOME because java already is in the system PATH)
5. Open a DOS-Box (Windows, aka run.. CMD) and navigate to the folder with the build.bat file.
6. Execute ‘build.bat all’. You should get something like this:
7. Start Netbeans and create a new project (New, Choose project, Java, Java Application). Lets call it PrefuseDemo.
8. Open the project properties (right click on the project name in the project explorer) and select properties. Go to the libraries sectio and add prefuse.jar and demo.jar (required for the sample code). You find these files in the folder ‘build’ created by our build.bat.
9. Now you change the packagename (with the initial created Main.Java if selected) to prefusedemo.
10. In the build folder you also find a src folder with various sample java code. For this tutorial I took GraphView.java.
11. Create a new javaclass in the prefuse package with the name GraphView.
12. Copy the complete sourcecode from GraphView.java into it and replace the basic skeleton.
13. Fix the package name to package prefusedemo;
14. You can delete the Main.java if NB created it for you.
15. Build the project.
16. Right click onGraphView.java and select Run File. Finished ! You should see this:
Remarks:
1. The other files (demos that come with the prefuse package) you can create the same way and add them into your demo application.
2. I tried to import the whole prefuse source folder into Netbeans via Import, but it didnt work.
Conclusion:
Now we got started, lets move on to understand the prefuse concept and adapt some of the samples to our own applications or create new ones from the scratch ! Stay tuned for more prefuse !
SUN Techdays Singapore 2009 résumé
2 days packed with sessions, demos and hands-on labs ! It was a SUN event, and SUN folks also learned to celebrate themselves with loud music and big-bang entertaining keynotes. Fine with me, part of the show. Obviously everything evolved around SUN technology and everything they support.
The products, technology and key/buzzwords were clearly:
- Cloudcomputing
- Open Source
- Open Solaris
- Virtual Box
- Netbeans
- Glassfish
- MySQL
- JavaFX
Feedback:
Most of the sessions were useful, or at least you got an overview of some new stuff or ideas.The hands-on labs were not as good because the trainer(s) needed to spend some of the time helping people to install Netbeans or xyz plugins (which is an audience problem) and beyond that is not useful to let the attending folks read the instructions from a zip-file and DIY while the trainer is available for questions (in Singapore hardly anyone ask anything).
It is always good for networking (and free food) to join these kind of conferences. Btw, the conference fee was 80.- SGD for 2 days (hands-on lab extra 50.- SGD each)
My highlights:
- Simon Ritter (blog) presenting Wii Remote with JavaFX and SunSpots Technology (link)
- Carol MacDonald (blog) on JMaki, Comet, Grizzly and EJB (Spring vs. Seam vs. plain JPA)
Conclusion:
- I will join the next TechDays.
- I am installing OpenSolaris right now on a notebook (after checking with device detection tool, link).
- I will continue to use the SUN (related) products that I already use (Netbeans, Glassfish, MySQL, Virtual Box)
JUG (Java User Group) Singapore
OK. After digging further I found a group… not dead, just not as active (at least online).
More info at Google Groups. Will add more info after joining them and see whats going on.
Tutorial: Starting with Glassfish and JMS (Part 2)
Today we proceed with last weeks JMS tutorial and create a standalone java application that sends a message to a topic.
It puzzles me to have a client application that I need to start “from within”. Lets find out how an application looks like that can run by itself, connect to a JNDI server and sends a message to topic. The key information I took from this discussion (link, Thanks to Foli and TravelEntity) at forums.sun.com.
Using: Netbeans 6.5 and a local Glassfish V2
1. Lets create a standard SE java project. We call it “JMSClient”
2. Import the necessary libraries
Applicationserver JNDI Lookup
/lib/appserv-rt.jar
/lib/appserv-admin.jar
/lib/javaee.jar
/lib/j2ee.jar
Client Lib
/imq/lib/jms.jar
/imq/lib/imq.jar
/imq/lib/imqutil.jar
/lib/install/applications/jmsra/jmsra.jar
(You find them in your glassfish home directory)
3. The complete source
package jmsclient;
import java.util.Hashtable;
import java.util.Queue;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class Main {
public static void main(String[] args) {
Context jndiContext = null;
ConnectionFactory connectionFactory = null;
Connection connection = null;
Session session = null;
// ---- Same sample with a queue ----
// Queue queue = null;
Topic topic = null;
MessageProducer messageProducer = null;
MapMessage message = null;
Hashtable properties = new Hashtable(2);
properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory");
properties.put(Context.PROVIDER_URL, "iiop://localhost:3700");
try {
jndiContext = new InitialContext(properties);
connectionFactory = (ConnectionFactory)jndiContext.lookup("jms/ConnectionFactory");
// ---- Same sample with a queue ----
//queue = (Queue)jndiContext.lookup("jms/Queue");
topic = (Topic)jndiContext.lookup("jms/Topic");
connection = connectionFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
// ---- Same sample with a queue ----
//messageProducer = session.createProducer(queue);
messageProducer = session.createProducer(topic);
message = session.createMapMessage();
// ---- Preparing Mapped Message ----
message.setString("lastname", "Myer");
message.setString("firstname", "Fred");
message.setString("id", "0200");
messageProducer.send(message);
connection.close();
} catch (NamingException e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
}
catch (JMSException e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
}
finally {
System.out.println("ENDED.");
System.exit(0);
}
}
}
Remarks:
- The tutorial is looking for a local server. Change (Context.PROVIDER_URL, “iiop://localhost:3700″) to the relevant server and port info.
- We use a topic (publish/subscribe) in this sample. If you want to use a queue instead, change to the lines which are commented out and remove the topic related lines.





