Wednesday, July 28, 2010
Fixing Corrupt Metadata in Artifactory (and my thought process behind it)
At work, I was recently introduced to the maven archetype plugin. I used it to generate a sample project containing generated client code that interacts with our framework. After working on it for a while and deploying it (successfully) to Artifactory (version 2.0.1), I was excited to show it off to my colleagues. Right around that time, we decided to upgrade the version of Artifactory to 2.2.4. The steps we followed were: Use the web console on the older version to run a Full System Export, Download the latest version to another location, Start up the new version, Run the System Import on the new version with the imported file. Everything seemed to run fine, until a guy tried my code and it failed!
Error:
My code invoked the generate goal using the maven-archetype-plugin. And this is the error that it spewed:
mvn -e archetype:generate -DgroupId=test.sonali.parikh -DartifactId=1.0 -Dversion= -DarchetypeGroupId=aero.sonail.parikh -DarchetypeArtifactId=sonali-sample-project-archetype -DarchetypeVersion=1.0
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Required goal not found: archetype:generate in org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Required goal not found: archetype:generate in org.apache.maven.plugins:maven-archetypeplugin:1.0-alpha-7
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1558)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Analysis:
Looking at the stack trace, this is valid error IF I was using version 1.0-alpha-7 and NOT 2.0-* of this maven plugin artifact. The 1.0* version does not have support for the generate goal, since it was only introduced in the 2.0 releases.
But, since I didn't specify the version of the plugin to be used, the Artifactory server should serve me the latest and greatest version. So, I should have been pulling down the latest 2.0* version from the remote artifactory server (I check, our Artifactory does serve up the 2.0-alpha-4 version). OK so, something's wrong with the process used by Artifactory to maintain its versions.
I browsed through my local m2 repository, and discovered this file maven-metadata-central.xml . This file is downloaded to the local file system as part of the maven-local-client-talking-to-the-remote-repository. It basically looks like this:
...
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.0-alpha-4</version>
<versioning>
<latest>1.0-alpha-7</latest>
<release>1.0-alpha-7</release>
<versions>
<version>2.0-alpha-4</version>
<version>1.0-alpha-7</version>
<version>2.0-alpha-3</version>
</versions>
<lastUpdated>20100723072443</lastUpdated>
</versioning>
</metadata>
...
This file is not quite correct - the value of the latest tag should have read 2.0-alpha-4.
And this was indeed the bug - when I manually hacked this file in my local repo (location: C:\.m2\repository\org\apache\maven\plugins\maven-archetype-plugin\maven-metadata-central.xml) to contain the correct version, and downloaded the 2.0-alpha-4 jars and pom to my local repo, the maven command worked wonders (my code of course). So somehow the metadata was incorrect or corrupt and had to be re-generated for this artifact.
Cause:
The metadata (served up by the remote Artifactory server to a local maven client) getting corrupt/wrong might have been a by-product of the full system export, which was one the steps involved in upgrading artifactory to 2.2.4. This is sort of a known bug as of April 2010 according to this jira ticket - they say the patch fixed it, but I haven't tested the patch yet.
(My Hacky) Solution:
I didn't want to patch it just yet, so I decided to delete the 2.0-alpha-4 jar and pom from the Artifactory server repositories and re-deploy them. This workaround made the regenerate-metadata-process actually work, and the latest version was correctly downloaded on my local box!
My colleague also tested another workaround - While upgrading to 2.2.4, check the "Exclude Metadata" option while doing the full system export. That helps too!
So Why Am I Blogging About This:
Well, I spent quite some time wondering my code didn't work and why the generate goal was suddenly not a valid goal! So if anyone spends more than an hour, trying to figure out weird latest-versions of artifacts, just try and regenerate the metadata.
Monday, October 13, 2008
scmple
Scmple is my (oops our) new pet-project. What I am referring to as this and it are common problems we all face working as part of a small team on a small project. We, as part of the scmple team, want to help you to iron out these problems. We hope to make it easier for the developers to spend more of their time and effort on developing software and less on (painfully time-consuming but much-needed) administration.
Here is a typical scenario that inspired us to come up with this idea - Person A has an awesome idea, it's going to be The-Next-Big-Thing! Person A codes away at night for a few days and brags about it to Friend B. B is now all fired up and volunteers his supreme comp sci development skills. So A and B work on this new side project (lets call it TNBT). Being developers, they know they have to use a versioning system and pick SVN or CVS or Git and they start coding away. They face a few hassles along the way - who works on what feature, who fixes which bug, is there a trail of all the bug fixes (aside from versioning history), who is tracking the project milestones, what is the future feature set..but they ignore them for the time being since having functional and working code is more important. Friend C also wants to join them. So as a small team, A, B, C have to collaborate on working on TNBT and to make progress, some of the hassles need to be addressed. Keep in mind that the only time they get to work on their dream project is after-work hours and on weekends. Hence the time that they actually spend on working together is very precious. They need to be able to use this time wisely and not in integrating and organizing three to-do lists with 100 bullet points and spreadsheets containing a complex matrix of which person is assigned to which task. What this team needs is a simple, straight-forward solution that offers them project management, task management, work assignments, issue tracking, discussion forums.
Scmple to the rescue. What we hope to achieve here is to simplify the process of product and project management. I know that developers dislike the word management, but to make your product even a tiny bit successful, you need to be able to manage it efficiently. Scmple will provide a hosted platform for versioning, with a built-in feature set like issue tracking, task management, project milestones, discussion and support forum. It's designed to integrate effortlessly with your development enviroment so that writing code and managing a project go hand-in-hand.
Technology - Open Source is the way to go. We decided to use Git as the version control system (read my blog post), Ruby on Rails and PostgreSQL, with a lot of AJAX goodies thrown in. We are looking at a variety of solutions and mayyyyyybe mootools is winning.
We are working on getting a beta version out soon. Will keep you guys updated!
Saturday, September 13, 2008
Moving on to another job
There were a number of reasons for this transition. I have had a good time at SITA, I like the people I worked with and I learnt a lot from them. The main reason for this move was that I felt like I wasn't challenged enough. I wanted to learn something new, work on something exciting. The projects that I had been working on for about a year were sort of coming to an end, and I guess I wanted a change. It was a little hard to leave since I am emotional and very loyal to the company but everybody understood my reasons to leave. So after a farewell lunch at a hibachi grill and a going away gift (a cute pineapple plant), my last day at SITA was over.
A couple of friends recommended Premiere Global Services (or PGI as we lovingly refer to it) to me. And hopefully vice-versa! I have been wanting to get into working in a web services environment and it sounded like PGI was working on re-designing their eMarketing to use a web-services-based framework. I interviewed with the team a few weeks ago and it seemed to be a good fit.
So here I am - 2 weeks into PGI and loving it! The guys in my team are real smart, I get to learn something new every single day and I have already written code and checked it in! Awesome!
Monday, August 4, 2008
Ubuntu vs Mac OS
So If I have a laptop, why do I need another personal machine??
I have always wanted a machine with Mac OS on it. I used the Apples sparingly at Emory, but never truly got the hang of it. Ever since my husband got a mini, we sort of started replacing all our machines at home to either Apple TVs or Mac minis. I never really had the need for another machine since my Dell was good enough for all my side-project development machine. Or let me rephrase - I was happy with my laptop for the last 4 years. I do have a few issues with my Dell right now - I can't test out my web apps on Safari/IE/FF, Its not very fast (tops out at 2G RAM), I don't have a fancy text editor(tried to pimp up gedit to emulate textmate), and well I really wanted a change in my OS.
This last weekend was the tax free weekend. We stood in line at the apple store and were taken care of pretty quickly. After 20 minutes, I was the proud owner of an iMac **and** a free iPod touch! The iMac, designed by Apple in California, is a simply amazing design - the monitor has the entire computer inside it and its still not that thick. The speakers are not bad and I have enough USB ports on the back of the monitor - very sleek.
Once you get the hang of using an Apple machine with the funky Mighty Mouse, and learning your way around the Expose and the million keyboard shortcuts, its a pretty straight-forward OS to interract with. The only thing I might want to complain about is the lack of focus-follows-mouse support in the windows manager. Ever since my school days of playing around with Enlightment, I have been addicted to this very customized preference.
Anyway, other than that, here is a list of differences I see between Mac and Linux -
- Ease of installation of software - On Linux, installing a software or application is not the most complicated process, but it takes time - the basic steps are downloading the binary or the tar ball, unzip it, make it, and then copy the files over to /the/proper/location. On an Apple, all you do is download the mac-os-version and copy it to Applications. Thats it - how easy is that.
- The Dashboard - On Linux, you would probably need to start up all these applications in a different desktop - there is no dock like functionality. On an Apple, its always there at your beck and call . I like using it without the need to crank up the date app or the calendar app or the weather app.
- Fluid - There is no way that I can explain how convenient SSBs are!! I have facebook, hahlo, jango, zimbra mail all opened up as its own little application. There are neat scripts that make the GUI look better and I don't have to bother about whether one app might cause a crash in another. So sure, I could open up different sessions of FF but it is not the same experience. Also, fluid is based on the Safari technology, its a lot faster.
- TextMate - Eclipse is way too bloated to code. If I am not writing java code, Eclipse is more of a hassle to use than anything. Textmate is so easy to use, so many different templates and such a simple interface.
- iTunes - I have tried to use amarok to sync my ipods. It hasn't been a complete disaster but its not intuitive. iTunes does it the best!
- Prettier fonts/design/layout/shadows/GUI - Need I say more - its just prettier!
Hopefully I can code up the next-earth-shattering application on my new beautiful desktop, and then this purchase would be justified!
Wednesday, July 16, 2008
Grit Documentation
I am trying to use grit for a simple project - basically provide a GUI for git. Eclipse does a good job for CVS and SVN and gitk doesn't do a good job with git. It sounds like a good idea, and I really am all for git. Other than a few irritating things about merge, git is a pretty kewl tool.
So for this simple project, I am using mojombo-grit (and Ruby on Rails) to look at the tree/branch structure of git commits. Its pretty straight-forward but the API documentation is not that great. Its just not laid out intuitively and IMHO not easy to understand to follow. I like their example on the home page, which starts you off easily. But then after that, if you have to get more information on (say) a branch, then the doc doesn't do much for you.
Looking around for a better take on the documentation ....
Thursday, May 29, 2008
GIT
After a ton of reading up on it, and watching
Randal Schwartz's presentation on git, I was inspired to get git and use it. It hit the spot - I have always had a few issues with the source code management systems out there and git supposedly has thought of everything -
- So here's a typical scenario - I checkout the source code from the HEAD at my work repository. I want to refactor it but don't want to break anything. I just want to change a few things, make them more efficient ( yea right! ) and basically try out a coupla things I couldn't try out earlier due to deadlines. So I edit code, play around with some kewl new technology, refactor it. By the end of the day, my editing has been finished. But its not perfect and frankly I rather not commit these changes since I really don't wanna break the code and/or I don't want the rest of the world to know I made these changes! So the only option left for me is to delete these changes ( or make a local backup copy ). I will have to start working on the main branch again, I guess I'll have to forget about this entire day's of work. The problem with that is that I have lost my work; however trivial it was. Hence the concept of a distributed version control system appeals to me. I clone the repo and play around all that I want. Ooo the concept of private branches...
- Another interesting feature of distributed development is that since you "clone" the repo to your hard disk, you always end up having the entire repo, the history of each and every file - all readily available. You can work on it offline, and commit it only when you are absolutely ready. This also helps when more than 1 person is working on the same piece of code, and needs to be able to make changes all the time.
- Every time I have to work on >1 different branches of the same project, it is always a hassle. I don't know of all the .cvs ignore files that are lingering around, and I always make mistakes committing my changes. I tried out git and tried out checking out 2 different branches. I tried out editing them, and then checking those changes in. Wow, that was simple! It really is very intuitive and the non-polluting of any sub-directories makes it so easy to learn and use git.
- For legacy humans ( ;) ), git has a "backwards-compatibility" feature to work with cvs clients. The end user does not need to learn 5 extra git commands, and can use cvs-style commits/checkout/branch to basically use git. I guess in my company, if I was trying to push Git, this would be an awesome plus-point!
- Git has funky merge and rebase features for tons of different users working on the same code. Merging is always a nightmare, and its not too bad with git. Of course you are going to break something somewhere, but thats what a developer in a team has to go through!
- It has to be real fast - the linux kernel has 25000 files
Think Globally, Work Locally.....
Wednesday, January 2, 2008
OutOfMemoryError: Java heap space
So one of the 2 causes of OOM is inadequate heap space - so I allocated more and ran the app, this time with the Xms and Xmx arguments. It ran for a longer time but again crashed with the OOM error. OK so time to look into the second reason - Memory Leak.
I looked around for a decent profiling tool, and downloaded JProfiler. It's free for 10 days and I hope I can figure out what the issue is before that. Installing it on my RedHat box was a piece of cake, but setting up the environment wasn't! Anyway, after setting it up, I started it. Way too cool!! ( Not the debugging/diagnostic part of the analysis ) I haven't really had experience with JProfiler so this is very new to me. The amount of data that is available is very impressive (and in pretty colors too ;) ). Tons of different views and graphs to help make the software more efficient and memory-leak free. Looks like I am going to be using the Heap stack view in my search for the memory leak.
Right now, I am familiarizing myself with this tool, reading up on what should be my best approach. It's more of an art to find the runway non-GC'ed variables than science! A couple of things I am going to take a look at - objects like String, HashMapEntry, Char, Long maybe a problem due to their growing numbers (but maybe thats valid ?), database connection pooling and result sets not getting closed properly....
I am looking forward to playing around with JProfiler, but not as much to finding this "random" memory leak.
Friday, October 12, 2007
Video Games
Let me try and list my issues with playing video games.
1. Time : I tried playing Zelda. I did put in a few hours. After that, I just got irritated. Sure I am not the most patient person in the world, but why "waste" all this time to learn a few jumps, how to swing your sword and how to correctly press A and B together to shoot.
- I do understand that at least the gamer is using his brain and is not ideally sitting around and watching TV. But, if I want to use my brain, I will go work either on my own projects or on my day-job project. Either of them will be beneficial and no one can argue the useful-ness of using your time to "work".
- Of course the gamer could just be playing a game because he's taking a break and wants to get away from work. Fair enough: so why would you want to get deeply involved in something that will take 50 hours to finish! How is that a 30-minute break? Like I have seen, its really never 20-30 minutes, its about reaching the Save Point and then getting addicted to finishing the damn boss!
After Halo1, I want to see how they did Halo2, and oooo Halo3 is out....I played Zelda5 years ago and now they are releasing it for the Wii, I have got to buy it!
Common, you guys have heard this before. I rather spend money on cool sci-fi books or music( maybe ) or something cool!
3. Addiction: People spend hours upon hours just playing and playing and playing! They want to get to the next level, and specially for MMPOG, people get crazily addicted to it. Being this addicted to anything can't be healthy!
Ahh maybe its just me and my short attention span, but hey, we are talking about developers and software engineers too who are probably really impatient, and yet spend hours on their gaming console. Sometimes, I do like playing with my friends and having fun with the graphics and the remotes and the controllers. But, I wish I could get really excited about standing in line for hours for the next big game. I would love to use the Wii remote as a LightSabre just for the ooo factor, and that would last for exactly 20 minutes!
Thursday, October 4, 2007
I Hate Documentation
In my company, I inherited a project - lets call it FBB for FooBarBaz. My work is fun ( yes even at a megacorp, work can be fun!). It gets tedious and boring and interesting and I spend long hours @ work, but I am not complaining about that ( at least right now)! What I would like to talk about is documentation on FBB. Documents are required for maintenance of a project, right. So when I come on board, and am expected to 1. start developing 2. fix bugs 3. and support the Support Team AND there is just no docs to make my life simple, I get frustrated. I volunteer to start documentation in order to help me, the next person, the system administrator, and the Support Team. Wonderful: I know exactly what another Software Developer wants to see in a document, and since I am so smart, this shouldn't be a problem. Right?
Nope.....In order for me to write up a document which is actually useful, I have to speak to the people who were involved in FBB since day 1. -> Problems!! Either they are busy, or in another country, or simply not available. So a Software Engineer with very less background in FBB and the system gets stuck with writing all sorts of document, only 'coz she wanted to make life easy!
This is not just one "How does FBB work" document, There are Operations documents ( futile for me to write them up on so many levels ), Delivery Stuff, blah blah blah. I waste my time in doing "work" that really should be done by someone else. And of course, this is a ASAP requirement, BUT I need to focus on content as well as the darn formatting.
Don't get me wrong - I think we need documents in order to plan, develop and maintain a system. But the problem here is that either we don't have enough docs or we have way tooooo many with so much redundant information, that people just get turned off by documents and documentation. Vicious circle...
Friday, September 28, 2007
log4j
The logging level is the easiest property to change. I am messing around with how to change the retention period ( maxBackupIndex ) and the MaxFileSize. I don't think it should be that hard - get an instance of the Appender using the logger. OR change the DOM tree - ewow, I don't wanna do that. If I had an external file, I could use ConfigureAndWatch, but I really want this to happen via a GUI Button.
Ideas, anyone?
Wednesday, September 19, 2007
Lotus Notes
But check this out: Free Lotus Notes !!! . Hopefully I can play around with my personal laptop and get Notes installed on it. I am excited! I have been waiting to develop on my *nix environment.
Tuesday, May 22, 2007
SITA it is
So the interview process started out with me being pretty nervous. This was the first time that I was officially interviewing with employers. I mean I know my stuff, but I don't really know how to sell my skills and sounding smart all the time :) But man, this was such fun. I didn't dread it one bit ( except for the driving ) after I started meeting the people, and seeing how exciting it is to talk about different technologies in different settings solving different problems. I got in touch with lots of cool companies, cool smart dudes who gave me a chance to present myself even though my "number of years of work experience" was less than theirs. I am glad that I gave myself plenty of time to look for a job that suits me.
At SITA, 4-5 people interviewed, all the way from my team members to the resident Java Guru to the Director of Software Products. I really like how in a megacorp, I am a somebody. Coming from Choices where I had the power of God to do anything, I wanted a job which gave me good amount of responsibility but also protected me from all the political BS. I also wanted to be in a place where I meant something, and where my views/opinions/thoughts matter. At SITA, I really feel that even the higher ups ( HCE : Highly Compensated Employee ) care about the developers and we aren't just code monkeys. I like that about SITA which is a mega corp but not really!
I am excited about working here ( other than traveling to the office ) and I hope this place keeps me motivated.
Thursday, April 12, 2007
Time to move on
Don't get me wrong, my time here has been pretty great. I got to travel and represent my company at trade shows, interact with our customers and deal with our Indian business partner. At a small family business, one gets to wear many hats. My responsibilities have ranged from CTO ( hey I get to call myself what I want! ) to Marketing & Sales Manager to Quilt Designer! I definitely have learnt how a small business operates, the problems it faces, and that exponential success is sometimes a bad thing.
What I am looking for now is to be part of a team where I get to use cool new technology, and by helping the company grow, I get to step up the corporate ladder! What I really miss here is the team aspect I think, where by interacting and hanging out with geeky colleagues, you get to learn so much. Hrm, this is sounding like a cover letter now! " I would love to be part of your company, because what I will bring is going to be so unique!!"
I wonder how different it will be working in the big bad world. I joined Choices right after school, so this has been my only work experience. Here, we work real hard, we work harder if there is stuff to be done, we try and please our customers all the time, and of course, all of us share the profits. The incentive and motivation to work hard at your own business is different. Or is it? People have often told me that you work harder when you know the money is directly going into your pockets. Hence, family businesses get a lot of work done by their employees i.e. the family members. But how is this really different from working "outside": you work hard - you get rewarded, you put in more hours - you see a bonus, you deliver on schedule - you get a raise. Sure the profits might be different in terms of $$, but hard work pays everywhere and if you are smart, then people (should) recognize that.
Wish me luck!
Sunday, April 1, 2007
Wordpress
Nowadays, my project is to play around and customize Wordpress for our site. Codex has been my best friend in understanding how Wordpress does its magic. Sort of like Ruby on Rails, Wordpress presents you with a neat directory structure, organizing files the way they see fit! It comes with some default themes, and of course the Hello Dolly plugin! But just like ROR, Wordpress is very customizable, and you can find thousands of plugins to take care of your needs. I've also taken a shot at writing in php, and it's kinda fun!
My current quest is to find a plugin (or write one? ) that helps me put a thumbnail of an image (in a post) that replaces the "more" tag, so that when you click on it, you are taken to your post. There were a couple plugins out there that I tried out, but they aren't exactly what I want. Maybe I didn't look hard enough.
Sunday, February 18, 2007
ATLRUG
Designing and programming in a group environment is so different from a solo project. Pros and cons for both styles of development. One of the definite advantages of working in a (small) group is combining everyone's ideas and effort into one big result. I was introduced to this style of programming @ Emory in one of my grad classes. I know I felt relieved that I wouldn't have to program all of it myself, but hey it's one way of learning something new!
On a side note, Atlanta is a small world: I ran into an ALE guy at this meeting, who is also a regular at the Python and Perl meetings! I just may check those out!
ATL Hack
Thursday, February 15, 2007
Project #2: Hibernate
My inspriation came from using Rails, and how effortless it is to do the CRUD operations. ( Of course Rails and scaffolding makes it almost too simple to retrieve/update data! ) The mapping tools are promising and I am looking forward to seeing what Hibernate can offer me.
Wish me luck!
Project #1: Work on the Retail Website
Saturday, February 10, 2007
SoCon07
Just got back from a social networking event in Atlanta, GA. It was very interesting to have discussions on topics ranging from Web 2.0, start-ups, venture capitalists, to cool new innovative technologies. It takes a considerable effort to get people (software and non-software based) to meet up and socialise in a conference - non-conference way (which btw was a pretty neat idea). A shout out to the SoCon team!
One discussion topic stuck with me: Entrepreneur 2.0, moderated by Jeff Haynie since my husband and I are planning to start our own company in the very near future. We talked about the different stages of a start up, what makes it successful and financing the whole deal. I heard (horror?) stories about how 12 years ago, if you wanted to start your own company, you were pretty much on your own. We are lucky to live in this time and age where there is a support system for start-ups: communities of already-made-it businessmen, venture capitalists who are willing to help out. There is talk about a Start-Up conference too ( in summer? ), organized by a few of the same guys involved in SoCon07. Should be fun to attend.