Saturday, July 31, 2010

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

The new Oracle Enterprise Pack for Eclipse Release (11.1.1.6.0) 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.

OEPE and WLST
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.

16.11.2010
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

17.11.2010
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

18.11.2010
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: https://ajax.dev.java.net/eclipse
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 Manifest.mf 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.
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
[...]

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: http://download.java.net/glassfish/eclipse/helios.
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 http://download.oracle.com/otn_software/oepe/helios/wtp 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 ..