Recent Tips and News on Java, Java EE 6, GlassFish & more :
PlanetMySQL Voting: Vote UP / Vote DOWN
Recent Tips and News on Java, Java EE 6, GlassFish & more :
![]() |
FISL is the biggest open source conference in Latin America and had about 7000 participants in the FISL 12 that concluded earlier this week. This was my third consecutive year (2010 and 2009) and as every year the conference was packed with lectures, workshops, demonstrations, booths, presentations, and lot more. |
Recent Tips and News on Java EE 6 & GlassFish:
|
GlassFish
•
An Eclipse / GlassFish / Java EE 6 Tutorial
Converged Applications and SailFin • Glassfish Enterprise Server What Is Diameter Protocol? JavaEE 6 and Spring 3.0
•
Java EE 6 and Spring 3.0
Conferences
•
Java EE 6 & GlassFish @ JAX London & London JUG Trip Report
New Books Covering GlassFish |
Here are some tips that have been recently published on Java EE 6 & GlassFish:
Install and Run Apache Roller 4.01 on GlassFish and OpenSolaris
Dave Koelmeyer has posted Detailed Instructions on how to install Apache Roller 4.01 on GlassFish v2.1 using MySQL 5.1 for storage. He uses OpenSolaris snv_134, the subject of a tea-leaf-reading thread.
Slides and Code Samples on Jersey and JAX-RS
The Slides and code from Paul Sandoz's presentation at Presentation at AlpesJug on Jersey, JAX-RS and Atmosphere are now now available. The actual presentation was in French, but the slides are in English, and the code is... code.
Invoke OSGi Service from JAX-WS Endpoint
Arun has published yet another TOTD (Tip Of The Day), with complete instructions and code. This one is
TOTD #130: Invoking a OSGi service from a JAX-WS Endpoint. Arun's approach is to document the demos he gives at his presentations through the TOTDs. Quite a bit of work, but it makes the content useful to a world-wide audience.
WAS V7 - Inching Towards JavaEE 6
IBM has recently been using a "Feature Pack" approach in upgrading its WebSphere AppServer; it seems to work pretty well for them and they released two packs for WAS V7: Feature Pack for OSGi and JPA 2.0 and Feature Pack for SCA. IBM is, of course, one of the Java Licensees; WAS v7 is one of the JavaEE 5 Compatible App Servers, the feature pack aproach helps it move towards the JavaEE 6 list.
VirtualBox at Oracle
One of the challenges during Hands-On-Labs is setting up: the attendees usually bring their own laptops but each of them is different and requires slighlty different setup. Asking for prep work before attending is not always successful. A solution now being used in some DB HOLs at Oracle is to Use VirtualBox. Which is the same approach that both Arun and Alexis had advocated for a new series of GlassFish HOLs being planned.
GlassFish CLI
Masoud has a detailed post - actually a book chapter - that you should read to Learn the GlassFish v3 Command Line Administration Interface (CLI)
JavaOne 2010
This year's JavaOne is the first under Oracle and will coincide with Oracle OpenWorld. Some things will be different, but others are mostly the same - including how the content is being selected - see Sharat Chander's interview by Tori Wieldt for some answers; others will evolve as we get closer to the event.
OSGi/JMS/MDB Example
Sahoo's latest post describes a hybrid OSGi/JavaEE example that uses JMS and Message Driven Beans and leverages GlassFish v3. Post includes source code and detailed description.
Siebel CRM Support for the iPad
Oracle shows how to use their server-side REST APIs and the iPad SDK to provide access to Siebel CRM from the iPad. Devices like the iPad (and the iPhone) seem a very good match for the Oracle Fusion Applications.
Innovating at Warp-Speed: Monitis Announces Java Monitoring from the Cloud
Monitis announces Java Application Monitoring, a cloud-based monitoring solution for JMX-based applications, including GlassFish containers. More details in announcement and product page.
EJB 3.1 Asynchronous Session Beans
From Paris, with love... Patrick Champion provides a short example of using EJB 3.1's @Asynchronous annotation. More benefits of JavaEE 6!
Alfresco community 3.3 installation on Glassfish
A short but detailed description of how to install Alfresco Community 3.3 with GlassFish v2.1 and MySQL.
Getting started with Glassfish V3 and SSL
The JavaDude provides a tutorial on how to use GlassFish v3 with SSL.
| @javax.ejb.Stateless @ManagedBean public class StateList { @PersistenceUnit EntityManagerFactory emf; public List<States> getStates() { return emf.createEntityManager().createNamedQuery("States.findAll").getResultList(); } } |


| @Stateless public class StateBeanBean { @PersistenceUnit EntityManagerFactory emf; public List<States> getStates() { return emf.createEntityManager().createNamedQuery("States.findAll").getResultList(); } } |
| @ManagedBean public class StateList { @EJB StateBeanBean bean; public List<States> getStates() { return bean.getStates(); } } |
| @Stateless public class StateBeanBean { @PersistenceContext EntityManager em; public List<States> getStates() { return em.createNamedQuery("States.findAll").getResultList(); } } |



| package server; import java.util.List; import javax.faces.bean.ManagedBean; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import states.States; /** * @author arungupta */ @ManagedBean public class StateList { @PersistenceUnit EntityManagerFactory emf; public List<States> getStates() { return emf.createEntityManager().createNamedQuery("States.findAll").getResultList(); } } |
| Show States |
|
<h:dataTable var="state" value="#{stateList.states}"
border="1"> <h:column><h:outputText value="#{state.abbrev}"/></h:column> <h:column><h:outputText value="#{state.name}"/></h:column> </h:dataTable> |


| ~/tools/glassfish/v3/58/glassfishv3/bin >sudo mysql --user root Password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1592 Server version: 5.1.30 MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database states; Query OK, 1 row affected (0.02 sec) mysql> CREATE USER duke IDENTIFIED by 'glassfish'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL on states.* TO duke; Query OK, 0 rows affected (0.24 sec) mysql> use states; Database changed mysql> CREATE TABLE STATES ( -> id INT, -> abbrev VARCHAR(2), -> name VARCHAR(50), -> PRIMARY KEY (id) -> ); Query OK, 0 rows affected (0.16 sec) mysql> INSERT INTO STATES VALUES (1, "AL", "Alabama"); INSERT INTO STATES VALUES (2, "AK", "Alaska"); . . . mysql> INSERT INTO STATES VALUES (49, "WI", "Wisconsin"); Query OK, 1 row affected (0.00 sec) mysql> INSERT INTO STATES VALUES (50, "WY", "Wyoming"); Query OK, 1 row affected (0.00 sec) |
| ~/tools/glassfish/v3/58/glassfishv3/bin >asadmin start-domain |
| ~/tools/glassfish/v3/58/glassfishv3/bin >./asadmin
create-jdbc-connection-pool --datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype
javax.sql.DataSource --property
"User=duke:Password=glassfish:URL=jdbc\:mysql\://localhost/states"
jdbc/states Command create-jdbc-connection-pool executed successfully. ~/tools/glassfish/v3/58/glassfishv3/bin >./asadmin ping-connection-pool jdbc/states Command ping-connection-pool executed successfully. ~/tools/glassfish/v3/58/glassfishv3/bin >./asadmin create-jdbc-resource --connectionpoolid jdbc/states jdbc/jndi_states Command create-jdbc-resource executed successfully. |





| @PersistenceUnit EntityManagerFactory emf; |
|
List<States> list =
emf.createEntityManager().createNamedQuery("States.findAll").getResultList(); out.println("<table border=\"1\">"); for (States state : list) { out.println("<tr><td>" + state.getAbbrev() + "</td><td>" + state.getName() + "</td></tr>"); } out.println("</table>"); |


