Recently I started to investigate on writing an Ant script to build our J2EE web application. Right now we just export the WAR file using Eclipse IDE, but we plan to adopt Jenkins for the build automation, then we got a problem. I tried Eclipse Headless build, it did not working. So I decided to use Ant script to build our J2EE web application. Our application is based on Weblogic 10.3, it uses lots of weblogic portal library, netUI, and page flow. Through several times trial and error, finally I got my ant script works. It is a kind of tricky, here I would like to share my experience, show you how to write an ANT script to build the Weblogic beehive application.
1. Setup the environment variables in your ANT script file
You need to setup following environment variables: WL_HOME, WORKSHOP_HOME, and BEA_HOME.
In my computer weblogic was installed under C:\Oracle\Middleware, so these environment variables will look like this in my build.xml:
<property environment="env"/>
<property name="env.WL_HOME" value="C:/Oracle/Middleware/wlserver_10.3"/>
<property name="env.WORKSHOP_HOME" value="C:/Oracle/Middleware/wlportal_10.3/workshop" />
<property name="env.BEA_HOME" value="C:/Oracle/Middleware" />
2. Import weblogic Ant task files into build.xml
Based on this article, WebLogic Server ships with the following Ant files for building and deploying Beehive applications:
<WL_HOME>\workshop\weblogic-beehive\ant\weblogic-beehive-buildmodules.xml
<WL_HOME>\workshop\weblogic-beehive\ant\weblogic-beehive-tools.xml
<WL_HOME>\workshop\weblogic-beehive\ant\weblogic-beehive-imports.xml
In my computer, the ant script folder will be: C:\Oracle\Middleware\wlportal_10.3\workshop\weblogic-beehive\ant
I found a bug, in weblogic-beehive-imports.xml:
<property name="apache.xbean.jar" value="${env.BEA_HOME}/modules/com.bea.core.xml.xmlbeans_1.0.0.0_2-4-1.jar"/>
<property name="bea.xbean.jar" value="${env.BEA_HOME}/modules/com.bea.core.xml.beaxmlbeans_1.0.0.0_2-4-1.jar"/>
should be changed to:
<property name="apache.xbean.jar" value="${env.BEA_HOME}/modules/com.bea.core.xml.xmlbeans_1.1.0.0_2-4-1.jar"/>
<property name="bea.xbean.jar" value="${env.BEA_HOME}/modules/com.bea.core.xml.beaxmlbeans_1.1.0.0_2-4-1.jar"/>
I just copied those 3 xml file into my project folder, so in my build.xml, add following after the property definition:
<import file="weblogic-beehive-imports.xml"/>
<import file="weblogic-beehive-tools.xml"/>
<import file="weblogic-beehive-buildmodules.xml"/>
3. Write ant target to build web application
Use weblogic "build-webapp" ant task, it will compile the source code, and it will generate the page flow xml, specifically it will generate those xml files under WEB-INF\classes\_pageflow folder, which took me a long time to figure out.
Please note: to build successfully, you need to put the source code under the WEB-INF\src folder.
The ant target will look like this:
<target name="build-web" depends="init">
<build-webapp
webapp.src.dir="${build.dir}"
webapp.build.dir="${build.dir}"
app.build.classpath="webapp.classpath"/>
</target>
4. "Error running apt compiler" issue
At first the ant script works in my local machine, but under windows server it failed with "Error running apt compiler", and the detailed error is like "CreateProcess error=87". After Google this error, and found out it is because the classpath is too long.
To fix this, I checked my classpath library, and removed all the unnecessary files, and finally it is working.
Resource
1. Building Beehive Applications
Wednesday, June 5, 2013
Tuesday, June 4, 2013
My Toastmaster Sergeant-At-Arms debrief
Now it comes to the toastmaster year end, and my role as SAA is almost finished. It is time for me have a debrief.
WHY I picked the Role of SAA
Last year of this time, I just joined the Markham Toastmasters club for a couple month, I was very impressed by the highly structured meeting, I was really curious about what is the behind scene; and as a software developer I am very interested in self-organized team, toastmaster club is a good example of self-organized team, I really want to know more about it; the third reason is I thought SAA is the easiest job, if you can arrive earlier each time, then it is not a problem. Considering these reasons, which droves me to attend the executive team, take the role of SAA.
HOW I did my jobs and my achievements
When I started working, I realized I was wrong, there are lots of work - both visible and invisible jobs. At the beginning, I feel a kind of stressed, and even more the past SAA Hitesh did such a great job, he raised the bar, which made me nervous, how can I match that? My mentor Robert suggested me that just try my best, I will say I did that. I have a passion to do a better job, always try to come to the meeting at 6:30PM, this job needs focus on details, since any small mistake will cause the problem; and you have to keep multi-tasking, which means I need to do some sacrifice, focus on helping others without pay attention to the meeting. I keep asking for help, Hitesh give me lots of tips, I really appreciate this guy.
What I am proud of myself is I applied what I learned from my career to the SAA role, for example, from Lean I learned value added system and eliminate waste - when I do my job of SAA, I keep asking my self, how can I add more value to the club? how to make it better? From Kanban, I create a Kanban board to visualize the guest list; From continuous improvement philosophy, I keep asking myself, how can I improve the process, make the process better? And from Scrum/Agile, I learned the concept of Servant leadership, which means a good leader is helping other better, removing the impediments which hold them back; all these helped me a lot to do my job.
Overall beside I did my job, I make the following achievements which I believe added the value to the club:
- Created a Kanban board using a software called Trello, which is lot easier to tracking the guest list and collaborate around the executive team;
- We stared recording video for speakers since February this year;
- Setup a facebook group for the club, trying to bring social media into club
Those are nobody asked you to do it, and neither will create benefit to myself, I don't even think about adding them to my CL manual, but I still want to do them? Why? because based on the lean thinking, they definitely add value to the customer - our club members, our job is delight customer, make them happy.
Overall I got positive feedback so far, which means my hard work was recognized.
The Benefit I got
I will say this is a great experience to me, the work itself is a reward. I can apply what I learned to the club, I had the autonomy to make changes, make improvement, and especially when you see your efforts can help others and make some influence, this is a great joy. I really appreciate I have this opportunity to bring my contribution and make our club better. Another great benefit is I have a chance to make friends, they inspire me and help me a lot, which is a great asset and will definitely help me in future.
Something BAD
The only BAD thing to me is I only make one speech this year, and my table topic skills is still not improved. Comparing to other executive members, I fell behind.
The reason is one: SAA job do take more time than I thought, and it will take me lots of time to prepare my speech, there is a conflict between these 2 things, I really admire other executive members, how can they finish 2 things at the same time?
Next step
Next year, I will focus on my speech, trying to finish my CC ASAP! I fell far behind with my fellow members, I need to catch up. I have bigger plans, but I realize the road block is my CC manual, it is the impediment to reach my goals. I really need help, I need mentor, I would really appreciate if anybody can help me.
WHY I picked the Role of SAA
Last year of this time, I just joined the Markham Toastmasters club for a couple month, I was very impressed by the highly structured meeting, I was really curious about what is the behind scene; and as a software developer I am very interested in self-organized team, toastmaster club is a good example of self-organized team, I really want to know more about it; the third reason is I thought SAA is the easiest job, if you can arrive earlier each time, then it is not a problem. Considering these reasons, which droves me to attend the executive team, take the role of SAA.
HOW I did my jobs and my achievements
When I started working, I realized I was wrong, there are lots of work - both visible and invisible jobs. At the beginning, I feel a kind of stressed, and even more the past SAA Hitesh did such a great job, he raised the bar, which made me nervous, how can I match that? My mentor Robert suggested me that just try my best, I will say I did that. I have a passion to do a better job, always try to come to the meeting at 6:30PM, this job needs focus on details, since any small mistake will cause the problem; and you have to keep multi-tasking, which means I need to do some sacrifice, focus on helping others without pay attention to the meeting. I keep asking for help, Hitesh give me lots of tips, I really appreciate this guy.
What I am proud of myself is I applied what I learned from my career to the SAA role, for example, from Lean I learned value added system and eliminate waste - when I do my job of SAA, I keep asking my self, how can I add more value to the club? how to make it better? From Kanban, I create a Kanban board to visualize the guest list; From continuous improvement philosophy, I keep asking myself, how can I improve the process, make the process better? And from Scrum/Agile, I learned the concept of Servant leadership, which means a good leader is helping other better, removing the impediments which hold them back; all these helped me a lot to do my job.
Overall beside I did my job, I make the following achievements which I believe added the value to the club:
- Created a Kanban board using a software called Trello, which is lot easier to tracking the guest list and collaborate around the executive team;
- We stared recording video for speakers since February this year;
- Setup a facebook group for the club, trying to bring social media into club
Those are nobody asked you to do it, and neither will create benefit to myself, I don't even think about adding them to my CL manual, but I still want to do them? Why? because based on the lean thinking, they definitely add value to the customer - our club members, our job is delight customer, make them happy.
Overall I got positive feedback so far, which means my hard work was recognized.
The Benefit I got
I will say this is a great experience to me, the work itself is a reward. I can apply what I learned to the club, I had the autonomy to make changes, make improvement, and especially when you see your efforts can help others and make some influence, this is a great joy. I really appreciate I have this opportunity to bring my contribution and make our club better. Another great benefit is I have a chance to make friends, they inspire me and help me a lot, which is a great asset and will definitely help me in future.
Something BAD
The only BAD thing to me is I only make one speech this year, and my table topic skills is still not improved. Comparing to other executive members, I fell behind.
The reason is one: SAA job do take more time than I thought, and it will take me lots of time to prepare my speech, there is a conflict between these 2 things, I really admire other executive members, how can they finish 2 things at the same time?
Next step
Next year, I will focus on my speech, trying to finish my CC ASAP! I fell far behind with my fellow members, I need to catch up. I have bigger plans, but I realize the road block is my CC manual, it is the impediment to reach my goals. I really need help, I need mentor, I would really appreciate if anybody can help me.
Monday, May 27, 2013
Workshop notes of "3 Secrets to better Public speaking
Last Saturday on May 25th, I participated the Toastmaster Division A education workshop at York Regional Police Station(Yonge/Major Mackenzie). 2 hour-session only costs me $5. Now I share the note of the first session - 3 Secrets to better public speaking.
The speaker is Mr. Jacques Brunet, I like his speech, and was really impressed the way he delivered the message. Like what he said, all the tips he told are common sense, but they are forgotten truth, we just don't aware them. Tonight I spent some time to review my notes, and put them in the mind map using XMIND, and share it with you. hope it will be helpful.
Here is the URL to the mind map of this workshop note. http://www.xmind.net/m/2ESL/
The speaker is Mr. Jacques Brunet, I like his speech, and was really impressed the way he delivered the message. Like what he said, all the tips he told are common sense, but they are forgotten truth, we just don't aware them. Tonight I spent some time to review my notes, and put them in the mind map using XMIND, and share it with you. hope it will be helpful.
Here is the URL to the mind map of this workshop note. http://www.xmind.net/m/2ESL/
Sunday, January 20, 2013
learn from Jiro, practice your craft
Last week I read an inspiring article from linked in by Jeff Weiner(CEO of LinkedIn), called From Seinfeld to Sushi: How to Master Your Domain, this is a great article, it tells you the similarity of masters how to practice their crafts, either a joke master or a sushi master. I Love this idea since the software craftsmanship is my passion, and definitely we can apply this techniques into our software practices. And in the article the author recommends the movie of "Jiro dreams of sushi". Finally I found the movie and watched it twice. It is really an amazing movie, I highly recommend every one should watch that, very inspiring.
Here is what I learned from the movie:
Here is what I learned from the movie:
- Passionate about his job, Jiro said he fell in love his job, he love to make better sushi, he is hardworking, I still working at the age of 85, working 364 days a year;
- Take job seriously
- Keep practicing over and and over
- Keep improving skills bit by bit, kaizen culture
- Money is secondary, he does not care the money, he only wants to make better sushi.
For me I love the software craftsmanship, but I don't have the passion for my work, I don't love my job, this is the issue for me.
I think one issue in software industry is, there is no culture to encourage developer to perfect their crafts. The managers just want get the job done, there is no pride of the work, and the job market does not look at developers crafts. But the culture of crafts are deeply rooted in the Japanese culture, either making sushi, or practice kendo or making cars, you can tell they share the same philosophy.
The other one is software's complexity nature, sushi has been through a long time, it has a repeatable process, that is why Jiro can improve his skills by keep repeating the same thing over and over. But software is so different, it is very hard to repeat the same task, since each time you are doing the different things. But I feel we can extract the coding practices from the tasks, even each task is different, but coding practices are similar.
The other one is software's complexity nature, sushi has been through a long time, it has a repeatable process, that is why Jiro can improve his skills by keep repeating the same thing over and over. But software is so different, it is very hard to repeat the same task, since each time you are doing the different things. But I feel we can extract the coding practices from the tasks, even each task is different, but coding practices are similar.
The third part I think in software craftsmanship, we need to improve our skills in many different area: like tools, different languages, process, and even your communication skills. This is really challenging and that is why it needs whole life training.
Quotes
Here I post some quotes from the movie:
Here I post some quotes from the movie:
- Ultimate simplicity leads purity
- 5 attributes of a great chef: 1. take their work seriously; 2. aspire to improve skills; 3. cleanness; 4. impatience; 5. passionate
- They are better leaders than collaborators,. they are stubborn and insist on having in their way
- We don't care about the money, all I want to do is making better sushi
- Shokunin try to get the highest quality fish, and apply their technique to it
- I do the same thing over and over, improving bit by bit, there is always a yearning to achieve more
- I will continue to climb, trying to reach the top, but no one knows where the top is
- I've never hated this job. I fell in love with my work and gave my life to it. Even though I'm 85, I don't feel like retiring. That's just the way I feel
Thursday, November 29, 2012
My 3rd toastmaster speech
I just finished my 3rd toastmaster speech - "Get to your point". After a long time break, finally I got a chance to practice my speech. This time I tried to reduce my preparation time, because I spent too much time memorizing my notes.
During the speech I think I did well, but I need to have more pause, I spoke too fast, it took me 5:30 to finish the whole speech, I think it might due to I practiced too much and trying to recite my notes during the speech, I will try to improve it next time.
I would like to thank my mentor Robert Fox, he helped me a lot, reviewed my script, which made me rewrite my script almost entirely. I will say without his help, I could not finish my speech successfully.
I also learned from him that it is very important to bring your personal example, since it will bring more connection to the audience, because people like the concrete examples, and also make it easier to memorize, and more confident for you to tell your own story.
My speech is based on the book "connected"(this is author's video on Ted), and chad fowler's blog post: "be careful of who you work with".
Following is my script.
The power of social network
During the speech I think I did well, but I need to have more pause, I spoke too fast, it took me 5:30 to finish the whole speech, I think it might due to I practiced too much and trying to recite my notes during the speech, I will try to improve it next time.
I would like to thank my mentor Robert Fox, he helped me a lot, reviewed my script, which made me rewrite my script almost entirely. I will say without his help, I could not finish my speech successfully.
I also learned from him that it is very important to bring your personal example, since it will bring more connection to the audience, because people like the concrete examples, and also make it easier to memorize, and more confident for you to tell your own story.
My speech is based on the book "connected"(this is author's video on Ted), and chad fowler's blog post: "be careful of who you work with".
Following is my script.
The power of social network
Birds of a feather flock together, this quote tells us the power of social network.
We all know that networking is important, but how important it is? What is the power behind it?
Today I am going try to answer these questions.
Mr. Toastmaster, fellow toastmaster, and welcome guests, my name is Steve.
The reason I choose this topic is because I found a good book by chance, it is called - "connected". This is a very inspiring book about social network.
First let me share you a scientific research result coming from the book. The 2 authors studied obesity, and they found that the obesity can spread through the social network, like virus, they give the following striking result:
If your friend is obese, then you have about 45% higher chance to be obese;
If your friend's friends is obese, you have 25% higher chance to be obese, and
If your friend's friend's friend is obese, then you still have 10% more likely to be obese.
And also obese people are more likely connect to each other, and non-obese people more likely connect to other non-obese people.
This example tells us that human behaviour is contagious, we are so easy to get influenced: if your friend is overweight, you will be overweight, and if your friend is richer, you will be richer; if your friend is happy, and you will be happy.
This is the power of the social network, it shape our lives: it affects our health, wealth and success. it can make you good or bad.
so please choose your friend wisely.
And be careful of who you work with!
Let me share with you my bad work experience, about 10 years ago, I joined a large company, but I found culture was bad: I saw bureaucracy, favouritism, and ridiculous process, my job was boring and slow moving. I was totally frustrated and not happy, and until one day I decided to leave because I could not stand anymore.
So my lesson is choose your employer carefully, the culture is more important than the salary.
There is another kind of social network we can not ignore, it is the social network over the internet. In the last 5 years, facebook, linkedIn, twitter, become more and more popular, compare to the physical social network, they have some advantages: they spread ideas lot faster and easier, and people are much easier to get influenced.
For my personal example, I like twitter, I've been using twitter for 3 years, I follow many masters and gurus in the IT industry, I read their tweets, read their books and articles. And the interesting thing is those gurus are usually connected each other, I feel I am in their loops and listen to their conversations, which is definitely helpful for my career. I learned a lot, my mindset was changed, I understand what I need to improve and where I should go in future.
Blog is another powerful tool influenced me a lot, it was a blog post which inspired me to join the toastmaster club, last year this time, I read a blog post, it mentioned if you does not give a good speech, then you are wasting people's time, you are killing people's life! How to make a better public speech? join the toastmaster club, that drive me standing here.
And I also have my personal blogs, Sometime I got comments and emails from all over the world, thanked me how my articles helped them for their work. Those are very encouraging, which stimulate me to continuing writing blogs. In the internet you never know how much influence you can have, how much help you can give other people!
In conclusion, the social network shapes our lives,it can make you good or bad. We get benefit from a good social network, it is also our responsibility to make it better. It helped me me, and I am sure if can help you as well.
I like to share a quote from this book:"When you smile, the world smiles with you".
Mr. Toastmaster
Wednesday, October 24, 2012
gzip compression/decompression in Ruby
Recently I did some investigation compression and decompression in gzip format using Ruby. Here I posted my ruby code:
Sunday, October 21, 2012
How to render JSON in rhodes mobile framework
Currently I am using Rhodes framework to build mobile applications. Recently I just figured out how to request an Ajax call from view, and controller how to render a JSON object and return it to the view.
Sample code
Ajax call to request json object using jQuery:
code of rending json in controller
I found this solution in the Rhomobile launchpad forum, it works perfectly.
This exactly looks like render json behaviour in Ruby on Rails.
Sample code
Ajax call to request json object using jQuery:
code of rending json in controller
I found this solution in the Rhomobile launchpad forum, it works perfectly.
This exactly looks like render json behaviour in Ruby on Rails.
Subscribe to:
Posts (Atom)