Tuesday, October 21, 2008

The Long Awaited JDK 6 Update 10 has been released

Here is the link where you could download the latest JDK.

http://java.sun.com/javase/downloads/index.jsp

I have heard about this long awaited release, JDK6u10 since the time I attended the Sun Developers' Day 2008, on June this year. Joey Shen presented what's new in this version.

Though the version name seems to be only minor update to the JDK 6, actually this version contains a whole bunch of improvement.

The most notable one explained by Joey Shen is the modular approach in downloading JRE. Now the JRE could be downloaded very fast, the initial will only be download only small piece of jar. Later other components will be downloaded on demand.

Why jump straight away from update 7 to update 10?

I believe these features weren't released as JDK 7 because JDK 7 has been released to the community as OpenJDK in which Sun Microsystems doesn't have the direct control over the release. There were some long discussion on what features should be in, not mentioning also when to release. Inherent problem with community driven release of such SDK is the delay caused by strong disagreement among the community.

So I guess that Sun just put a certain number for the next version, which turned out to be update 10 while we were in the update 5 or 6 just to be safe and give some lead time to complete the job. As there are lots of full timers and experienced employees working on the version Sun Microsystems could be better drive the release of update 10.  Eventually they finished long before update 8 being used, thus the number jumps from update 7 to update 10!

Tuesday, September 30, 2008

Using HTTP-based Subversion Repository for Local Maven 2 Repository

Maven 2 repository could be exposed to public using several protocols. The protocol will be reflected by how we access the repository. The popular ones are HTTP, HTTPS, Subversion, and of course direct file system access which should be reflected by URIs:
  • http://repo1.maven.org/maven2
  • https://localmaven.jugi.or.id
  • svn://kutukupret
  • file:///opt/maven2/repo
Subversion which is a source code management (SCM) software could also be exposed to public through HTTP/HTTPS protocol. 

Because most developers should have at least read only access to the source code base of the SCM software, any SCM software that is exposed through HTTP/HTTPS protocol could be easily tuned to be Maven 2 local repository as well. I will show the way to use SCM as Maven 2 repository using Subversion  but the principles will apply to any HTTP/HTTPS based SCMs.

Here is how we do it.

When you look to Maven 2 repositories such as http://repo1.maven.org/maven2, the structure is quite simple.
Grab the example the resource specified in this URL: 

We need to break down this URL into these fields:
  • artifactId: openjpa
  • groupId: org.apache.openjpa
  • version: 1.2.0
  • Maven 2 repository root URL: http://repo1.maven.org/maven2/



First Step on JDeveloper 11g TP4

Oracle has launched the Technology Preview 4 of the JDeveloper 11g IDE suite.
This version requires JDK 1.5.0 and only guaranteed to work on JDK 1.5.0. It supports and encourage developer to use Servlet 2.5 API, the latest specification of Java Servlet.

I downloaded the JDeveloper 11g Technical Preview 4 from here, and see what's we have in this latest preview version. Click "Accept" if you agree with the terms and conditions.

I will be using the "Base Install" version, which ship without the JDK.
Download and unzip the files to folder of your choice. Mine is [d:\opt\env\jdevstudiobase1111].
Execute the file [jdeveloper.exe].

Select the "Default Role" here. Click "OK" button.

I was using the JDK 1.5.0_13 but the system still prompted me this (it's a tech preview anyway - this 'feature' is not guaranteed to be available on the release version). Just click on the "Yes" button.


I just want to associate JDeveloper Workspace and JDeveloper Project with this tool.
Click "OK" button.


Here it goes, the Oracle JDeveloper 11g Technology Preview 4!


Tuesday, September 23, 2008

On Migration Problem from WebLogic 8.1 to 10.0

Somebody posted a question on an old entry of my blog, asking about the problem they have when migrating from WebLogic 8.1 to WebLogic 10.0. I pasted the question that was asked so that everyone could easily referred to it.
In order to be able to answer to your question I need more specific things:



  • What kind of WebLogic project are you using (is it a WebLogic Workflow Project or plain J2EE application), it will help me to identify what kind of 'compiling' is going on

  • If what BEA support asserted is correct (it was merely caused by the Sun JDK bug with zip file), you have an option to migrate to use the JRockIt! virtual machine instead; you have an option to set your JVM to JRockIt! when you are setting your domain



In the past, WebLogic Server is known only to work on certain version of Sun JDK which usually is not the latest one (may contain bugs that has already been fixed in the later version). I found out that the later version of WebLogic Server such as 10.x seems to be more compatible with the Sun JDK; means I have successfully run WebLogic Server on  the  latest version of JDK 1.6.0 which was not the case with 8.1 and 9.2 version.

On the later version such as 10.x, BEA (now Oracle) suggested to use JRockIt! JVM even for development. Previously BEA suggested to use Sun JDK for development and only use JRockIt! on production.

Using Sun JVM  you will experience java.lang.OutOfMemory caused by PermGenSpace is full (this is a normal and expected behavior), but you will have much faster deployment cycle (JRockIt! needs to precompile to native binaries for every things that are deployed, while Sun JVM only compiles to native part that is used often).

I guess that your problem happens while you are compiling EJB using the WebLogic Workshop IDE?



Anonymous said...

Hi,
I am trying to get information about Weblogic 10.0. 
So far, we have had a 
very hard time trying to migrate from Weblogic 8.1 to Weblogic 10.0. 
Do you know of anybody with experience on doing this migration? What type of problems did they found and how they got resolved?


We keep having OutOfMemory Exceptions when compiling EJBs...and servers not even start. We migrated from 8.1 all applications using Weblogic's domain upgrade utility. The configuration is preserved, and the applications are deployed, but when it tries to start, it is not able to do it. If it starts then it keeps finding OutOfMemory exceptions.

I am told from BEA support that this is caused by SUN JDK bug with zip files... What are my options?

 



 

 

 

Thursday, September 18, 2008

Reiterate JavaFX Again

Today our servers being physically transported to the new office site. Initially I planned to fix things before leaving to Bangkok, but the moving coincide with my planned date. 
So today I spend my half day in the morning exploring JavaFx again.

I went back to my NetBeans 6.1 installation which is a bit dusty because I haven't touched it for a such long time.

I followed the JavaFX Clock application step by step and it works as advertised. For a Java developer the learning curve for JavaFX is not steep. Even considering the vast number of open source Java libraries lying around, it is an advantage!

I still am able to use the whole java.lang.* while using the javafx.application.* packages.

Before using the NetBeans version, I followed the Chuk Mun Lee's tutorial on the recent Sun Developers' Network 2008, which was using JavaFXPad. JavaFXPad is ok, only the code formatting and cut-and-paste feature is pretty much limiting. NetBeans has much better support as an IDE, you could even start to develop your JavaFX application.

Learn Java from Scratch

Yesterday I talked with a freshman from one of the local (Singapore) private university. Now he starts learning Java language. The curriculum required him to learn Java very fast with the small amount of introductory material. It translate to he has to do considerable amount of individual unsupervised work.
It good though that the university requires him to learn the Java language the hard way. Use text editor only and command line.

Next after they learn Object Oriented Application Development, they will be allowed to use sophisticated commercial development tools, such as IntelliJ IDEA which is available at his campus.

I still believe and support the idea that a better fundamental will be shaped when students learn Java the hard way, that is start from the command line compiler and the command line JVM invocation.

Wednesday, September 3, 2008

ItsNat: Java based Comet framework

Java based framework that supports Comet out of the box are out there right now. At least we have 3 now: Dojo, IceFaces, and now ItsNat!


It is dual licensed, GNU Affero GPL v3 or commercial license for closed source project.

This framework has it's own client/server both at the browser. The server communicate with the Java server, and the server communicates with the client side.

Wednesday, July 30, 2008

Java User Group Singapore Meeting Up

This is the photo of the last Java User Group Meeting Up at Singapore. The event was around February 18th, 2008.
The host is Ivan Petrov, which provided us with nice place and facilities, even a very nice food. What a great hospitality he had shown to us.
Ben Alex, Principal Software Engineer (3rd from the right), spoke on the to-be-released-soon version of Spring Security (formerly known as AcegiSecurity).
Ben showed us how much easier it is to use the SpringSecurity framework in your JEE web application.
Posted by Picasa

Thursday, July 17, 2008

Apache Tomcat 6.0 Cannot Undeploy Correctly

This 3 months I have been using Tomcat 6.0 for deployment, and one thing that I don't like is that the application server needs to be restarted most of the time when deploying. I remember that this is not the case with my previous development. I thought it was because the Tomcat 6.0. Later I found out that the problem is with the struts-core-1.3.9.jar library.

Several attempts have been made to use the antiJARLocking and antiResourceLocking features of Tomcat. All ends up in futility.

The struts-core-1.3.9.jar (as well as version 1.3.5, 1.3.8) as setup by maven 2 dependency, depends on the Apache commons-digester-1.8.jar. This version (1.8) of the commons-digester library has this bug specific to Windows environment.

There are some workarounds that is possible:

  • Upgrade to higher version of Struts (in the case of my current work, we are moving to struts2 which known not to have this problem)

  • Override the maven 2 dependency, and inject a new dependency to higher version of commons-digester library


First option is obvious, the next will be a bit tricky.
I will show you how to do it later...

Tuesday, July 15, 2008

Sun Developers Day 2008 at Singapore


Today I attended the Sun Developers' Day. My office is not in the habit of sending people to such events, so I have to be a proactive person, take a one day leave to attend this event.
"Sun Developer Day 2008 brings together visionaries, leading experts and developers to seize the next wave of technical innovation through Open Source".

Trends that were presented are in the topics of JavaFX, MySQL, OpenSolaris.

This is my first time attending Sun Developers' Day. There were Sun Developers' Day events in Jakarta, but I didn't manage to have time to attend one of them. 

Some thing that interest me are: JavaFX, VirtualBox, new OpenSolaris eye candy, MySQL tuning, and Solaris DTrace, JDK 6 update 10, Grails.


Matt Thompson, manager of the Sun Technology Evangelist group,  gave an opening message. 

Among the speakers were:

Chuk-Munn Lee, Senior Developer Consultant and Technology Evangelist for Technology Outreach at Sun Microsystems in Singapore.

Joey Shen (Zhuo-Li, Chinese), Technology Evangelist for Sun Microsystems based in Beijing, China.

Peter Karlsson, Solaris Technology Evangelist for Sun Microsystems. 

Raghavan Srinivas, CTO of Technology Evangelism at Sun Microsystems.


This even also intertwinned with JavaJive competition final between universities from Singapore, Malaysia, and Thailand. Previously local competitions have been held in their respective countries. The final presentation brought was won by team from Thailand.



Thursday, July 10, 2008

Liferay 5.0.1 with Tomcat bundle

Why did I choose the Tomcat bundle?

First, unarguably Tomcat is the most popular application server in the planet.
One of the SpringSource guys told me that based on survey, around 80% of the Spring framework
deployment are in Tomcat. There are lots of application currently in production that uses
Tomcat.

Second, that is what the Liferay 4.4 documentation suggest for the development.
(Sadly enough, currently there is no Liferay 5.0.1 documentation...)

Become a bit different from the manual, I choose PostgreSQL 8.2 as my development database instead of MySQL as suggested by Liferay manual. pgAdminIII 1.6.3 feels handy right here.

What you need to do with PostgreSQL is:

Copy the JDBC driver from PostgreSQL installation to the Tomcat library folder.
In my machine I copied from [C:\Program Files\PostgreSQL\8.2\jdbc\postgresql-8.2-506.jdbc4.jar]
to my [d:\opt\liferay-portal-tomcat-5.5-5.0.1\shared\lib] folder.

I edit the d:\opt\liferay-portal-tomcat-5.5-5.0.1\conf\Catalina\localhost\ROOT.xml
Comment out the tag for MySQL, uncomment and adapt the PostgreSQL section.
For my machine, it was setup like this. You might need to adapt to your own database setting.

<resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/lportal"
username="lportal_client"
password="liferay"
maxActive="20"
/>

Remember that some default configuration of PostgreSQL installation disabled the TCP/IP access
to database. You need to enable that, and also you might need to grant permission to where the
TCP/IP client located (in this case your Tomcat application server).

As suggested by the manual, Liferay will do the magic when you change the database, provided
sufficient rights to access the new database. Of course the magic takes some time to perform.

Access the web browser on the url [http://localhost:8080/]. It will display this screen:

Login using:
user: test@liferay.com
pass: test
Click on the [Sign in] button.

The sample page will show you a form asking you to agree/disagree with the Terms and Conditions.

If you get this far that means that you have succeeded setting up a fresh Liferay installation with the database for development.
Good job!

Wednesday, July 9, 2008

Liferay 5.0.1 Up and Running

Yesterday I attended the Liferay Intalio - Join Event, at Hilton Orchard Hotel Singapore.
The presentation itself was very short, but the cocktail is surprisingly quite long. I met great people here.

I believe Liferay is the fastest growing community on open source portal, and has been picking up very well and gaining reputable recognition.

Intalio is also an open source product in a niche market which has gained reputable recognition it its own niche market.

Today I downloaded the latest Liferay 5.0.1 bundled with Tomcat 5.5 from this link:
http://downloads.sourceforge.net/lportal/liferay-portal-tomcat-5.5-5.0.1.zip

I personally still prefer to use the Tomcat 5.5 rather than Tomcat 6.0, not because I'm a slow adapter of this latest app server, but because I found it quite problematic to deploy on Tomcat 6.0. This happens when I was working with a Struts application at my work. Something strange things happened, and Tomcat 6.0 does not show anything. After hours of finding out, I decided to give a try to deploy on Tomcat 5.5, which gave a thorough error message about deployment. It might be because of something the way Tomcat changes the logger between 5.5 and 6.0 which I haven't had time to explore much.

As expected the downloaded bundle works very well with my laptop environment.
I used JDK 5 to run it.

These are the steps needed to make the Liferay 5.0.1 running on my machine:

  1. Extract the file to a folder (mine is [d:\opt\liferay-portal-tomcat-5.5-5.0.1])

  2. Set environment variable CATALINA_HOME to point to [d:\opt\liferay-portal-tomcat-5.5-5.0.1]

  3. Set your CLASSPATH, JAVA_HOME and PATH environment variables

  4. Run Tomcat 5.5 from the command line using "d:\opt\liferay-tomcat-5.5-5.0.1\bin\startup.bat"

  5. Watch the messages

  6. Test if it works by opening through your browser this url: http://localhost:8080/


Thursday, January 10, 2008

Deadly Combination: Eclipse + Subversion for .NET

In our development team, there are 2 PCs that is running significantly slower than others. It's been bothering me quite some times. They just answered that this machines from the remote office are slower. I just didn't buy that.
Waiting for these PCs to perform simple things in Eclipse almost turn me belly up...

It seems like it comes from the same models as the one I'm using! And for me, mine, this is the fastest development machine I could ever have in my life. P4 dual core, 3GHz. Everything you need to develop comfortably using WebLogic Server 10 and Eclipse 3.3 Europa!

I've been tracing through processes, and looking for traces of worms, viruses, or probably something else running in the background. I checked whether they update the Windows security patches quite often, I also ask whether they updated their antivirus data regularly. Everything seemed to be ok.

Later when I opened Eclipse, I noticed that there are so many "_svn" folders showing up in the project. This is a sign of Subversion hack for .NET platform. Normally Subversion will store its information in a ".svn" folder. But the Visual Studio .NET has the problem reading files containing "."s. So the workaround is to set the TortoiseSVN to use "_svn" instead of ".svn".

Instead of ignoring the files (or interpreting the content of the folderwhen you have any of the Subversion plugins of Eclipse), Eclipse tried to parse the folders and put it in its project directory structure. As Eclipse run this process in the background, trying to parse information from Subversion's binaries data, this brought Eclipse performance down to knee.

After asking them to use .svn/** version of Subversion, the performance problem

There might be some solution to this, like place the _svn/** folder under ignore file list so that Eclipse could be told not to parse the binaries file inside _svn/**.