Monday, April 12, 2010

Migrating from VSS to StarTeam

Just so you know, and I'm sure you'll try also, I did Google & Bing and found some other ways of doing this.

Migrating from VSS to Starteam is not difficult. Many have done it already. However, the challenge is on migrating the history of your source code files over.
If only the tip is migrated, which is pretty easy, then, you will lose the history of changes done to the source code.

I needed to migrate source code with history. Fortunately, I was using labels in VSS to mark each production release milestones. If you did not use labels in VSS, then it is hard to create a corresponding working directory based on labels.

The approach described here assumes that you are able to create working directory of you app releases, milestones or versions in chronological order. Otherwise, you will only be able to migrate the tip of your source code or spend a ton of your time creating the history manually.
You can either use the labels or other means to create the different versions of you app into separate working folders.

First thing to do - Plan the directory structure you want within Starteam. You could choose to use the same directory structure or modify to some known and practiced pattern.

Sample Project structure:

  • build
  • Files (contains jars, wars, ear, etc and other files)
  • Script (scripts to build the jars, wars,ear, etc)
  • code (source code directory)
  • config (any configuration related data)
  • database (e.g sql scripts to create tables, indexes, etc)
  • Docs
  • lib
  • Packaging (files to build packages for disployment)
  • Testing

Pre-work
Checkout the versions of your project into a work directory.
The first working directory will be the . This is the oldest that you want to start from.

Then, do the same for the remaining versions. These are versions that you want to keep in Starteam.
Each time, use different name for the work directory e.g. ProjectA-ver1.0, ProjectA-ver1.1, etc.

: Start with the baseline version. E.g. ProjectA-ver1.0
Trim the baseline to meet your new Project directory structure you want in Starteam.
Validate that you are able to re-build the jar, war and/or ear files. Also, if you need to package for deployment, make sure you can still create a deployable package.
You will need to modify the build and package scripts since you may have moved your source code and other folders around. I modified my ANT scripts and properties files.

Once you have a , that would be the project that you will check into Starteam as first version, 1.0.

But, don’t do it yet.
Check out the next version you want to keep into a different folder,

: Do the same as you did for .
Trim .
Leverage what you have learned from trimming .
You can be as creative or innovative as you can be. I used BeyondCompare software to compare <baseline> and <baseline+1>.
End product should be <baseline+1>. At this point, there will be 2 project directories - <baseline> & <baseline+1>.

You can repeat this for as many versions of your project that you want to migrate to Starteam.

At this point, you should have 2 folders, having the same directory structure:
<baseline>
<baseline+1>

Migration To StarTeam:
Start the StarTeam client.
Navigate to project main or root view.
Either right mouse click or chose click on the ‘View/Properties’ and select the 'Alternate' as the Working Folder, and point to it to on your local PC. See working folder sample image below.




Next, click on ‘File’ and enable “All Descendents” option. This provides a summarized view of your items on the right. The next 2 figures provides some visuals to guide you.



Also, turn on “Show Not-In-View Folders”.
Since this is your first checkin, you would probably see the files status grouped as “Not in view”.
“Not in view” - The file is in your working folder, but not in the project view. Hence, you can add this files into the Starteam.
Right mouse click on the status, and select “Add Files” option from the dropdown. Files will be added to StarTeam. At this point, the client should auto refresh or you can manually do that. Click on “Window/Refresh” or press Shift+F5 keys.
Now you have the synchronized with Starteam.

Chose the project main or root view. Select “View\Labels “ and add a View Label. This will create a view label and attaches the current tip of all your items in the project. Keep the default, which will be timestamp based.

Now to work on the <baseline+1> from the directories on your local PC:

Migration To StarTeam:
Assuming you still have the client up. Otherwise, restart and open your project.

Navigate to project main or root view.
Either right mouse click or chose click on the ‘View/Properties’ and select the Working Folder to point to default and select the folder using the browse button.
Click on ‘File’ and enable “All Descendents” option. This provides a summarized view of your items on the right.

Navigate to project main or root view.
Either right mouse click or click on the ‘View/Properties’ and select the Working Folder to point to .
Click on ‘File’ and enable “All Descendents” option if you need to. This provides a summarized view of your items on the right. Also, turn on “Show Not-In-View Folders”.

Since this is , you can have the following status:

  1. Current:The tip revision of this file is in your working folder.
  2. Merge:The file in your working folder has been modified, but is not based on the tip (latest) revision of this file
  3. Modified:Your working file has been altered and is based on the tip revision of this file.
  4. Unknown:The file in the working folder has the same name as a file in the view, but the file in the view has not been checked out from the repository. You may have copied it from another location.
  5. Out of Date:The file in your working folder is an outdated revision of the file
    Not in view:The file is in your working folder, but not in the project view
  6. Missing:The file is not in your working

I have the table below that can help you decide what you can do with each.
For the “Current” and “Missing” statues, you need not perform any acttion against it. Chances are you will have lots of files under “Unknown” or “Not in View”.

After taking each action against a particular set of files, click on “Window/Refresh” or Shif+F5 to refresh your listing. This will re-synchronize the file status with StarTeam.

“Unknown” status files:
Right mouse click and select “Update Status” option. StarTeam compares your working file and the tip revision in Starteam for you.
A result of “Update Status” might be that you have more files that are “Current” and some new ones under “Out of Date”, etc.
Those files that still remain as “Unknown” requires you to compare contents manually and if needed, force a CheckIn. There is a option in the CheckIn dialogue pop-up box to check a Forced Checkin.

The same be be required for “Out of Date” and “Modified”.. At this point, it’s Source code management 101 - compare and decide what is required.

At the end of this activity, you will/should have only the following statuses:

  • “Current”
  • “Missing”

Now, Label your project items, as you did for . This will be your version 2.
Note that some of the files may not have changed since . By attaching this to the label, these files will have 2 labels.
You may want to consider adding comments during each CheckIn or Add that helps you understand the history.
I added comments such as - gsohub2.0 fileset, gsohub2.1 fileset, etc

Now you have some history for your source code in Starteam. As I mentioned at the beginning, I did Google and found some other ways of doing this.

Hope this is helpful in your migration to StarTeam.

Click on the image and it'll expand to actual size.



Friday, February 26, 2010


I came across this article in CIO Insight - 20 IT Skills on the Rise. See the figure at the bottom.

Interesting to note that SAP skills are on the rise. My thoughts on that is, may be the economy is starting to pickup. Business is starting to plan and invest in growth - spending more money to add capabilities and new functionalities.

SAP being an enterprise solution, could be used to measure (correctly or incorrectly), what the business mindset is towards spending more money to grow. HP's first quarter result seems to support the renewed business interest to spend more.

I also noticed Solaris skillset in the 6th position. Hmmm.... makes you wonder if this is a temporary spike to move off Solaris and onto Linux. Now that Oracle has bought Sun and all. However, I don't see any Linux related skills in the list.



I was also expecting some hard core development skillset to be on the list e.g. Spring Framework, RIA, .Net, etc.., but they are missing.

We can't take this as an absolute data on the trend, without knowing how this metrics were collected. But it is something to chew on amongst all the others - not that we are lacking on things to chew on.


Friday, June 5, 2009

HttpConnections errors in WebLogic 10.0.1

Recently, I was working on migrating a J2EE app from WebLogic8.1 SP5 to WebLogic10.0.1.

There are so many changes:
  1. JDK1.5
  2. The way JMS is implemented by WebLogic
  3. The Work Managers and self tuning that WebLogic does...
I was expecting the J2EE app to work the same with minor changes to the codebase. While this was true for the most part, one particular "feature" caught me - HttpConnections...

Not sure how this is managed by WebLogic in 8.1 but in WLS10, I was getting errors. The http post messages started to throw errors:

<Jun 4, 2009 11:51:34 PM GMT> <Error> <WebLogicServer> <BEA-000337> <<< PPMEJB.java A.01.28x1 >> has been busy for "667" seconds working on the request "weblogic.work.ExecuteRequestAdapter@1669674", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:134)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read(BufferedInputStream.java:23

.....

And, my app logs:

2009-05-29T20:27:40.848 21319886:[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'.GSOHub_AM|<< TransportEJB.java A.00.17 >>|DEBUG|999999||<< TransportEJB.java A.00.17 >>Exception.java.io.EOFException: Response contained no data

The self tuning done by WLS10 wasn't helping as I wasn't sure which is causing the HttpConnections problem. So, I turned it off by setting
use81-style-execute-queues true in the config.xml.

After much testing, research and code changes, I found out that the socket connections are not managed as I expected. Somehow, the http connections are not timing out or the sockets are not properly reused ...

There is some problems with the way sockets are managed in HttpConnections.

The following system properties are available to manage httpconnections correctly:
  • -Dsun.net.client.defaultConnectTimeout=5000
  • -Dsun.net.client.defaultReadTimeout=5000
  • -Dhttp.keepAlive=false
sun.net.client.defaultConnectTimeout: specifies the timeout (in milliseconds) to establish the connection to the host.

sun.net.client.defaultReadTimeout: specifies the timeout (in milliseconds) when reading from an input stream when a connection is established to a resource.

http.keepAlive: Indicates if keep alive (persistent) connections should be supported. Persistent connections improve performance by allowing the underlying socket connection be reused for multiple http requests.

As a quick fix, I decided to try http.keepAlive and set it to false. This fixed the HttpConnections problem but it may introduce a performance hit. I may use the other 2 instead -connection or read timeouts.

Also, if you need to read the response body, you will have to read the error stream if there is a IOException when the inputstream is read.

some references:
  1. Networking Properties
  2. Persistent Connections
Hope this is useful.

Daniel Rathinam
டேனியல் ரத்தினம்

Friday, May 22, 2009

Intrigued by Flex3

Recently, I read an article on J2EE and Flex3

I was intrigued.

I set out to research more on Flex3 and how it fits in the RIA space - and now I’m addicted to Flex3.

I tried Flex3 with the BlazeDS and got even more interested. Soon I found myself coding a file upload client which allowed the users to select multiple files from local directory and do a Http POST to a java webapplication. A java servlet at the server end processed the file successful. Sure, there were some learning curve but it was worth my time. I had great fun.

I intend to to package the client solution so I can share it in my blog later.

I’m also trying to integrate with an existing Struts webapp. Also, Adobe and SpringSource (Spring Framework guys) are working to integrate BlazeDS with Spring Framework which lights up so many possibilities in my mind for a RIA based on Java/J2EE/Spring and Flex3. Did I mention SpringSource also released a free Spring IDE?

With Flex3, seems like we have another option, an attractive one at that, for building any RIA front end to J2EE apps.

I’m intrigued…..