Sun CEO’s internal memo to employees, before his resignation

Today I found that Jonathan Schwartz has tweeted about his resignation as Sun CEO. Due to the new control to Oracle. Schwartz sent following memo to his employees. Jonathan is an avid blogger used to blog on blogs.sun.com/jonathan.

He also tweeted about his last blog post on Sun.com, saying “Where Life Takes Me Next“.

Following is the mom which he sent to his employees internally. (thanks to AllThingsDigital)

Believe it or not, it’s been more than nine months since Oracle first announced their intent to acquire Sun in April, 2009. And the ‘interim’ period has been tough on everyone–on our employees, and our partners and customers. Thankfully, that interim period is coming to an end, with regulatory approval from the European Union issued today, and only a few hurdles remaining–before Oracle formally expands beyond software to become the world’s most important systems company.

Even though we’re not quite across the finish line, I wanted to leave you with a few final thoughts.

All in all, it’s been an honor and privilege to work together. In my more than twenty years in the industry, the last thirteen at Sun, I’ve had a chance to work with and around an enormous diversity of companies, from every sector you can imagine. I can say with conviction that Sun’s people have always stood apart as the brightest, most passionate, and most inspiring. I’ve never had a bad day in my thirteen years for one very basic reason–I’ve always been surrounded by the best and brightest individuals I’ve ever come across. That’s been an honor and privilege, for which I’m enormously thankful.

Technology from Sun, alongside our employees and partners, have changed the world. We’ve opened markets, elections and economies. We’ve helped build the world’s most important and valuable businesses. We’ve played a key role in discovering new drugs, in bringing education and healthcare to those in need, and supplying the world with an incredible spectrum of entertainment, from smartphones to social networking. I doubt any company has had such a significant influence over the way we see or experience the world. I once told Scott McNealy he was the Henry Ford of the technology industry, making remarkable innovations accessible to anyone, and creating an immense number of jobs around the globe for those that made use of them. I can’t begin to tell you how proud I am of my association with that cause and the people behind it, and the value we created for ourselves and those that exploited our innovations.

I also know we’ve had more than our share of very tough challenges. Amidst the toughest market and customer situations imaginable, I’m proud we’ve always acted with integrity, with a sense for what’s right, and not simply what’s expedient. Over the years, I’ve heard time and again, from those inside and outside the company, “I like and I trust Sun.”

Building that good will is something to which you’ve all contributed. And you have every right to be very proud of it.

Make no mistake, it’s been an enormous asset.

So, to the sales and SE teams across the world who continually give their all to bring the numbers home–thank you for the trust you’ve built with customers, and the results you’ve delivered. I hope you’re prepared to have the wind at your back, you deserve it.

To the service professionals who every day build, maintain and run the world’s most important data centers–thank you for your excellence and discipline, 7×24.

To the professionals who run the functions and processes that are the company’s spinal column–thank you, we’d be paralyzed without you.

And lastly – to the engineers and marketers who’ve fostered a perpetual belief that innovation creates its own opportunity – thank you. You’re right. Innovation does create its own opportunity. Like Oracle, we’re an engineering company in our heart and soul, our potential together is limitless.

Now many of you know that I came to Sun when a company I helped to found was acquired in 1996. I’ve also led, and been a part of many, many acquisitions at Sun, both large and small. From those experiences, I’ve learned one very clear lesson–the single most important driver of a successful acquisition are the people involved–and how committed they are to the new owner’s mission.

And the most effective mechanism I’ve seen for driving that commitment begins with a simple, but emotionally difficult step.

Upon change in control, every employee needs to emotionally resign from Sun. Go home, light a candle, and let go of the expectations and assumptions that defined Sun as a workplace. Honor and remember them, but let them go.

For those that ultimately won’t become a part of Oracle, this will be the first step in a new adventure. Sun has a tremendous reputation across the planet, well beyond Silicon Valley. It’s a great brand to have on your resume. We’re known as self-starters, capable of ethically managing through complexity and change, for delivering when called upon, and for inventing and building the future. With the world economy stabilizing, I’m very confident you’ll land on your feet. You’re a talented, tenacious group, and there’s always opportunity for great people.

For those that have roles at Oracle, may you start with a clean slate, ready to take on the myriad opportunities ahead. With the same passion and tenacity for Oracle’s success that you’ve had for Sun’s, and a renewed sense of energy around executing on a far broader mission. There is no doubt in my mind you, and Oracle, will be remarkably successful, beyond the market’s wildest expectations. But it’s important you come to work thinking, “Sun is a brand, Oracle’s my company.” Don’t look for ways to preserve or dwell in “how we used to do things.” Look for ways to help customers, grow the market, and improve Oracle’s performance.

Sun is a brand, Oracle is your company.

And to that end, with nine months of getting to know them, I’ve found Oracle to be truly remarkable, led by remarkable people. From Larry on down, they understand the enormity of the opportunity before them, and they’re more than prepared to execute on it – across the board. I’ve seen their commitment and focus, now they need yours. I’m confident you’ll give it the 10,000% effort it deserves–and we’ll all see the end result.

So thank you, again, for the privilege and honor of working together. The internet’s made the world a far smaller place–so I’m sure we’ll be bumping into one another.

Go Oracle!

Jonathan

Sun.com is dead now

Just found that sun.com is now redirecting to oracle.com. Some days back I visited Sun’s original website. But it didn’t took long by Oracle to make it red. Well I am a regular visitor of Sun forums. And with this change, I am trying to adjust myself with this transition. As I am having some issue in finding contents.

Sun.com now redirects to Oracle.com

After some browsing Oracle’s website I found they were some thing to say to Java developers community about continuing Sun Developer Network.

FAQs for Sun Java developer community:

What will happen to Sun Developer Network, java.sun.com, and BigAdmin?

For the near future, all these sites will remain in their current form. We know that these resources are important, so you can continue to access them just as you always have at the same URLs and bookmarks. At some time, we foresee an integration of these sites into a newly redesigned and re-architected Oracle Technology Network, and we welcome your feedback about this process. We will make sure that any changes are communicated well in advance so that you will continue to have access to the tools and resources that you need.

And there are some other promises too about continuing Sun things.

I also found a Sun blogger saying good bye to blog.sun.com. Due to some Oracle policies that they can host only those blogs that targets to their products only not personal topics. You can read that blog post here.

I have started preparing for SCJP

Its been a year since I purchased the voucher for SCJP 5.0. But I cant concentrate to have time to prepare it. From last night I have taken the oath to finally make it done. I have started with the book SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) by Kathy Sierra and Bert Bates.

A remarkable thing is I purchased the free retake voucher which is going to expire on June 2010. But I still didnt make even a single attempt. Ok thats all right. I am going to do it. I hope to appear for the successful first attempt in good marks.

I am not using any IDE for coding practice. I am using Notepad++ editor and command line Javac compilation. I want to get maximum of language fundamentals and want to think out of code completion feature.

Useful cheat sheets on Cloud Computing and Google App Engine for Java

google_app_engine_javaJust read cheat sheets (Refcard) by Dzone on Cloud Computing and Google App Engine for Java. They contain a very jumped to the point and quick reference on these things. You can read to have a quick overview.

Read them here:

010110 – The first day of 2010 is a binary friendly day

010110

You see todays date. OK, lets format it. 01/01/10

The combination of 0s and 1s.

So lets call the first day of 2010 is a binary friendly day. If we calculate the decimal of this binary we get 22. And we know binary has base 2.

Add these digits divide them with binary base and again you will get 2. ((2+2)/2)=2. :)

Got two books on Google App Engine for Java

Recently I got two books on Google App Engine for Java. Programming Google App Engine by Oreilly and Beginning Google App Engine by Apress. There is less material and comprehensive online tutorials available on this. So its better that you read book on it. I started reading Oreilly’s book. I completed some of the basic components so quickly by given code examples in the book. Its always a good start on some new technology, if you have books in your pocket.

You guys can share your feedback if you read any book or any material on it.

Apress_Beginning_Google_App_Engine

Oreilly_GoogleAppEngin

Spoken on Google App Engine at a conference in UET

Today I had delivered a workshop on Developing Java Web Applications In Google App Engine. This workshop was the part of events of 3rd International Conference on Open Source Systems and Technologies. It was organized by Al-Khawarizmi Institute of Computer Science , University of Engineering and Technology, Lahore.

I have presented following slides there. Also coded a basic sample application to show how to create and deploy new Java project on GAE. Which can send emails, how to use authentication by Google, and how to do database interaction. It was a very intresting topic for me to present. Participants also liked it.

Comments and feedback is welcomed on the presentation material from you guys.

Tutorial: JPA on Google App Engine

This project will create and delete an entity record. I have chosen JPA for datastore in app engine. You can also look JDO for this purpose. But my choice to go for JPA is due to Sun standardization on it.

I am using App Engine SDK version 1.2.18

Project name: engineplay
URL: http://engineplay.appspot.com

Project structure:

jpa_gae_project_structureUserPrefs.java: The entity class

package com.engineplay.datastore.pojos;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.Id;
import com.engineplay.datastore.EMFService;
import com.google.appengine.api.users.User;

@Entity(name = "UserPrefs")
public class UserPrefs {
 @Id
 private String userId;
 private int donuts;
 @Basic
 private User user;

 public UserPrefs(String userId) {
 this.userId = userId;
 }

 /* TODO create getter and setters for above properties yourself */

 public static UserPrefs getPrefsForUser(User user) {
 UserPrefs userPrefs = null;
 EntityManager em = EMFService.get().createEntityManager();
 try {
 if (em.find(UserPrefs.class, user.getEmail()) == null) {

 userPrefs = new UserPrefs(user.getEmail());
 userPrefs.setUser(user);

 } else {
 userPrefs = em.find(UserPrefs.class, user.getEmail());
 }
 } finally {
 em.close();
 }
 return userPrefs;
 }

 public void save() {
 EntityManager em = EMFService.get().createEntityManager();
 try {
 em.persist(this);
 } finally {
 em.close();
 }
 }

 public void remove() {
 EntityManager em = EMFService.get().createEntityManager();
 try {
 UserPrefs userPrefs = em.find(UserPrefs.class, user.getEmail());
 em.remove(userPrefs);
 } finally {
 em.close();
 }
 }
}

EMFService.java: The class to create EntityManagerFactory instance.

package com.engineplay.datastore;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EMFService {
 private static final EntityManagerFactory emfInstance = Persistence
 .createEntityManagerFactory("transactions-optional");

 private EMFService() {
 }

 public static EntityManagerFactory get() {
 return emfInstance;
 }
}

LoginServlet.java

package com.engineplay.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.engineplay.datastore.pojos.UserPrefs;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class LoginServlet extends HttpServlet {

 public void doGet(HttpServletRequest req, HttpServletResponse resp)
 throws IOException {

 UserService userService = UserServiceFactory.getUserService();
 User user = userService.getCurrentUser();
 String navBar, form = null;
 int donuts = 0;
 if (user == null) {
 navBar = "<p>Welcome! <a href=\"" + userService.createLoginURL("/") +
 "\">Sign in or register</a> to customize.</p>";
 form = "";
 } else {
 UserPrefs userPrefs = UserPrefs.getPrefsForUser(user);

 if (userPrefs != null) {
 donuts = userPrefs.getDonuts();
 }
 navBar = "<p>Welcome, " + user.getEmail() + "! You can <a href=\"" +
 userService.createLogoutURL("/") +
 "\">sign out</a>.</p>";
 form = "<form action=\"/donuts\" method=\"post\">" +
 "<label for=\"donuts\">" +
 "Need more donuts?:" +
 "</label>" +
 "<input name=\"donuts\" id=\"donuts\" type=\"text\" size=\"4\" />" +
 " <input name=\"olddonuts\"  type=\"hidden\" value=\"" + donuts + "\" /> " +
 " <input name=\"userId\"  type=\"hidden\" value=\"" +user.getEmail()+ "\" /> " +
 "   <input type=\"submit\" value=\"  ADD  \" /><br><input type=\"submit\"  name =\"deleteBtn\" value=\"  DELETE ME!  \" />" +
 "</form>";

 }
 resp.setContentType("text/html");
 PrintWriter out = resp.getWriter();
 out.print("<html><head><title>Engine Play - Donuts</title</head><body>");
 out.println(navBar);
 if (donuts != 0)
 out.println("<p>Donuts you have: " + donuts + "</p>");
 else
 out.println("<p> No donuts you have :(  </p>");
 out.println(form);
 out.print("</body></html>");
 }
}

DonutsServlet.java

package com.engineplay.servlet;

import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.engineplay.datastore.pojos.UserPrefs;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class DonutsServlet extends HttpServlet {

 public void doPost(HttpServletRequest req, HttpServletResponse resp)
 throws IOException {
 UserService userService = UserServiceFactory.getUserService();
 User user = userService.getCurrentUser();
 UserPrefs userPrefs = UserPrefs.getPrefsForUser(user);
 try {

 String deleteOpt = req.getParameter("deleteBtn");
 if (deleteOpt == null){
 int donuts = new Integer(req.getParameter("donuts")).intValue();
 int oldDonuts = new Integer(req.getParameter("olddonuts")).intValue();

 userPrefs.setDonuts(donuts + oldDonuts);
 userPrefs.save();
 }else{
 String userId = req.getParameter("userId");
 userPrefs.setUserId(userId);
 userPrefs.remove();
 }
 } catch (Exception e) {
 e.printStackTrace();
 }
 resp.sendRedirect("/Login");
 }
}

persistence.xml: Configuration file required for JPA

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"

 version="1.0">
 <persistence-unit name="transactions-optional">
 <provider>
 org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
 </provider>
 <properties>
 <property name="datanucleus.NontransactionalRead"
 value="true" />
 <property name="datanucleus.NontransactionalWrite"
 value="true" />
 <property name="datanucleus.ConnectionURL"
 value="appengine" />
 </properties>
 </persistence-unit>
</persistence>

web.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">

 <servlet>
 <servlet-name>LoginServlet</servlet-name>
 <servlet-class>com.engineplay.servlet.LoginServlet</servlet-class>
 </servlet>
 <servlet>
 <servlet-name>DonutsServlet</servlet-name>
 <servlet-class>com.engineplay.servlet.DonutsServlet</servlet-class>
 </servlet>

 <servlet-mapping>
 <servlet-name>LoginServlet</servlet-name>
 <url-pattern>/Login</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
 <servlet-name>DonutsServlet</servlet-name>
 <url-pattern>/donuts</url-pattern>
 </servlet-mapping>

 <welcome-file-list>
 <welcome-file>Login</welcome-file>
 </welcome-file-list>
</web-app>

Access the project here: http://engineplay.appspot.com

run_gae_project

Pakzilla.com was down. Sorry for inconvenience

1191333857_Web Site MaintenanceSome of you might have noticed that Pakzilla.com was down for a day. It was due to some technical maintenance and upgrade on hosting severs. I want to apologize for inconvenience. I hope you will not mind. I will continue looking after these issues to make this site available for 24/7.

Thanks;
Admin, Pakzilla.com

Upgrading to Google App Engine Java SDK 1.2.8

I was getting following exception while trying to code my first interaction with JPA in Google App Engine.

org.datanucleus.metadata.InvalidMetaDataException:
Error in MetaData for field "user" in class "com.engineplay.datastore.pojos.UserPrefs" : this is declared as com.google.appengine.api.users.User with "persistence-modifier=none" yet has either "default-fetch-group=true" or "primary-key=true" specified! These should be false.

After some searching I came to know that I should upgrade my App Engine SDK. To get datanucleus-enhancer-1.1.4.jar. But when I upgraded my SDK from 1.2.0 to 1.2.8. I got following exception.

java.lang.RuntimeException: Unable to locate the App Engine agent. Please use dev_appserver, KickStart,  or set the jvm flag: "-javaagent:<sdk_root>/lib/agent/appengine-agent.jar"
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:102)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:77)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:38)
Caused by: java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:98)
... 6 more
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
... 7 more

I got two problems to fix. First the JPA enhancer was not working and second I was unable to start my server through Eclipse.

Running the server was looking straight forward from the exception that I need to add extra VM arguments for all of my applications. Remember this, your previous application will not work unless you add these VM arguments seprately in their launcher configurations.

Following are the steps to do that.

1. Right click the project and select Run As –> Open Run Dialog.

gae-add-vm-arguments

2. Copy the message which you are getting in exception. This is exactly the same that we need to add in VM arguments section. The only addition we need to do is to add our SDK path.

gae-added-vm-arguments

3. Now if you run or debug your project. You server will run perfectly.

gae-server-run-success