Saturday, July 31, 2010

Getting started with WLST and Oracle Enterprise Pack for Eclipse (OEPE)

The new Oracle Enterprise Pack for Eclipse Release ( is out. One major new feature is the WLST (WebLogic Scripting Tools) integration.

What is the WebLogic Scripting Tool?
The WebLogic Scripting Tool (WLST) is a command-line scripting interface that system administrators and operators use to monitor and manage WebLogic Server instances and domains. The WLST scripting environment is based on the Java scripting interpreter, Jython. In addition to WebLogic scripting functions, you can use common features of interpreted languages, including local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic scripting language to suit their environmental needs by following the Jython language syntax. The OEPE integration is based on PyDev version 1.5.7, a Python Development environment provided by Aptana.

Up to yesterday, you were able to use WLST in basicaly three modes. Interactively, on the command line; in a text file—Script Mode; Embedded in Java code. The new OEPE release introduces a new project facet (Oracle WebLogic Scripting tools support) which enables you to write and execute your WLST scripts directly from and within OEPE.

Getting started
Take one of your favorite projects or create a new one and add the new facet to it.

Now you should see a "wlst" folder within your project. Right click and select "New - WLST Script". The following dialog allows for assigning a filename and selecting a template. There are already a couple of templates available. If you select the sample "Configure JDBC Datasource" you have a quite common task at hand with which you can play around a bit.

All you have to do is to write your wlst script and if ready, select "Run As... - WLST Run". Now your script gets executed against the configured server for your project. This has to be up and running already of course.

WLST Views
There are a couple of new views and view integration available for the WLST support. Beside the .py editor you can use the MBean browser.
It allows browsing of the complete server MBean tree. You can also drag an drop any node into your wlst script editor for easy reference. The first thing I got stuck with were the missing server control functions from within the browser view. They did not make it to this release. Let's hope for a future one :)
Another new view is the  WLST Help view. It provides an Eclipse integrated version of the command and variable reference from the WebLogic documentation. More details can be found in the latest Oracle FMW WebLogic Scripting Tool Command Reference (10.3.3). This document describes all of the commands that are available to use with the WebLogic Scripting Tool (WLST). This document includes WLST commands for WebLogic Server, as well as custom WLST commands that can be used to manage installed Oracle Fusion Middleware components.

All the script output goes to the Eclipse console. With a standard installation it gets mixed up with all the other console out. You can prevent this, if you assign a separate console to the WLST output.

Will blog about other new features shortly. Stay tuned.

Wednesday, July 28, 2010

JDK 1.6.0_21-b06 Eclipse vs. 1.6.0_21-b07 Oracle

Some confusion today about the latest 1.6.0_21 build. Oracle released the 1.6.0_21-b06 a few days ago. Beside some new features it also silently introduced one rebranding (With Java 1.6.0_21, the ("\\StringFileInfo\\%04x%04x\\CompanyName") has changed in the java.exe and javaw.exe programs from "Sun Microsystems, Inc" to "Oracle". ).
Any Eclipse version since 3.3 (released 2007) until and including the recent Helios release (2010) has been reported to crash with an OutOfMemoryError, because this flag decided whether the "-XX:MaxPermSize" argument needs to be used or not.(compare eclipse bug and Oracle JDK bug). There are a couple of workarounds available. Most basically they all talk about adding the -XX:MaxPermSize= VM argument manually. (Find a complete list here.)

This lead to some hard comments within the community and the bottom line was:
Making such a change in a Service Release, that breaks clients like Eclipse
(and probably others) seems like a no-no. Perhaps THEY could take it back and
release a jre 6u21a with the original vendor string. I claim that this can be
filed as a "critical" issue.
(Source: Martin Oberhuber 2010-07-14 11:01:34 EDT )

In consideration to Eclipse and other potentially affected users, Oracle has restored the Windows Company Name property value to "Sun Microsystems".
The change affected only the Windows version of the JRE, not the versions for Solaris and Linux. To accommodate this update the Windows build version will increase from 6u21-b06 to 6u21-b07. Solaris and Linux distributions will continue to ship build 6u21-b06.

This all feels like it is Oracle to blame again. Partly right:
a) for doing changes, that were not documented
b) for not testing their "own" products with a major IDE (Eclipse) on a major Dev OS (Windows).

But: It is also true, that the changed field is a platform specific field, which never should have been the basis for any configuration decisions taken in Eclipse. Therefore both parties have failed on this somehow.

Btw: The JDK7 releases will change all branding from Sun to Oracle, including the java.vendor and java.vm.vendor properties.

Oracle ACE and ACED at DOAG Conference and Exhebition 2010

Today the program for the German DOAG Conference and Exhibition 2010 was published. There are quite some ACEs on the agenda and I thought I share it to you.
If you are in Germany in November, you should visit the DOAG Conference. More than 300 sessions and for the first time separate JAVA and MySQL Tracks! Look at the complete conference program to find out more.

12:00 - 12:45,
Benutzeroberflächen in SOALandschaften
Torsten Winterberg, OPITZ CONSULTING GmbH, Oracle ACE Director

13:00 - 13:45
Strategien auf dem Weg zum Cloud Computing
Björn Bröhl, OPITZ CONSULTING GmbH, Oracle ACE Director

15:00 - 15:45:
MYSQL: MySQL Idiosyncrasies that bite
Ronald Bradford, Oracle ACE Director

15:00 - 15:45:
Normalisierung von CDC Events mit Complex Event Processing (CEP)
Guido Schmutz, Trivadis AG, Oracle ACE Director

16:00 - 16:45:
Edition-Based Redefinition: Live in SQL*Plus,
Prof. Daniel Morgan, University of Washington, Oracle ACE Director

10:00 - 10:45:
MYSQL: PBXT: A Transactional Storage Engine for MySQL
Paul McCullagh, PrimeBase Technologies GmbH, Oracle ACE Director

10:00 - 10:45:
Java Enterprise Edition 6
Markus Eisele, msg systems ag, Oracle ACE Director

12:00 - 12:45,
Advanced Oracle Troubleshooting - Live Session
Randolf Geist, Freelance Consultant, Oracle ACE

15:00 - 15:45,
Use Constraints to Improve the Performance
Joze Snegacnik, DbProf d.o.o., Oracle ACE Director

16:00 - 16:45,
State Engine als SCA Komponente in Oracle SOA Suite 11g
Guido Schmutz, Trivadis AG, Oracle ACE Director

13:00 - 13:45,
Aus alt mach neu
Markus Eisele, msg systems ag, Oracle ACE Director

Tuesday, July 27, 2010

Updating GlassFish Server Adapter with Eclipse 3.5 (Galileo) and 3.6 (Helios)

A coworker asked for this recently. If he tries to download the additional server adapter for GlassFish Java EE 5, Java EE 6 1.0.54 with his 3.5 Eclipse he gets the following error:
[... truncated to the relevant parts ;)]
Cannot complete the install because of a conflicting dependency.
Only one of the following can be installed at once:
Sun Application Servers and GlassFish Servers support 1.0.52
GlassFish Java EE 5, Java EE 6 1.0.54

He tried "check for updates" on the complete distribution but this does not work. Even downloading the packages and replacing them directly within Eclipse does not work. After some research, I believed I found a solution:

If you try to simply "install the 1.0.54 as a "new extension", you will get the above error because of the already installed .52.
What you really need is an update. Lets give it a try:

1) Start Eclipse 3.5.x. or 3.6.Mx (Make sure that the WTP (Web Tools Platform) plugins are installed.)
2) Start the installation procedure : select the Help>Software Updates>Find and Install... menu item.
3) Select "Search for new features to install" option and click Next.
4) Click New Remote Site...
5) Give a name (ie GlassFish Eclipse Site), enter the URL:
6) Select this new site in the Sites to include in search list and click Next.
7) Select "GlassFish v2.x Java EE 5 and v3 Java EE 6 support" in the "Select the features to install" list and click Next.
8) Review the "Your original request has been modified." window and click Next.
9) Accept the terms of the license agreements and click Finish.
10) Wait for the installation to complete

This should be everything to do. But unfortunatualy this update fails due to a missing within com.sun.enterprise.jst.server.sunappsrv_1.0.54.jar.
An error occurred while loading the manifest D:\Program Files\eclipse-jee-galileo-win32\plugins\com.sun.enterprise.jst.server.sunappsrv_1.0.54.jar. error in opening zip file
at Method)

And: btw. This even does not work with 3.6. :(

If you are running Helios (3.6) you can make a new try. All the above steps with a different URL:
The 11th step is to confirm that you are willing to install unsigned content. if you choose yes, you are asked to restart Eclipse. This works and you are done.

You are now able to create new Server Runtimes:
  • GlassFish 2.1 Java EE 5
  • GlassFish Server Open Source Edition 3 (Java EE 6)
  • Sailfin v2

I did not manage to get all this working with 3.5 :( Seems as if the whole server adaptor plugins situation is a mess at the moment. I hope, that this will be resolved shortly. Mainly because the GlassFish Plugins will move to the Oracle Enterprise Pack for Eclipse (OEPE) (compare this bug entry) and will be available at this url in the future. This will happen with the next OEPE release (which is expected to arrive shortly). At the moment this page is not available.

Oracle: if you are reading this: Please provide updates for 3.5 also. Don't expect anybody to
a) use OEPE or
b) always update to the latest environments

If anybody knows a solution to this .. let me know ..

Monday, July 26, 2010

iPad for Business? About the why ...

I am playing around a bit with the iPad since some weeks. And a while ago I told you, that I am not going to buy one. This did not change for me personaly. But what I have seen is, that there is growing interest in the device and the possible usecases with business customers. This is hard to believe on the first look. But if you take some time to think about this, you know why. This is a brief introduction into the topic. Why there is such a hype about the iPad for business and what are the basics behind it.
Upcomming posts will talk about the technical details and design approaches. Stay tuned for this.

The younger history
Apple sold more than 3 million devices in the 80 days after its introduction in the US. The press release states that the iPad is
.. a revolutionary and magical product that allows users to connect with their apps, content and the Internet in a more intimate, intuitive and fun way than ever before.
(Source: Apple Sells Three Million iPads in 80 Days)
It's hard to follow, if you are not an Apple fanboy, but what is shure is, that Apple is able to build up a magical hype around their product like they did before with others. A more recent survey done by Citrx shows that 56% of the companys are willing to buy iPads.
Note that this informal survey was completed by 558 individuals who came to the Citrix web site and had an interest in the iPad. This means they are predominantly Citrix customers who understand the capability to safely enable access to company apps and data in the data center.
(Source: Citrix blog

Built-in Apps for business?
Apple launched a seperate iPad for business page. If you google around for the words iPad and business you get there directly. According to this, Apple is willing to let you go into business with their built-in applications. These are namely:
  • Email, Calendar, and Contacts.
  • Safari web browser.
  • iWork for iPad (Keynote, Pages, and Numbers)
Beside this, you get built-in security and easy configuration together with beautifull accessories. But, hey, is this realy the way, Apple likes to see their products beeing used in business? As a briefcase, a whiteboard and a dashboard replacement with email and calendar? Next big thing for Apple in terms of business is the basic integration approach for enterprise infrastructure. If you are willing to integrate the iPad to your enterprise you can look at Apple's
Enterprise Deployment Scenarios (PDF). They describe how to integrate the iPad into enterprise environments. Based on the following products and standards:
  • Microsoft Exchange
  • IMAP, CalDAV, and LDAP
  • Virtual Private Network (VPN)
  • WPA2 Enterprise/802.1X
  • Digital Certificates
  • Device Configuration Overview
  • Over-the-Air Enrollment and Configuration
All this sounds quite nice. But I was still missing the real usecases behind this.

What is ready to add?
Let's look at this in more detail. If you are not comfortable with the built-in apps and you are willing to use more of your business applications and infrastructure, than you have to go for the apps. Apps is an abbreviation for application. An app is a piece of software. Many vendors refer to their services as "App". But to me it seems as if this is more closer related to iOS apps than to any other product or service. The Appstore hosts roughly 225.000 Apps (May 2010, Source: There even is a separate apps for work category. The number of showcased applications is not too big. A category search for "business" apps on the appstore reveals more apps but there are enough not realy related inbetween. But you might find usefull things like a FedEx.
The most usable thing you can get is the Citrix Receiver App for the iPad. It gives you access to all of your corporate Windows applications and desktops. (visit the product page for more information)

Why should you care for the iPad?
That's all nice information. But what about reading sooo much text on a development blog? And why the hell should you care about the iPad?
According to the results of the Citrix survey, most people are willing to use the iPad for increased mobility (80%) and improved productivity (74%). 62% of the participators are hoping to get business information and dashboards on it. If you compare this to the sold devices and the available apps, you get a business case. If you have a customer working with your apps, he is most likely going to have an iPad soon. Go: Make your applications ready for the it and sell it to him!

Second part in the series: What and how to create.

Wednesday, July 21, 2010

Unboxing the JavaRoadTrip t-shirt

Java developers, architects, programmers, and enthusiasts: get ready for a real adrenaline rush. Java Road Trip: Code to Coast tour as it journeys to 20 cities across the United States showcasing Oracle's commitment to everything Java.

I caught them during ODTUG Kaleidoscape earlier this year and brought some t-shirts home. One of them was a present for a fellow co-worker of mine. He got it yesterday and here is the process of unboxing it. It was not too easy taking the pictures. He was quite excited!

Packed as a surf board. Wrapped up ;)

Ripping away the fancy paper

Trying to figure out what it realy is ..

Uncovering the print

Yes, it's a t-shirt ...

Links and Tips for OpenWorld, JavaOne and OracleDevelop 2010

Even if I still did not get my confirmation it is time to use the so called summer hole (even in germany we call it like this :)) to browse around and get ready for the number one event with Oracle and Java. This is a brief list of things to remember, to do, to see and links to visit prior or during your stay at one of the three conferences in San Francisco this year.

Visiting the US - p&p
Get yoursel a visa or at last an esta certificate.
Make yourself familiar with the needed prerequisites for entering the US. The is a great source of information. If you are unshure about anything, ask the US embassy in your home country. They are very helpful (at last in germany). It is not too big trouble to enter the US but you need some papers and patience. Be shure to have everything needed to enter the US weeks before entering the plane. That saves you a lot of pain.

Staying in San Francisco
For your convenience, Oracle has negotiated the lowest rates possible for Oracle OpenWorld San Francisco 2010. So it is possibly the best to check the official Oracle OpenWorld 2010 Housing page for the latest information. There is a list with the offical conference hotels, where you should find a place to take a nap. You should book as early as possible.

Make a plan! Content catalog. All sessions will be accessible only if you have scheduled them within your schedule builder. You can access this thing through the registration page. Don't be a fool and simply try to rush into any session withou prior registration. That will not work in most of the cases (even if in some it will).

There are many smaller to bigger events happening around OOW, J1 and OD in SF. The ones, you can't afford to miss are the following:

Welcome Keynote
Sunday: 5:30PM Oracle executives Judith Sim, Charles Rozwat, Safra Catz, and Steve Miranda along with Ann Livermore, executive vice president, HP Enterprise Business. Nice intro into OpenWorld.

Welcome Reception
After Sunday's opening keynote session Oracle OpenWorld 2010 gets kicked off with an authentic Oktoberfest celebration. Raise a stein (or two) of the finest German ale with fellow Oracle customers, partners, developers, and technology enthusiasts from around the globe. Located in the Howard Street Tent and Yerba Buena Oktoberfest Beer Gardens.

The FMW Keynote
Tuesday: 8:00AM Thomas Kurian, executive vice president, Product Development, Oracle, and Thomas Kilroy, senior vice president and general manager at Intel, speak Tuesday morning. This will not be too crowded. But also a very intersting Keynote for the middleware people.

The Larry Ellison Keynote
Wednesday: 2:30PM Larry Ellison presents his Oracle keynote Wednesday afternoon, joined by a key executive from Infosys. This is the place, where all the "show" is happening. Be there early. Don't think about 30 minutes. Think about 1 or more hours!

Appreciation Event
Happening Wednesday, Sept 22 on Treasure Island. Grammy Award Winners the Black Eyed Peas and Eagles cofounder Don Henley as headline acts, the 2010 event promises to be the ultimate in thank-you celebrations. Complimentary shuttle service to and from Treasure Island will be provided

It's a Wrap!
Happening Thursday, Sept 23 in the Yerba Buena Gardens and the Howard Street Tent. Have some beer and wrap up with your friends and partners.

stay connected
There are many many social activities going on during the conferences. You should check the relevant groups and accounts for the individual offerings. Here is a brief list. It might not be complete but a start:

Oracle OpenWorld
JavaOne and Oracle Develop

Oracle OpenWorld
Oracle Develop
Oracle Technology Network

Oracle OpenWorld
JavaOne and Oracle Develop

Oracle Mix
Oracle OpenWorld
Oracle Develop

Oracle OpenWorld Blog
OTN Blog

walking around in SF
Even if you schedule is packed, you have to walk around a bit in SF. It's easy and you should not miss this opportunity. There are many sources of information avalable about visiting San Francisco. I personaly like to use printed visitor guides in my own language. But there is also a hugh amount of information online. The local's Guide for People Visiting SF is a good example. All the online sources are not intended to substitute for your own good judgement. Take care of yourself and try to be a nice visitor. The SF people know what's happending during OOW. If you carry your badge around, you will find some stores where you get a rebate on your shopping. Watch out for more information on this.

My personal "must-see"s are:
The San Francisco Cable Cars, Fishermans Wharf, Alcatraz Island. If you are into buildings or photography you could also run around and look for the tallest buildings in San Francisco. Except the Alcatraz tour all this are easy good for easy visiting. You don't have to register or walk around too much and they fit into a free afternoon. But please remember: There are so many other things to see! Take the time to make up your own "must-see" list before visiting. It's worth it!

On demand preview gives you a first idea about the information you get from the On demand website during and after the show. You have to register for this option and pay a bit but it's worth it. You can search all sessions from one central repository. See
Keynotes, General Sessions and Executive Solution Sessions as streaming video with synchronized slides, scrolling transcripts, and downloadable MP3s and MP4s, look at
1700+ Conference Sessions in streaming audio with downloadable MP3s PowerPoints, white papers and more.

And finaly you I hope, you will have a save trip back home!
If I missed your favorite or did something wrong, let me know. Comments are open! Happy to read about yours!

Sunday, July 18, 2010

Review "GlassFish Security" by Masoud Kalali (PACKT Publishing)

The last weeks were full of work. But my evenings were dedicated to a newly published book.
Book: GlassFish Security
Language : English
Paperback : 296 pages [ 235mm x 191mm ]
Release Date : May 2010
ISBN : 1847199380
ISBN 13 : 978-1-847199-38-6
Author(s) : Masoud Kalali

The author
It's title promises to tell you everything about GlassFish security in detail. Beginning from secure GlassFish installations to secure enterprise Java applications (Web, EJB, Clients) including audits and measures. That was motivation enough to take the time working through the nearly 300 pages. It is written by Masoud Kalali. He has a software engineering degree and has been working on software development projects since 1998. He has experience with a variety of technologies (.NET, J2EE, CORBA, and COM+) on diverse platforms (Solaris, Linux, and Windows). His experience is in software architecture, design, and server-side development, high throughput and large scale software systems. Masoud has published several articles at and Dzone. He has authored multiple refcards, published by Dzone, including but not limited to Using XML in Java, Java EE Security and GlassFish v3 refcardz. He is one of the founder members of NetBeans Dream Team and a GlassFish community spotlighted developer.
Altogether this proofs for a good read and that was what I expected.

The content
The book has eight chapters. After a short introduction to the Java EE security model in chapter one it moves on to GlassFish security realms. Another twenty something pages tell you about designing and developing secure Java EE applications. Chapter four dives into secure GlassFish environments followed by the fifth chapter caring for a secure GlassFish itself. Done with those, you are half through at page 146. The second half of the book is dedicated to two other products from the former Sun stack. Open Directory Services (OpenDS) is introduced in Chapter six. Followed by an introduction to OpenSSO (Open Single Sign-On) in chapter seven. Chapter eight describes how to secure Java EE applications using OpenSSO. The last chapter nine is dedicated to Web Service security with Open SSO. Each chapter is finished by a separate summary. The book closes with an index. Makes 275 content pages.

Writing and style
The book is an easy read. Not to complicated even for non native speakers like me. The author takes the time and space needed to describe most basic concepts and contexts. Very frequent links and tips in separate boxes help the reader to find out more about most of the topics. I also like the paperback and the format. It is easy to carry around and to use it as a compendium.

My expectations
To be honest, I expected to read more about GlassFish and security as the title promised. Half the book the author is working with OpenDS and OpenSSO. Both not part of the GlassFish family and not necessarily related to Enterprise Java development. For sure, both products address problems developers face working. But every enterprise has it's own solution for this. And I personally do meet commercial products far more often.
The Java EE security basics are suitable for beginners. Nothing new to me and quite surprising, because I was looking for GlassFish specific content. It was there but only in between and not too prominent.
The most valuable to me are the GlassFish specific chapters about secure environments, realms and security administration.
I was disappointed not to see any personal tips and best practices from the author. As already said, he has quite some experience and you can even feel this reading the chapters. But the details are missing.

Conclusion and recommendation
After all my criticism: This is a good book worth reading. Not only for experts but especially for beginners. The experts might like it as reference book. Beginners get a most complete introduction to all security related issues around Java EE with GlassFish 2 and 3. Even if you should know Java EE and GlassFish prior to reading.

Wednesday, July 14, 2010

Beautiful twitter integration - TwittFont

This is, what the new TwittFont widget looks like. The (german) homepage of the new copperation between a german font provider (FontShop) and an agency (Moccu) provides a very simple way of configuring your own.
Even if you can't read german. This is basically a four step process.
1) Enter your search word or username
2) select display font
3) review the animation
4) select size and copy the html embed code

To me this looks awesome :) Even if it is flash :)

WebLogic Server Documentation Search

When was the last time you tried (!) to find some more detailed information about a problem related to core Oracle WebLogic server in the Oracle documentation system? I tried today. And nearly failed. Sorry to tell you Oracle, but this system simply is not usable (at last for me..). I still remember those good old edocs days, where all the needed information was readable and on my fingertips. To quickly find something within the Documentation Library you realy have to know where to look.
The points that I hate the most are:
- The WebLogic server documentation has become a part of the overall Fusion Middleware. Therefore you are no longer able to search "only" the server docs. This leads to many irrelevant results.
- The Oracle documentation search can not be limited to a single product. You can only choose more corsegrained "books".
- The urls for the WebLogic server versions are not memorable. You always have to click your way through the library to find, what you need.

This was the time to do something against this. I collected alle relevant urls and information and set up a separate google custom search for any weblogic version. The following table summarizes all needed links. Hope, this is usefull to you.
Any hints and tips for URLs to in- or exclude are appreciated.

Product Version Link Online Link Download Link to Search on google
Oracle WebLogic Server 10.3.3 E14571_01 google url
Oracle WebLogic Server 10.3.2 E15523_01 google url
Oracle WebLogic Server 10.3.1 E12839_01 google url
BEA WebLogic Server 10.3.0 E12840_01 google url
BEA WebLogic Server 10.0 E13222_01 google url
BEA WebLogic Server 9.2 E13222_01 google url
BEA WebLogic Server 9.1 E13222_01 google url
BEA WebLogic Server 9.0 E13222_01 google url
BEA WebLogic Server 8.1 E13222_01 google url

Tuesday, July 13, 2010

Static content serving with WebLogic Server

If you need to server any kind of static content you always have to decide how to do this. This post describe the different ways of static content serving within a WebLogic server installation and gives you a brief idea where to look at and what your options are.

The problem
Imagine your brand new application. It is hype and provides large amounts of video and full quality images to your users. The filesize varies from few kb up to hundreds of megabyte. Imagine you have 1000 different resources available the size quickly rises up to hundreds of gigabyte. If you think about the time it takes to build and copy an application with such an amount of resources, you quickly notice that you are not willing to put them into your archive.war! But what are the options?

Static content through a webserver
The most obvious solution would be to skip the static content and leave it's handling to those optimized for it. Apache is the most well known representative from the group of professionals handling static content. You can use the WebLogic Webserver Plugins to decide on redirection rules. The static content will be served from the Apache and the configured dynamic content will be redirected to the WebLogic.
A simple example of packaging a separate content archive from your build with maven can be found in an earlier blogpost of mine.

- fast content serving
- no war bundling
- option to do runtime changes

- no direct access from wls
- no wls security

Static content as library
Next option is to use weblogic shared libraries to bundle the static content. All you have to do is to package a content.war according to the shared libraries packaging conventions and deploy it to your server. Now you can reference the library from your application and use the contained resources. Read more about a simple but complete example in this blog post.

- simple packaging and deployment
- use of all library features (e.g. versioning)
- wls security

- no direct access from wls
- large deployment

Static content as virtual directory
There is the weblogic specific web application deployment descriptor (weblogic.xml) that enables you to specify so called virtual directories. You can use the virtual-directory-mapping element to specify document roots other than the default document root of the Web application for certain kinds of requests. They do not necessarily have to be within your webpplication. You can specify any kind of directory on your server machine. This could look like this:


The WebLogic Server implementation of virtual directory mapping requires that you have a directory that matches the url-pattern of the mapping. The video example requires that you create a directory named E:/virtualDirectory/content/video.

- fast content serving
- no war bundling
- option to do runtime changes
- wls security


Static content through a Dispatching Servlet
You can of course write your own resources servlet for delivering content, that lie in any filesystem. Of even find some examples on the web (e.g. Spring ResourceServlet).

- no war bundling
- option to do runtime changes
- wls security

- wasting precious resources

Which solution to choose highly depends on you infrastructure and requirements. There are plenty of more advanced solutions (e.g. traffic cluster, caching) to optimize static content delivery which are not covered in this article. The most widespread solution to deliver large amounts of static content is the Webserver approach. As the word static denotes, it is all about non frequent changing content. This is nothing that should belong to the application server at all. But if you are forced to deliver through the appserver, you should try to use the most efficient method. I did not do any research on the performance of any of the approaches, but it seems obvious that the build in virutal-directory solution is the fastest one in terms of delivery.

Monday, July 12, 2010

OEPE - tech preview - 11gR1 ( for Eclipse Helios (3.6). And the future with GlassFIsh.

Looking around the web is good for surprise findings from time to time. My latest discovery is the OEPE 11gR1 ( tech preview update for Eclipse Helios (3.6).
The latest OEPE Release ( still runs on Eclipse Galileo (3.5.2).

If you want to testdrive the latest tech preview, you obviously need Eclipse Helios first. Before going any further: Be aware that Eclipse 3.6 Helios is final but the tech preview is based on the M6 milestone release of Eclipse 3.6.
If you are planning to play with it anyway: Go, get it!.
Unpack it to a suitable location and start it. Next is to add the tech preview update site: A detailed description is provided on the Eclipse marketplace.
If all this does not work, you can get a preconfigured version from otn. It is a 222MB download and takes some time.

What do you get with this preview? Quite simple answer. Everything you have with the GA. Plus one thing: It runs on new Helios (M6) release. No new features and nothing else surprising.
I was not able to get this running with the latest GA release. Therefore, save yourself some time: Don't try this. It's not worth it up to now. But if you are planning to be up to date with your Eclipse versions, you can take a first sneak at OEPE running in it.

Features of upcomming releases?
You know: I don't know anything. And you know Oracle. They will not tell anybody anything until it is ready. Therefore please keep in mind, that the following is just speculation. As always, I am happy to hear your ideas about this.

If you look around a bit, you find some more information about some (planned) features and the (first impressions of a) timeline:
Inside the GlassFish project, you find the famous "OnePager"s. One among others is the GlassFish Server Open Source Edition 3.1 - Eclipse Integration One Pager. It outlines the general approach for OEPE towards it's GlassFish integration. The OEPE GlassFish integration is based on the GlassFish plugins for the Eclipse Web Tools Platform (WTP). Therefore this is the right place to look. The basic outline is:
All the exposed Java EE 6 features of the Eclipse IDE should work with minimal configuration with GlassFish 3 and 3.1 targets.
(Source: Eclipse Integration 1P.)

To speculate a bit, this means that OEPE will get full support for GlassFish 3.0 and 3.1. Beside the already existing support for WebLogic versions 8.1 through 10.3.3 (11gR1 PS2). This could also mean, that AppXRay & AppXaminer will run on GlassFish projects, too. And of course, that OEPE will be able to handle all GlassFish deployment descriptors. GlassFish will be the target of all the JAX-WS wizards that are currently very WebLogic centric. In general it will not make a difference if you are using GlassFish or WebLogic as the active target server.

My personal feature wishlist
I compiled the following as my personal wish list for next versions of OEPE. I would love to read, if you have some additional thoughts and ideas!

  • GlassFish and WebLogic should play together within OEPE to enable lightweight development with GF and productive staging to WLS instances. This should also be supported with a set of related maven plugins.
  • Seeing both servers having some kind of scripting, I would love to have it aligned, so that I can write one script and run it on both servers. This should be supported by the IDE in any possible way.
  • The already provided JRockit Mission Control Suite should be part of standard OEPE and be available with plugins for both servers.
  • A lightweight administration console for development proposes should be available for both servers. I don't want to fire up the console to change settings if I am working in my IDE.
  • I need Virtual EAR and FastSwap technology for GlassFish server instances, too.

Planned (?) Timeline
Again, this is what I tried making sense of the available information. Nothing commited up to now.
  • Eclipse 3.6: June 2010: Support for GlassFish 3.0.1 and nightly builds of GlassFish 3.1
  • OEPE release : July 2010.
  • OEPE Update : September 2010: mainly bug fixes on Eclipse 3.6.
  • Eclipse 3.6 Update: December 2010: possible date where more Java EE 6 wizards can be included in Eclipse itself. This is is update release that is targeted for support of the official GlassFish 3.1 release
  • Eclipse 3.7: June 2011: Goal is to cover 100% of the Java EE 6 wizards and GlassFish 3.1 update release.
If you now take a look at the planned schedule for GlassFish, you can draw some conclusions.

GF 3.1 M3 will be around 7/19/2010. Expect the new OEPE GA to be there, too. The September release will be there during or before JavaOne and it could be aligned with the GF M5 release on 09/13/2010. The complete Java EE 6 compatible OEPE will probably be available together with the GF 3.1 final around 12/13/2010. The complete Java EE 6 wizzard support for (JAX-WS, CDI, Bean Validation, etc) will be available at the end of Q2/2011.

Friday, July 9, 2010

Java SE 6 release 21, the Java Hotspot VM 17.0 and G1

Oracle released the Java SE 6 (1.6.0_21) build a few days ago. Unexpected this presents a bunch of new features and updates. Here are the major ones in short and a more detailed look at the also included Java Hotspot VM 17.0.

Supported Systems
Beside additional framework support for Oracle Enterprise Linux (4.8 -5.5), Red Hat Enterprise Linux (5.4, 5.5) and the Oracle VM this one also supports the 4.0 branch of Google's Chrome.
Look at thecomplete list of all supported system configurations for more details.

Customized Loading Progress Indicators
You can now enhance the loading experience of an application by providing a customized loading progress indicator/progress bar. You can replace the default loading progress indicator with a custom implementation that provides regular feedback about how the RIA is loading. To do this, you have to create a class that implements the DownloadServiceListener interface. Create and update the progress indicator in the following methods based on the overallPercent argument. These methods are invoked regularly by the Java Plug-in software to communicate progress of the applet's download. Java Plug-in software will always send a message when download and validation of resources is 100% complete.

public void progress(URL url, String version, long readSoFar,
long total, int overallPercent) { ... }

public void upgradingArchive( url,
java.lang.String version,
int patchPercent,
int overallPercent) { ... }

public void validating( url,
java.lang.String version,
long entry,
long total,
int overallPercent) { ...}

For mor details look at the new Customizing the Loading Experience tutorial.

Java VisualVM Updates
Now Java VisualVM based on VisualVM 1.2.2 is included. It introduces all related features. Look at the release notes for a list of bugfixes and new features.

268 bugfixes
Java SE 6 Update 21 does not contain any additional fixes for security vulnerabilities compared toUpdate 20. So there is basically no need to update. Beside this, there are 268 issues fixed with the new update. Most of them related to "hotspot" category the "runtime system" and the garbage collector. For details please refer to the complete list of bugfixes.

Java Hotspot VM 17.0
The new JVM includes version 17.0 of the Java HotSpot Virtual Machine. This has overall improvements to quality and features such as compressed object pointers, escape analysis-based optimization, code cache management. The most interesting part is the successor of the Concurrent Mark-Sweep garbage, the Garbage First (G1) garbage collector (GC). The G1 is a new GC that is being introduced in the Java HotSpot VM in JDK 7. An first experimental version of G1 has already been released in Java SE 6 Update 14. VM 17.0 now again contains an improved version.

G1 is a "server-style" GC and has the following attributes.
Parallelism and Concurrency. G1 takes advantage of the parallelism that exists in hardware today. It uses all available CPUs (cores, hardware threads, etc.) to speed up its "stop-the-world" GC pauses. It also works concurrently with running Java threads.

Generational. Like the other HotSpot GC's, G1 is generational, meaning it treats newly-allocated (aka young) objects and objects that have lived for some time (aka old) differently. But there is no physical separation between the young and old generations. Instead, there is a single contiguous heap which is split into same-sized regions. The young generation is a set of potentially non-contiguous regions, and the same is true for the old generation. This allows G1 to flexibly move resources as needed from the old to the young generation, and vice versa.

Compaction. Unlike CMS, G1 performs heap compaction over time. Compaction eliminates potential fragmentation problems to ensure consistent long-running operation.

Predictability. G1 is expected to be more predictable than CMS. This is largely due to the elimination of fragmentation issues that can negatively affect stop-the-world pause times in CMS. Additionally, G1 has a pause prediction model that, in many situations, allows it to often meet (or rarely exceed) a pause time target.

G1 is still considered experimental and is available in Early Access only. It can be enabled with the following two parameters:

-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

To set a GC pause time goal:

-XX:MaxGCPauseMillis =50 (for a pause time target of 50ms)

With G1, a time interval can be specified during which a GC pause should last no longer than the time given above:

-XX:GCPauseIntervalMillis =200 (for a pause interval target of 200ms)

The above two options represent goals. They are not promises or guarantees. They might work well in some situations but not in others.

Alternatively, the size of the young generation can be specified:

-XX:+G1YoungGenSize=512m (for a 512 megabyte young generation)

There are also comparable survivor spaces, which are, a set of (potentially non-contiguous) regions. Their size can be specified with the usual parameters (e.g., -XX:SurvivorRatio=6).

To run G1 at its full potential use these two parameters. They are currently disabled by default because they may uncover a rare race condition:

-XX:+G1ParallelRSetUpdatingEnabled -XX:+G1ParallelRSetScanningEnabled

My tests with the latest 1.6.0_21 showed, that both parameters are not working. If you are willing to test them, switch back to 1.6.0_20!

One more thing to note is that G1 is very verbose compared to other HotSpot GCs when -XX:+PrintGCDetails is set. This is because it prints per-GC-thread timings and other information very helpful in profiling and trouble-shooting. If you want a more concise GC log, please switch to using -verbosegc.
If you try this with WebLogic Server 11g you get a first impression what this means:
<08.07.2010 18:45 Uhr MESZ> <Info> <WebLogicServer>
<BEA-000377> <Starting WebLogic Server with 
Java HotSpot(TM) Server VM Version 17.0-b16 from 
Sun Microsystems Inc.>
[GC pause (young), 0.05034187 secs]
   [Parallel Time:  47.8 ms]
      [Update RS (Start) (ms):  83057.1  83058.3]
      [Update RS (ms):  1.0  0.0
       Avg:   0.5, Min:   0.0, Max:   1.0]
         [Processed Buffers : 15 0
          Sum: 15, Avg: 7, Min: 0, Max: 15]
      [Ext Root Scanning (ms):  35.6  33.4
       Avg:  34.5, Min:  33.4, Max:  35.6]
      [Mark Stack Scanning (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Scan-Only Scanning (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
         [Scan-Only Regions : 0 0
          Sum: 0, Avg: 0, Min: 0, Max: 0]
      [Scan RS (ms):  0.3  0.0
       Avg:   0.2, Min:   0.0, Max:   0.3]
      [Object Copy (ms):  10.8  9.9
       Avg:  10.3, Min:   9.9, Max:  10.8]
      [Termination (ms):  0.0  0.0
       Avg:   0.0, Min:   0.0, Max:   0.0]
      [Other:   2.3 ms]
   [Clear CT:   0.1 ms]
   [Other:   2.4 ms]
   [ 200M->26M(256M)]
 [Times: user=0.08 sys=0.03, real=0.06 secs]


[Full GC (System.gc()) 65M->27M(256M), 0.4923866 secs]
 [Times: user=0.53 sys=0.00, real=0.50 secs]
See the G1 technology page for more information.
There has been a JavaOne session about the G1 in 2008. Find some slides and more on this page.

Wednesday, July 7, 2010

NetBeans is targeted at being the number-one open source IDE

I found a article which talked about an "Oracle spokesperson" which was interviewed by

Since the beginning of the Sun/Oracle merger the rumors about which products will go and which ones will stay do not stop. And many people are still unshure about the future. This is more or less driven by anybody speculating. Especially if they are "officals" like Mike Milinkovich, executive director of the Eclipse Foundation who said:
"Having NetBeans and Eclipse competing with each other in offering free IDEs for Java developers is not helping Java any longer. So we'd be open to doing something to bring those communities together. The big win is that it's not the Eclipse or the NetBeans community, it's the Java community."

The Oracle spokesperson, who was not named expressed what we all already heard:
"Both products [ed: Eclipse and NetBeans] are being actively developed and are both part of Oracle's Developer Tools strategy"
"NetBeans is targeted at being the number-one open source IDE for all of the Java technologies"
"Its focus is to ensure that Java developers of any skill level can be productive in building with and taking fullest advantage of all the Java technologies."

And this is still what to expect if you ask me. I had the pleasure to talk to some Oracle people at ODTUG Kaleidoscope this year and I tried asking them the same questions about NetBeans and Eclipse. The outcome was basically the same. NetBeans will be a community product supported but not driven by Oracle.
Eclipse on the other hand will be supported as it already is until now. Beside the donated projects (e.g. EclipseLink) there will be the Oracle Enterprise Pack for Eclipse (OEPE) which:

[...] "is specifically aimed at supporting developers building applications on the Oracle stack. The Oracle stack includes products such as Oracle Database, Oracle Coherence, and Oracle WebLogic Server. "

What was not mentioned by the spokesperson is GlassFish. I personaly expect it to be supported by OEPE also in the future.
For me it seems as if Eclipse is as important to Oracle as NetBeans is. Both are very broadly used IDEs and have their users. Nobody is going to change this. And if somebody is expecting that Oracle might drop support for one or the other I would love to know what their reasons should be.

Tuesday, July 6, 2010

JRockit Mission Control Suite and WebLogic Server

The JRockit Mission Control tools suite includes tools to monitor, manage, profile, and eliminate memory leaks in your Java application. The best part in this is, that this is done with zero performance overhead in production environments.
This short howto will walk you through the most basic features and introduce you to some (unsupported) experimental plugins.

You should have a WebLogic Server installation running JRockit R28 in place already. If not, it's time to get the latest 11gR1 (10.3.3) from OTN.
First is to grep a copy of the installer from OTN. Depending on your OS (Linux x86, Linux x86-64, Solaris SPARC 64-bit, Windows x86, Windows x86-64) and Java version you have to download roughly 100 MB. I am using the Oracle JRockit Mission Control 4.0.1 for Windows x86 and Java 6.
Select an installation directory of your choice and if you like, you can choose to install Demos and Samples and the Source Code. The installer comes with a public JRE also. But you don't need it for the things we are going to try next.

Normaly you don't have to configure anything on the jrmc itself. Just go to your %RMIC_INSTALL%/bin dir and fire up jrmc.exe.
If you are behind a corporate proxy you have to tell Java to use it. I was not able to find any configuration file, therefore I looked around and added a mc.bat/sh to the %RMIC_INSTALL%/missioncontrol with the following entries:

set JAVA_HOME=%WLSHOME%\jrockit_160_17_R28.0.0-679
set PATH=%WLSHOME%\jrockit_160_17_R28.0.0-679\bin
java -Dhttp.proxyPort=3128 -jar mc.jar

Why? Because of an experimental plug-in we are going to use. Start jrmc and go to "Help - Install Plugins ... (unsupported)" and expand the Experimental Update Site.
Select the Flight Recorder Plug-in WebLogic Tab Pack 0.0.7.
and click next. Accept the OTN Developer License Terms and click next. Click finish. Click install all and restart the jrmc. Please keep in mind, that this feature is an experimental plug-in for JRockit Mission Control. Experimental plug-ins are not supported by Oracle and are either sneak peeks of coming functionality, or useful functionality that is not part of the core distribution of JRockit Mission Control. This feature adds several tabs showing WLS related information.

To make use of the new features you have to enable the related producers within your WebLogic Server.
Check your domain startup files %WLSHOME%/user_projects/domains/your_domain/bin and make shure, you have Oracle as JAVA_VENDOR and add the following as JAVA_OPTIONS


Next is to fire up your wls (startWebLogic.cmd/sh) and launch the admin console (http://localhost:7001/console).
Goto: your_domain - configuration - general - advanced and enable the following two checkboxes (don't forget to save your changes):
Next is to go to your server instance and change the diagnostic volume to "High". Goto: Environment - configuration - general.
Now everything is configured, and you can start using jrmc with WebLogic server.

JRMC Features at a glance
The JRMC has a lot of features. Most basic functions are explained here. Later on I am going to describe the new WebLogic integration.

The Flight Recorder
The JRockit Flight Recorder is a performance monitoring and profiling tool that makes diagnostics information always available, even after catastrophic failure, such as a system crash. At its most basic, Flight Recorder is a rotating buffer of diagnostics and profiling data that you can access whenever you need it. You might consider it a sort of "time machine" that enables you to go back in time to gather diagnostics data leading up to an event. The data stored in the rotating buffer includes JVM and application events. The JRockit Flight Recorder is designed to be always on and its default configuration will not result in any performance overhead because it uses data that is collected by the JVM anyway.

The Management Console
To view real-time behavior of your application and of Oracle JRockit JVM, you can connect to an instance of the JRockit JVM and view real-time information through the JRockit Management Console. Typical data that you can view is thread usage, CPU usage, and memory usage. All graphs are configurable and you can both add your own attributes and redefine their respective labels. In the Management Console you can also create rules that trigger on certain events, for example, an mail will be sent if the CPU reaches 90% of the size.

The Memory Leak Detector
To find memory leaks in your Java application, you connect the JRockit Memory Leak Detector to the running JRockit JVM process. The Memory Leak Detector connects to the JMX (RMP) Agent that instructs to start a Memory Leak server where all further communication takes place.

WebLogic Flight Recorder Tab Pack for Mission Control (Unsupported)
The most interesting part is the new WebLogic integration. Start experiencing it with downloading the Default Recording, you enabled with the corresponding JAVA_OPTION. Right click on your WebLogic Server JVM and select "Dump Default Recording". Choose a timeframe and wait for the recording to be processed. select the blue icon (WebLogic) and see the general overview. You can now inspect all relevant events from the WLDF in a very conveniant gui based way.
The events produced by the WebLogic Diagnostics Framework (WLDF) are throttled per ECID (Execution Context Identifier). If an ECID is picked out by the throttler you will see all WLDF-events generated for a request flow with that ECID. You can control the number of ECIDs that are collected by setting the Diagnostic Volume to Low, Medium or High.

There are a couple of new tabs available.
This is a new tab providing an overview of the WLDF related events.
This is a new tab providing an overview of the events grouped by ECID.
This is a new tab listing events on a per user basis.
This is a new tab listing database related events.
This is a new tab listing EJB (enterprise java bean) related events.
This is a new tab listing JMS (message service) related events.
This is a new tab listing JTA (transaction) related events.
This is a new tab listing JAXRPC/JAXWS (webservices) related events.
This is a new tab listing servlet related events.
HTTP Requests
This is a new tab listing http related events from DMS. Some data may be unavailable unless the DMS producer was active during the recording.

Licensing and the future
JRockit Mission Control is a great tool. You are free to use it under the terms of the OTN License. The productive licensing changed a bit in the past. Latest statement from Oracle regarding the can be found in the JRockit FaQ:
JRMC will be included in various packages that include the JRockit technology. It will not be sold stand-alone under new licensing agreements, but will continue to be bundled with Oracle products.
(Source: FaQ)
Have seen the WebLogic Plugin? Wanting more? I do! I am wanting the same integration for the GlassFish. Anyway. There has not been any anouncements on this. The basic integration architecture allows for many integrations points and GlassFish can run on a JRockit. Let's wait for the future.

Links and Readings
Oracle JRockit Family Downloads
JRockit Mission Control Suite
Using WLDF with JRockit Flight Recorder