tag:blogger.com,1999:blog-58841111062082459552024-03-13T20:20:47.521-07:00Heritage......Sri Lanka - A Land Like No OtherImesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-5884111106208245955.post-16642740068749513362020-07-21T08:01:00.062-07:002021-01-24T07:39:46.183-08:00Long Garbage Collection time on processing.. alert. <p style="text-align: justify;">Recently our J2EE application converted to Springboot architecture. Although I 've mentioned here as Springboot architecture, it is not a complete Springboot powered application. Our front end is not MVC or a Rest service, it is JSF 2.X. We are not using embedded Tomcat, instead standalone Tomcat. </p><p style="text-align: justify;">Having all these in this application, we ran the show around 2 weeks no issues, a good migration. Great work !!</p><p style="text-align: justify;">But one fine day, Boom!. We received Long Garbage Collection alert. Tomcat restarted, everything looks ok, back to work. Nothing specifically found in the application logs. So we thought it is just one isolated case.</p><p style="text-align: justify;">After two weeks, alert received again. No dead locks in thread dump. Wasn't able to get the memory dump since it takes at least 30 min to create the dump, where the system is not available for the customers while obtaining heap dump. Issue was now happening almost daily. Day and midnight where there were no significant load in the system. We knew that this was not related to the load, yet something else triggering. </p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzGCiPweosl7TDQ843h7rXtKmKBLQsXKbhyphenhyphenRVpFQLeR-m6_D9wuQreBWbHjXnrPIYcHnlprElYoFlyhVgiWOZotdGaw6QKcxr3PobkGsUUSODAtMMGvkzQ-f-1NpZIU43zffLXXsPgC8/s3931/20210123_154527.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="3931" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzGCiPweosl7TDQ843h7rXtKmKBLQsXKbhyphenhyphenRVpFQLeR-m6_D9wuQreBWbHjXnrPIYcHnlprElYoFlyhVgiWOZotdGaw6QKcxr3PobkGsUUSODAtMMGvkzQ-f-1NpZIU43zffLXXsPgC8/w522-h114/20210123_154527.jpg" width="522" /></a></div><div style="text-align: justify;"><br /></div><p style="text-align: justify;">Above is the pattern of garbage collection in Edan space (Young Gen). You can see, when the issue triggered, it was continuously calling for long time.</p><p style="text-align: justify;"><br /></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2iQQ6QCdTDjGpAkHp88ExP7j7Gh04347uM_RvJ8Ugbw2fuyp_eLGlOy-GvBr26OpDzrnw8ggVhUMpXOc8BQ4jXETZ5aHrhhFKgtHi64-dDv8uuogdLx1LkrZXrMKSgX3i-BM-OeJgBc/s2048/Inked20210123_154706_LI.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1122" data-original-width="2048" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2iQQ6QCdTDjGpAkHp88ExP7j7Gh04347uM_RvJ8Ugbw2fuyp_eLGlOy-GvBr26OpDzrnw8ggVhUMpXOc8BQ4jXETZ5aHrhhFKgtHi64-dDv8uuogdLx1LkrZXrMKSgX3i-BM-OeJgBc/w526-h175/Inked20210123_154706_LI.jpg" width="526" /></a></div><div style="text-align: justify;"><br /></div><p style="text-align: justify;">Above is old gen memory. You can see that it was growing slowly, and have started calling garbage collection later. To respect to the data, I had to mask some of the details here. Most important thing is the graph pattern.</p><p style="text-align: justify;">Meanwhile, in the tomcat console, we found there were long lasting http sessions in the server. Those were few days old, yet still there in the memory. This was a requirement in the application, but it has this negative effect of long lasting sessions. Fixed this issue, and now no more long lasting sessions. Further, we closed all the Streams, IO/http connections after used, and optimised some of the memory usage in the application, but still issue was occurring.</p><p style="text-align: justify;">One day midnight we were able to get the heap dump. The heap dump analysis showed us that there are lot of String objects there in the memory. (No choice, strings are highly used in the application for various logics, for report and email generation, etc.) We used Eclipse MAT and VisualVM to analyse the heap dump. Eclipse MAT showed that there is a memory leakage in the class loader in their leak detection analysis.<br /></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOpHrDP9G4dMFIM2hMZKoQ5DBXlYGOD_FbjKkQ1IgUtEGEkfdWKYJLUQ-fHdNEC1Da8I6liyiJVy3eRm49yivc76u-fltxkTpmPA8CDyzzsEvUz4zgHML6tYpjcRRziB94AiZ8BPWvmI8/s2048/20210123_160507.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1108" data-original-width="2048" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOpHrDP9G4dMFIM2hMZKoQ5DBXlYGOD_FbjKkQ1IgUtEGEkfdWKYJLUQ-fHdNEC1Da8I6liyiJVy3eRm49yivc76u-fltxkTpmPA8CDyzzsEvUz4zgHML6tYpjcRRziB94AiZ8BPWvmI8/w550-h173/20210123_160507.jpg" width="550" /></a></div><p></p><div class="separator" style="clear: both; text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHrvXQUDzfGu6zN90hQqMCNW0NNgoZrCHkm9lujAvWuboN6lzUWWOEnPeb1eFjZ5LtE2Mwu3kaqjIPszerDqCoqIFQ7Dmjl-r1gKt4PdjXLvbcsfO-I1vtU7PrKV_338LU9CpPOlyXp5k/s2048/20210123_160547.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1229" data-original-width="2048" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHrvXQUDzfGu6zN90hQqMCNW0NNgoZrCHkm9lujAvWuboN6lzUWWOEnPeb1eFjZ5LtE2Mwu3kaqjIPszerDqCoqIFQ7Dmjl-r1gKt4PdjXLvbcsfO-I1vtU7PrKV_338LU9CpPOlyXp5k/w555-h192/20210123_160547.jpg" width="555" /></a></div><p></p><p style="text-align: justify;">Above are from Eclipse MAT.</p><p style="text-align: justify;">But interestingly, VisualVM gave us a hint that large objects were held by Jasper report classes. However, we didn't have an idea how this happened and how to simulate the issue in our DEV or UAT environment as the issue was not occurring always. We further analysed the user behaviour when the issue occurred and found a way to simulate the issue.</p><p style="text-align: justify;">Marvellous !!! The culprit was Jasper reports. When the pdf file does not have enough space to add the string generated in runtime, Jasper report library getting stuck and keep accumulating the memory internally. Allocated more space in the pdf file to include the string, and the issue was fixed. 😊😊😊</p><p style="text-align: justify;">(GC Algorithm is G1 GC.)</p><p style="text-align: justify;">Few hints I can give,</p><p></p><ul style="text-align: left;"><li style="text-align: justify;">Check the sessions in Tomcat console - this will give you long lasting sessions with the timing.</li><li style="text-align: justify;">Check the threads in Tomcat console - this will show you whether any thread is stuck in Serving state. Which could be a problematic thread.</li><li style="text-align: justify;">Check the large objects in VisualVM.</li><li style="text-align: justify;">If you are a customer facing application, then use GA Analytics to see user flow.</li></ul><div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Some readings can be found here. </div><div style="text-align: justify;"><a href="https://dzone.com/articles/troubleshoot-sudden-cpu-spikes">https://dzone.com/articles/troubleshoot-sudden-cpu-spikes</a></div></div><div style="text-align: justify;"><br /></div><p></p><p style="text-align: justify;"><br /></p>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-49290756035661885682018-10-17T22:49:00.000-07:002021-01-22T18:51:57.239-08:00 Ajeewa Attamaka Sil ( Ajeewa Ashtamaka Seelaya )<div style="text-align: left;">This post is related to the Buddhism. Every time when I need to observe the Ajeewa Ashtamaka Sil on my off day, I had to go to YouTube and search for it. It is very hard to find these 8 precepts in internet in one place. Moreover, there is no much articles available about Ajeewa Attamaka Sil to learn. Therefore, for the benefit of others, I thought to mention Ajeewa Attamaka Sil precepts in my blog.</div><div><br /></div><div>For further reading about the meaning of each of these, you have to explore more on the internet. I'm not a right person to explain further meaning of each.</div><div><ol style="text-align: left;"><li style="text-align: left;">Panathipatha veramani sikkhapadan samadiyami. (I undertake the training rule to abstain from taking life. ) </li><li style="text-align: left;">Adinnadana veramaṇi sikkhapadaṃ samadiyami. ( I undertake the training rule to abstain from stealing. )</li><li style="text-align: left;">Kamesu micchacara veramaṇi sikkhapadaṃ samadiyami. ( I undertake the training rule to abstain from sexual misconduct. )</li><li style="text-align: left;">Musavada veramaṇi sikkhapadaṃ samadiyami. ( I undertake the training rule to abstain from false speech. )</li><li style="text-align: left;">Pisunawacha veramani sikkhapadaṃ samadiyami. ( I undertake the training rule to abstain from slandering speech. ) </li><li style="text-align: left;">Parusawacha veramani sikkhapadaṃ samadiyami. (I undertake the training rule to abstain from harsh speech. ) </li><li style="text-align: left;">Sampappalapa vermani sikkhapadaṃ samadiyami. (I undertake the training rule to abstain from frivolous speech. ) </li><li style="text-align: left;">Michcha ajeewa vermani sikkhapadaṃ samadiyami. ( I undertake the training rule to abstain from engaging in wrong livelihood. ) </li></ol><div style="text-align: left;"><br /></div><div>Below are the Sinhala meaning of last 4 precept mentioned above, respectively.</div><div><br /></div><div><ul style="text-align: left;"><li>Kelam keemen welakemi</li><li>Parushawachana keemen welakemi </li><li>Nissara wachana katha kireemen welakemi</li><li>Weradi divi pewethin wen wemi.</li></ul><h3 style="text-align: left;"><span style="color: #ffe599;"><b><br /><div style="text-align: center;"><b>May Triple Gem Bless You !!</b></div></b></span></h3></div></div><div><span style="color: #ffe599;"><b><br /></b></span></div><div><span style="color: #ffe599;"><b><br /></b></span></div><div><span style="color: #ffe599;"><b><br /></b></span></div><div><span style="color: #ffe599;"><b><br /></b></span></div>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0Singapore1.352083 103.819836-26.958150836178845 68.663586 29.662316836178846 138.976086tag:blogger.com,1999:blog-5884111106208245955.post-63748823439453276822016-02-14T07:57:00.000-08:002021-01-15T19:27:55.847-08:00How to generate alert mail to find Unchecked Exception in your JSF application (ExceptionHandlingActionListener)<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Past few days I had a dilemma of how to generate email alert if my JSF application has any RuntimeException. Finally I found a solution.<br />
<i><br /></i>
<i>ActionListenerImpl </i>class<i> </i> help me for that.<br />
<br />
No need to talk, let's start the party.<br />
<br />
<b>First step:</b><br />
We need to create <i>ExceptionHandlingActionListener </i> class that implements <i>ActionListenerImpl.</i><br />
in the <i>ExceptionHandlingActionListener </i>class<i>, </i>we should override the supper class <i>processAction(ActionEvent event) </i>method. And write our email alert code inside the <i>catch </i>block.<br />
<br />
So in my sysout " <i>Typing email " </i>section, we can call to a email generation method and pass the <i>StackTrace </i>to email body. Email formatting is not in my radar.<br />
<i><br /></i>
<br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #008800; font-weight: bold;">package</span> com<span style="color: #333333;">.</span><span style="color: #0000cc;">imesh</span><span style="color: #333333;">.</span><span style="color: #0000cc;">test</span><span style="color: #333333;">;</span>
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">javax.faces.event.ActionEvent</span><span style="color: #333333;">;</span>
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">javax.faces.event.ActionListener</span><span style="color: #333333;">;</span>
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #0e84b5; font-weight: bold;">com.sun.faces.application.ActionListenerImpl</span><span style="color: #333333;">;</span>
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #008800; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">ExceptionHandlingActionListener</span> <span style="color: #008800; font-weight: bold;">extends</span> ActionListenerImpl
<span style="color: #008800; font-weight: bold;">implements</span> ActionListener <span style="color: #333333;">{</span>
<span style="color: #555555; font-weight: bold;">@Override</span>
<span style="color: #008800; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">processAction</span> <span style="color: #333333;">(</span>ActionEvent event<span style="color: #333333;">)</span> <span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">try</span> <span style="color: #333333;">{</span>
<span style="color: #008800; font-weight: bold;">super</span><span style="color: #333333;">.</span><span style="color: #0000cc;">processAction</span> <span style="color: #333333;">(</span>event<span style="color: #333333;">);</span>
<span style="color: #333333;">}</span> <span style="color: #008800; font-weight: bold;">catch</span> <span style="color: #333333;">(</span>Throwable e<span style="color: #333333;">)</span> <span style="color: #333333;">{</span>
e<span style="color: #333333;">.</span><span style="color: #0000cc;">printStackTrace</span><span style="color: #333333;">();</span>
<span style="color: #008800; font-weight: bold;">try</span> <span style="color: #333333;">{</span>
System<span style="color: #333333;">.</span><span style="color: #0000cc;">out</span><span style="color: #333333;">.</span><span style="color: #0000cc;">println</span><span style="color: #333333;">(</span><span style="background-color: #fff0f0;">"----------------------- SYSTEM EXCEPTION EMAIL SEND BEGIN. -----------------------"</span><span style="color: #333333;">);</span>
System<span style="color: #333333;">.</span><span style="color: #0000cc;">out</span><span style="color: #333333;">.</span><span style="color: #0000cc;">println</span><span style="color: #333333;">(</span><span style="background-color: #fff0f0;">"Typing email"</span><span style="color: #333333;">);</span>
System<span style="color: #333333;">.</span><span style="color: #0000cc;">out</span><span style="color: #333333;">.</span><span style="color: #0000cc;">println</span><span style="color: #333333;">(</span><span style="background-color: #fff0f0;">"----------------------- SYSTEM EXCEPTION EMAIL SEND END. -----------------------"</span><span style="color: #333333;">);</span>
<span style="color: #333333;">}</span> <span style="color: #008800; font-weight: bold;">catch</span> <span style="color: #333333;">(</span>Exception f<span style="color: #333333;">)</span> <span style="color: #333333;">{</span>
System<span style="color: #333333;">.</span><span style="color: #0000cc;">out</span><span style="color: #333333;">.</span><span style="color: #0000cc;">println</span><span style="color: #333333;">(</span><span style="background-color: #fff0f0;">"----------------------- SYSTEM EXCEPTION EMAIL NOT ABLE TO SENT. -----------------------"</span><span style="color: #333333;">);</span>
f<span style="color: #333333;">.</span><span style="color: #0000cc;">printStackTrace</span><span style="color: #333333;">();</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
<span style="color: #333333;">}</span>
</pre>
</td></tr>
</tbody></table>
</div>
</div>
<br />
<br />
<b>Second step : </b><br />
Add this listener to the <i>faces-config.xml</i><br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #333333;"><</span>application<span style="color: #333333;">></span>
<span style="color: #333333;"><</span>action<span style="color: #333333;">-</span>listener<span style="color: #333333;">></span> com<span style="color: #333333;">.</span><span style="color: #0000cc;">imesh</span><span style="color: #333333;">.</span><span style="color: #0000cc;">test</span><span style="color: #333333;">.</span><span style="color: #0000cc;">ExceptionHandlingActionListener</span>
<span style="color: #333333;"></</span>action<span style="color: #333333;">-</span>listener<span style="color: #333333;">></span>
<span style="color: #333333;"></</span>application<span style="color: #333333;">></span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
Awesome!!!, We are done. Try create any RuntimeException in your application. Magically it will handle by our <i>ExceptionHandlingActionListener </i> and generate the email for you.<br />
<br />
Thank you, Comments are welcome !!.<br />
<br /></div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-25707845905314263602016-02-09T05:58:00.000-08:002016-02-11T03:12:33.341-08:00My experience with Qistina Express bus to Kuala Lumpur<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b>Qistina Bus Review</b><br />
<br />
I have seen many places that Qistina has bad review on certain things. I traveled to Kuala Lumpur from Singapore on 6th Feb 2016.<br />
<br />
My depart time was 8.30 am at Little India Arcade.<br />
Since I read all the review previous day, I just did another search to see whether the bus has got any seats available, thinking that if it's full then no need to wait for more pax. The bus was not appear in the search results. So I thought the bus is full and can go without waiting it to get filled.<br />
<br />
As most of the travelers mentioned, they were late. But the office was opened. I saw some ppl said that office was not opened till 10.30 am. But by the time I reach 8.30, the counter was already opened.<br />
<br />
Bus came around 9 am luckily. But it was waiting there till 9.30 for more passengers. There is no seat preference as we book. You can sit freely anywhere you need. So they add ppl who ever wants to go by this bus. Bus is full now.<br />
<br />
Then the journey started it's a big traffic due to chinese new year. After JB check point, the bus stopped in a petrol shed. Not to fill the petrol. I don't know where the hell driver went but the bus was stopped there around 40 mins for nothing. We did not move to another bus but we had to waste the time for nothing.<br />
<br />
Bus is not smelly, Driver didn't smoke during travel, Seats are average. A/C also OK. Driver was waiting for all passengers. He is fast but safe drive.<br />
<br />
So this is my experience the Journey to KL.<br />
<br />
<b>Sri Maju Group reivew</b><br />
<br />
On the way back to Singapore, I used Sri Maju travels. I had perfect journey. The bus reached on time to the TBS point and depart within 5 mins. No stops no wait. The driver stopped after 1,5 hrs for a small break in a petrol shed. again started and stopped in the usual stop for a tea break.<br />
<br />
So we started 1.30 from TBS we reach JB 6 pm. Amazing. The drive was very nice, he saw there is a block in the one enterence to the JB check point then he turn the bus in to another way. No traffic we went directly to the check point. And he wait until everyone come on each checkpoint and each time he count the pax.<br />
<br />
It's a Scania bus. The journey was not tired at all. Price was 18 SGD (not bad at all huh?)<br />
We reach around 7.20 to the Golden Mile Complex.<br />
<br />
How ever I will not use the Qistina Express again but for sure Sri Maju. Thumbs up for Sri Maju !!! </div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com12tag:blogger.com,1999:blog-5884111106208245955.post-74430911948711109582016-01-30T07:12:00.003-08:002021-01-15T22:37:58.846-08:00Damro Innovex Electronic goods and after service.<div dir="ltr" style="text-align: left;" trbidi="on">
I would like to write the review of the <a href="http://innovex.lk/" target="_blank">Damro Innovex</a> Pedestal Fans.<br />
<br />
Sometimes ago I bought two fans (one after another) from <a href="http://www.damro.lk/" target="_blank">Damro </a>which is <a href="http://innovex.lk/" target="_blank">Innovex </a>brand. After one and half year my first fan suddenly stopped working. So I gave to the Damro Dalugama showroom to check. I am out of warranty. They took almost 2 weeks and came back with Rs 900.00 service fee. When I asked them what did they do to fix, the showroom staff said they have no idea what the service center did.<br />
So I had my fan back. But after a one week again the fan is stopping intermittently. Then again it worked for few weeks with a bad sound and stopped working again. I went back to Damro, told them that few weeks ago I got repaired this but doesn't work again. They said they have service warranty for 6 months, so let's send this back to service center.</div><div dir="ltr" style="text-align: left;" trbidi="on"><br />
After 2 weeks, they phoned me and said the fan is fixed but I was charged Rs 1200.00 for the fix. I said what the hell you said it has 6 months warranty but now you charge me again Rs 1200. Then the staff said they will check with service center again but still didn't comeback.<br />
<br />
My loyalty for Damro is fading now. I had few electrical items from them thinking that I am supporting to Sri Lankan owned business.<br />
<br />
I just want to tell that based on these info decide whether you still go with Damro Innovex product and service or pay bit more higher price and purchase a long lasting branded product.<br />
<br />
I checked around and found that <a href="http://www.eliteradio.com/kdk/" target="_blank">KDK </a>is quite long lasting. Although it's double the price as Innovex fans, it could be a life time asset for you.</div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com3tag:blogger.com,1999:blog-5884111106208245955.post-16957057887217745842015-10-23T20:59:00.000-07:002015-10-23T20:59:59.001-07:00PC Dreams Laptop Hospital - Singapore<div dir="ltr" style="text-align: left;" trbidi="on">
Few weeks ago suddenly my laptop screen became white. So I checked in web and found a place call PC Dreams in Funan mall.<br />
http://forums.hardwarezone.com.sg/notebook-clinic-77/pc-dreams-best-laptop-repair-shop-2257096-167.html<br />
<br />
They hold the laptop by charging 64$ for inspection. And after three days phoned me and said it would cost 240$ to replce thr screen. The laptop it self is only cost me 500$. I checked with Acer service center. They said the screen cost around 80$ only.<br />
<br />
So I was misleeding with hardware zone forum and paid 64$ for nothing. Also they have broken the screem arm which I saw only I came home.</div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-92034955460237566372014-11-09T08:16:00.001-08:002014-11-09T08:17:29.449-08:00Resource in Maven POM<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Recently I was engaged to a project which convert a legacy ant build application into Maven build. My main application project has several sub projects. One child project fully contained sql scripts and cron job scripts. So I had to find where to include these sql and .sh files in the maven structure. I google and went through few articles to find out the correct place.<br />
<br />
There is no clear cut solution I found. Some people suggest to put it into resources folder and some suggest to use separate folder. So, I thought to go ahead with a separate folder because the content of resource folder will attach to ear once I build it ( but still we can exclude them. Yet I thought it could be messy).<br />
<br />
<br />
<b>Resources</b><br />
<br />
While surfing the web, I found more about Resources. We can include our separate folder into jar file. In my case, I do not want sql and .sh files to available in final jar. I just want to keep those in the same project. Let's see where to include those files and how to bundle our own folder into a jar.<br />
<div>
<br /></div>
<br />
Below is the apache introduction about Resources..<br />
" Resources is a nice feature of build elements is specifying where resources exist within the project. Resources are not (usually) code. They are not compiled, but are items meant to be bundled within your project or used for various other reasons, such as code generation"<br />
<br />
So I included all my sql and .sh files in its own directory instead put them in src/main/resource/scripts/sql, Now my sql and .sh files are located in src/main/scripts/sql and src/main/scripts/sh folders respectively. When I build the project, scripts folder is not included to jar.<br />
<br />
Say, now I need to build a jar including the sql and sh files.<br />
<br />
For this I used JAR plugin to bundle the resource correctly, and I would specify resources similar to the following:<br />
<div>
<br /></div>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqsYdh80AjCzbCCKC4uU6jrlbVEPV7R5Af-n3Kdo5fxLMYwr4RAHEK5AKage9JKnVLM4DWF2EL-Jj4XKcHpB2EZeaNh4MsmFbquwJQqzffqXlpE5h_cWUJIWB1L3hGzoAEhfBUHmROlz0/s1600/CopyAsHtmlbg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<build>
...
<resources>
<resource>
<targetPath>scripts/sql</targetPath>
<filtering>false</filtering>
<directory>${basedir}/src/main/scripts</directory>
<includes>
<include>synctableA.sql</include>
</includes>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</resource>
</resources>
<testResources>
...
</testResources>
...
</build>
</project></pre>
</div>
<br />
<br />
See below detail about each tag.<br />
<br />
<ul style="text-align: left;">
<li>resources: is a list of resource elements that each describe what and where to include files associated with this project.</li>
<li>targetPath: Specifies the directory structure to place the set of resources from a build. Target path defaults to the base directory. A commonly specified target path for resources that will be packaged in a JAR is META-INF.</li>
<li>filtering: is true or false, denoting if filtering is to be enabled for this resource. Note, that filter *.properties files do not have to be defined for filtering to occur - resources can also use properties that are by default defined in the POM (such as ${project.version}), passed into the command line using the "-D" flag (for example, "-Dname=value") or are explicitly defined by the properties element. Filter files were covered above.</li>
<li>directory: This element's value defines where the resources are to be found. The default directory for a build is ${basedir}/src/main/resources.</li>
<li>includes: A set of files patterns which specify the files to include as resources under that specified directory, using * as a wildcard.</li>
<li>excludes: The same structure as includes, but specifies which files to ignore. In conflicts between include and exclude, exclude wins.</li>
<li>testResources: The testResources element block contains testResource elements. Their definitions are similar to resource elements, but are naturally used during test phases. The one difference is that the default (Super POM defined) test resource directory for a project is ${basedir}/src/test/resources. Test resources are not deployed.</li>
</ul>
<div>
Hope this would help to increase your knowledge about maven resources.</div>
</div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-62516419891314110752014-02-14T07:17:00.002-08:002014-02-14T07:44:03.856-08:00Use OpenEJB for Junit Test<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
I was struggling yesterday to find a way to do Junit test for EJB and I found OpenEJB. But the configuration gave me errors. So I thought to write a complete example because I couldn't find it anywhere.<br />
<br />
First lets create a simple ejb. <br />
<div class="container">
<div class="line number1 index0 alt2">
</div>
<div class="line number1 index0 alt2">
<span style="font-family: inherit;"><code class="java keyword">Here is the interface</code></span><br />
<br />
<blockquote class="tr_bq">
</blockquote>
</div>
<div class="line number1 index0 alt2">
</div>
<div class="line number1 index0 alt2">
<span style="color: red;"><code class="java keyword"> <span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"> package</span></span></code><span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"> <code class="java plain">com.imesh.testejb;</code></span></span></span></div>
<div class="line number3 index2 alt2">
<span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"><code class="java keyword"> import</code> <code class="java plain">javax.ejb.Local;</code></span></span></div>
<div class="line number5 index4 alt2">
<span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"><code class="java color1"> @Local</code></span></span></div>
<div class="line number6 index5 alt1">
<span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"><code class="java keyword"> public</code> <code class="java keyword">interface</code> <code>IHello</code><code class="java plain"> {</code></span></span></div>
<div class="line number7 index6 alt2">
<span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"><code class="java spaces"> </code><code class="java keyword"> public</code> string <code>sayHi</code><code class="java plain">(</code><code class="java plain">);</code></span></span></div>
<div class="line number8 index7 alt1">
<span style="color: lime;"><span style="font-family: Georgia,"Times New Roman",serif;"><code class="java plain"> }</code></span></span><br />
<blockquote class="tr_bq">
</blockquote>
</div>
<div class="line number8 index7 alt1">
</div>
<div class="line number8 index7 alt1">
</div>
<div class="line number8 index7 alt1">
</div>
<div class="line number8 index7 alt1">
<code class="java plain">OK now the bean class.</code></div>
<div class="line number8 index7 alt1">
</div>
<div class="line number8 index7 alt1">
<blockquote class="tr_bq">
<code class="java plain"> </code></blockquote>
<div class="container">
<div class="line number1 index0 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java keyword"> package</code> <code class="java plain">com.imesh.testejb;</code></span></span></div>
<div class="line number2 index1 alt1">
<span style="font-family: inherit;"><span style="color: lime;"> </span></span></div>
<div class="line number3 index2 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java keyword"> import</code> <code class="java plain">javax.ejb.Stateless;</code></span></span></div>
<div class="line number5 index4 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java preprocessor"> /**</code></span></span></div>
<div class="line number6 index5 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java preprocessor"> * Session Bean implementation class Hello</code></span></span></div>
<div class="line number7 index6 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java preprocessor"> */</code></span></span></div>
<div class="line number8 index7 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java color1"> @Stateless</code></span></span></div>
<div class="line number9 index8 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java keyword"> public</code> <code class="java keyword">class</code> <code>HelloBean </code><code class="java keyword">implements</code> <code>IHello</code><code class="java plain">{</code></span></span></div>
<div class="line number11 index10 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java preprocessor">/**</code></span></span></div>
<div class="line number12 index11 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java preprocessor">* Default constructor.</code></span></span></div>
<div class="line number13 index12 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java preprocessor">*/</code></span></span></div>
<div class="line number14 index13 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword">public</code> <code>HelloBean</code><code class="java keyword"></code><code class="java plain">() {</code></span></span></div>
<div class="line number16 index15 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain">}</code></span></span></div>
<div class="line number18 index17 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java color1"> @Override</code></span></span></div>
<div class="line number19 index18 alt2 highlighted">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword"> public</code> string <code>sayHi</code><code class="java plain">(</code><code class="java plain">) {</code></span></span></div>
<div class="line number21 index20 alt2">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword">return</code> <code>"HI"</code><code class="java plain">;</code></span></span></div>
<div class="line number22 index21 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain"> }</code></span></span></div>
<div class="line number24 index23 alt1">
<span style="font-family: inherit;"><span style="color: lime;"><code class="java plain"> }</code></span></span><br />
<blockquote class="tr_bq">
</blockquote>
</div>
<div class="line number24 index23 alt1">
</div>
<div class="line number24 index23 alt1">
<br />
<span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;">Write our unit test class.</span></code></span></span><br />
<blockquote class="tr_bq">
<br /></blockquote>
</div>
<div class="line number24 index23 alt1">
</div>
<div class="line number24 index23 alt1">
<div class="container">
<div class="line number1 index0 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">package</code> <code class="java plain">com.imesh.test.ejbtest;</code></span></span></div>
<div class="line number3 index2 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java keyword">static</code> <code class="java plain">org.junit.Assert.*;</code></span></span></div>
<div class="line number5 index4 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">java.util.Properties;</code></span></span></div>
<div class="line number7 index6 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">javax.ejb.EJB;</code></span></span></div>
<div class="line number8 index7 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">javax.naming.InitialContext;</code></span></span></div>
<div class="line number10 index9 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">org.apache.openejb.api.LocalClient;</code></span></span></div>
<div class="line number11 index10 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">org.junit.After;</code></span></span></div>
<div class="line number12 index11 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">org.junit.Before;</code></span></span></div>
<div class="line number13 index12 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">import</code> <code class="java plain">org.junit.Test;</code></span></span></div>
<div class="line number15 index14 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java color1">@LocalClient</code></span></span></div>
<div class="line number16 index15 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java keyword">public</code> <code class="java keyword">class</code> <code>HelloBean</code><code class="java plain">Test {</code></span></span></div>
<div class="line number18 index17 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"></code><code class="java plain"></code></span></span></div>
<div class="line number20 index19 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java color1">@Before</code></span></span></div>
<div class="line number21 index20 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword">public</code> <code class="java keyword">void</code> <code class="java plain">setUp() </code><code class="java keyword">throws</code> <code class="java plain">Exception {</code></span></span></div>
<div class="line number22 index21 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> Properties properties = new Properties();<br /> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");<br /> properties.setProperty("openejb.deployments.classpath.include", ".*");<br /> initialContext = new InitialContext(properties);</code></span></span></div>
<div class="line number27 index26 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain">}</code></span></span></div>
<div class="line number29 index28 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java color1">@After</code></span></span></div>
<div class="line number30 index29 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword">public</code> <code class="java keyword">void</code> <code class="java plain">tearDown() </code><code class="java keyword">throws</code> <code class="java plain">Exception {</code></span></span></div>
<div class="line number31 index30 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain">}</code></span></span></div>
<div class="line number33 index32 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java color1">@Test</code></span></span></div>
<div class="line number34 index33 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java keyword">public</code> <code class="java keyword">void</code> <code class="java plain">testSayHi() {</code></span></span></div>
<div class="line number34 index33 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java plain"> bean = (IHello) initialContext.lookup("</code><code class="java plain"><code>HelloBeanLocal</code>"); </code></span></span></div>
<div class="line number35 index34 alt2 highlighted">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain">assertEquals(</code><code class="java value">"Hi"</code><code class="java plain">, bean.sayHi(</code><code class="java value"></code><code class="java plain">));</code></span></span></div>
<div class="line number36 index35 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java spaces"> </code><code class="java plain"> </code></span></span></div>
<div class="line number36 index35 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java plain"> }</code></span></span></div>
<div class="line number37 index36 alt2">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"> private InitialContext initialContext; </span></span></div>
<div class="line number38 index37 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java plain"> </code>private <code class="java plain">IHello bean ;</code></span></span></div>
<div class="line number38 index37 alt1">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"><code class="java plain">}</code></span></span><br />
<blockquote class="tr_bq">
<br /></blockquote>
</div>
</div>
</div>
<div class="line number24 index23 alt1">
<span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;">Ok now we need ejb-jar.xml file which should be located in the META-INF folder.</span></code></span></span></div>
<div class="line number24 index23 alt1">
<span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;">ejb-jar.xml contains nothing but <span style="color: blue;"><ejb-jar> <span style="color: black;"><span style="font-family: inherit;">j</span></span></ejb-jar></span></span></code></span></span><span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;"><span style="color: blue;"><ejb-jar><ejb-jar><span style="color: black;">ust empty tag. I couldn't run the unit test without this xml but nobody mentioned about this xml in examples. The error I got is relate to the JNDI name not found.</span></ejb-jar></ejb-jar></span></span></code></span></span></div>
<div class="line number24 index23 alt1">
<span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;"><span style="color: blue;"><span style="color: black;">If you do use annotation in your ejb class, ejb-jar.xml will overwrite your annotation. So you can add this xml to test > resources > META-INF folder because we need this only for unit test. </span></span></span></code></span></span></div>
<div class="line number24 index23 alt1">
<span style="font-family: inherit;"><span style="color: red;"><code class="java plain"><span style="color: black;"><span style="color: blue;"><span style="color: black;">Next is dependencies. You may not want </span></span></span></code></span><span style="color: red;"><code class="java plain"><span style="color: black;"><span style="color: blue;"><span style="color: black;">slf4j dependency. But I had some errors without it.</span></span></span></code></span></span></div>
<div class="line number24 index23 alt1">
</div>
<div class="line number24 index23 alt1">
<blockquote class="tr_bq">
<code><dependency><br /><span style="font-family: Georgia,"Times New Roman",serif;"> <span style="color: lime;"> <groupid>org.apache.openejb</groupid><br /> <artifactid>openejb-core</artifactid><br /> <version>3.1.3</version><br /> <scope>test</scope><br /> </span></span></dependency><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: lime;"> <br /> <dependency><br /> <groupid>org.slf4j</groupid><br /> <artifactid>slf4j-nop</artifactid><br /> <version>1.6.1</version></dependency></span></span></code><br />
<div style="text-align: left;">
<blockquote class="tr_bq">
<blockquote class="tr_bq">
<code></code></blockquote>
</blockquote>
</div>
</blockquote>
<br />
<span style="font-family: inherit;"> <span style="color: red;"><code class="java plain"><span style="color: black;">That's it. We are done. you can compile and run the unit test.</span></code></span></span></div>
</div>
</div>
</div>
</div>
<blockquote class="tr_bq">
<div class="line number24 index23 alt1">
<span style="color: red;"><code class="java plain"><span style="font-family: inherit;"><span style="color: black;"> </span></span> </code></span></div>
</blockquote>
<code class="java plain"> </code></div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com1tag:blogger.com,1999:blog-5884111106208245955.post-2631950785453051812012-11-11T09:36:00.001-08:002012-11-11T09:36:47.898-08:00Malithma Flora<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">I </span><span style="font-family: Arial, Helvetica, sans-serif;">write this incident before you go to Malithma flora nugegoda. You can judge malithma flora while talking with them. Malithma is not flexible to their customers. Malithma flora did bad job in my sister's wedding flower decoration. In initial discussion malithma flora promise to make any new design and decorations for us. When dates close, we gave our choices but Malithma flora said they have to charge additional. So we had no option yet to go with existing. However eventually the decoration was poor.</span><br />
<span style="font-family: inherit;"><span style="font-family: Arial, Helvetica, sans-serif;">So I advise to sri lankans when hiring malithma flora for your wedding meet them and discuss deeply rather than simple telcons. Carefully test them. </span></span><br />
<br />
Here are there web details. They located in Nugegoda.<br />
<a href="http://www.ceylontravelguide.com/index.php?option=com_adsmanager&view=details&id=609&catid=29&Itemid=48">http://www.ceylontravelguide.com/index.php?option=com_adsmanager&view=details&id=609&catid=29&Itemid=48</a><br />
<br />
<a href="http://www.pansilu.biz/category_sub_page/decoration/Malithma%20flora/index.html">http://www.pansilu.biz/category_sub_page/decoration/Malithma%20flora/index.html</a><br />
<br />
<a href="http://www.facebook.com/pages/Malithma-flora/124974197525828">www.facebook.com/pages/Malithma-flora/124974197525828</a><br />
<br />
<br />
</div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-10494104923972325892012-09-29T10:45:00.001-07:002012-09-29T11:13:18.680-07:00A real ICT study place<div dir="ltr" style="text-align: left;" trbidi="on">
Recently I found an institute to sharpen my IT knowledge further. I have done my IT studies in several places around Colombo. Yet the knowledge I got is not worth for the amount I paid. Eventually I found a place call Foundation of IT Professional Sri Lanka. (FITP)<br />
<br />
Lessons held by Mr Thusitha Perara was very clear and understandable. Actually I believe that Mr Thusitha Perera was 'born to teach'.<br />
<br />
They conduct many classes for professional exams specially including BCS, ACS, BIT UCSC, Programing languages etc. It is a very flexible place where you do not want to worry about the course fees at all.<br />
<br />
Those who wants to learn real IT and want to become a professional in the IT industry within short period of time without spending unnecessarily money...<br />
I recommend FITP !!!<br />
<br />
<a href="http://www.sundayobserver.lk/2006/03/05/new12.html" target="_blank">What former Education Minister Susil Premajayantha says about FITP</a><br />
<br />
<br />
You can easily find this place. Its just in front of Pannipitiy nursing home. You can use 174 Kottawa - Borella bus. Anyone wants I can give the phone number of the lecturer, just drop your email I'll send it.<br />
<br />
<br />
<iframe frameborder="0" height="350" marginheight="0" marginwidth="0" scrolling="no" src="https://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=211424496087944028817.0004cadae8124b6b76b9a&ll=6.846791,79.952364&spn=0,0&t=m&output=embed" width="425"></iframe><br />
<small>View <a href="https://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=211424496087944028817.0004cadae8124b6b76b9a&ll=6.846791,79.952364&spn=0,0&t=m&source=embed" style="color: blue; text-align: left;">FITP</a> in a larger map</small> </div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0Pannipitiya Nursing Home, Pannipitiya - Malabe Rd, Pannipitiya, Sri Lanka6.846866 79.9522096.8448955000000007 79.9497415 6.8488365 79.954676499999991tag:blogger.com,1999:blog-5884111106208245955.post-38548219958636008072012-06-17T11:41:00.000-07:002012-11-11T08:11:25.325-08:00Kapruka Gift Delivery Service<div dir="ltr" style="text-align: left;" trbidi="on">
Recently I had bad experience with <a href="http://www.lanka.info/">Kapruka gift delivery.</a> (<a href="http://www.lanka.info/">www.lanka.info</a>). Kapruka never deliver on time. Also Kapruka did not pass the proper message to the receiver. I have used kapruka two times, in both instances kapruka did not deliver on time. I wanted to make it morning but they did it in afternoon. So my personal opinion is DO NOT USE them.<br />
<br />
Also the worst case is when I write kapruka regarding the issue customer support just sent me a computer generated general email which is a auto reply. Kapruka never care customers personally. Kapruka never listen each client's problem.<br />
<br />
<br />
<a href="http://www.facebook.com/kaprukafans">www.facebook.com/kaprukafans</a></div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com1tag:blogger.com,1999:blog-5884111106208245955.post-34361947717996674332012-01-21T06:05:00.000-08:002012-01-21T06:24:39.401-08:00HDMI display problem for DELL N Series with SONY BRAVIA<div dir="ltr" style="text-align: left;" trbidi="on">I was trying to use HDMI in my SONY BRAVIA with the DELL N Series. I bought a HDMI cable from ebay, it is version 1.4. I pluged it to the HDMI port 2 in the sony and tried to get display without success.<br />
I tried with downloading display drivers. And I tried to download the HDMI driver to the laptop. while checking in the google, found some links in intel site as my display driver is intel. Tried with restarting both TV and the laptop but nothing worked.<br />
<br />
In my Intel graphic HD properties I saw there's tab TV/Monitor settings and said "TV MONITOR SETTINGS ARE NOT SUPPORTED". So I thought this could be a reason and tried with that path too without success.<br />
<br />
Ultimately I was able to get the display. This is what I did and tried with some hints in intel site.<br />
I plugged the cable in to the HDMI port 2 in the TV. And I plugged to the port 1 while TV is on. Then I restarted laptop. Then I selected HDMI 1 in the TV menu and my laptop display settings mode was in dual display. You can change dual display setting by pressing f1 key (Select projector display).<br />
You can see dual display modes even when you right click on desktop and select screen resolution.<br />
<br />
Oh I forgot to say that my OS is WINDOWS 7 Ultimate.<br />
<br />
So if you are in dual display mode you after restart the laptop you can see your desktop in your TV.<br />
<br />
But Still I can't get the sounds from the TV. If I found it I will update you. I heard the sound from the TV when its loading the windows but when I watch a movie, the sound is only from the laptop.<br />
<br />
<br />
Ok great I found it. I opened the properties of my sounds software (IDT HD sounds). I saw a tab in leftside SONY TV. Then selected Set as default playback device and Set as default communication device. It worked.<br />
<br />
<br />
</div>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-40367069196152952402011-12-30T10:39:00.000-08:002011-12-30T10:39:13.131-08:00Bandarawela Holiday Home<div dir="ltr" style="text-align: left;" trbidi="on">Recently we (my family) went a trip to Bandarawela, I found this place from the web. I had no clue about what sort of a place it is when I book, though I paid 6000 for a unknown person (Mr Sarath) which I have only his mobile numbers. Eventually the place was very good. Caretaker is good, foods are ok. We have our freedom to play around. No restriction at all on anything. Actually a calm place. I would like to recommend this place to stay in Bandarawela when you go next time. Have fun !!</div>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0Bandarawela, Sri Lanka6.8237836077059928 80.9859129153442156.7985151077059927 80.963875915344218 6.8490521077059929 81.007949915344213tag:blogger.com,1999:blog-5884111106208245955.post-41473548743274511802011-06-18T09:31:00.000-07:002012-11-11T07:32:17.678-08:00Jayantha Learners - Narahenpita, Werahera, Malabe, Biyagama<div dir="ltr" style="text-align: left;" trbidi="on">
Recently I went to Jayantha learners to train and get my driving license. I registered with them for 5 lessons plus one lesson for motor bike. They said they can give vehicle anytime and we can call them and put an appointment. As discussed I phoned to the office to put the training session.The girl who is in office said vehicle is not available right now, So I asked what time it'll available then, she said "I can't say that exactly" then I asked can I come around 12 noon and will it available at that time, she said "come and see I can't predict". I was so angry. This is how they treat to clients after they take the job.<br />
<br />
I went their by 12 noon but the vehicle was not available. I had to wait their for more than 1 hr. Just sitting on a chair. They have only one vehicle. Apart from that, I asked I have one session for bike so when can I have it, she said for that I have to go Werahera. I was shocked, to get trained a bike have to go Werahera.<br />
<br />
So this is the bad experience I have with Jayantha Learners Narahenpita. I never recommend Jayantha learners to anyone. This has happened to my friend also.<br />
<br />
<div closure_uid_1hqzna="128">
Most of the time we have to hang around their office until vehicle comes. Even we booked it, It is not available at the reserved time.</div>
</div>
Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com11Colombo 5, Colombo, Sri Lanka6.8990422294542029 79.8770695533340816.8880817294542025 79.863752053334082 6.9100027294542032 79.890387053334081tag:blogger.com,1999:blog-5884111106208245955.post-81004758005815181192011-01-02T23:07:00.000-08:002011-01-02T23:07:01.356-08:00Home Jobs !! Try outOne of my lecturer sent me this link. You can try out.<br />
<br />
<a href="http://www.expresshomejobs.com/">http://www.expresshomejobs.com/</a>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-26106922421139697192010-12-02T20:09:00.000-08:002010-12-02T20:09:49.609-08:00Jaxp Error 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Content is not allowed in prolog.'I had the above error when I tried to transform a xml in to another xml.<br />
The mistake was, I have pass the xml file as a ByteArrayInputStream instead of InputStream. I was searching every where about the error but no clue with my code.<br />
<br />
<br />
xsltFile = getInputStream(xslPath);<br />
xmlFile = getInputStream(inputXML);<br />
<br />
Source xmlSource = new StreamSource(xmlFile);<br />
Source xsltSource = new StreamSource(xsltFile);<br />
<br />
// the factory pattern supports different XSLT processors<br />
TransformerFactory transFact = TransformerFactory.newInstance(); <br />
Templates cachedXSLT = transFact.newTemplates(xsltSource); <br />
Transformer trans = cachedXSLT.newTransformer();<br />
<br />
writer = new StringWriter();<br />
<br />
trans.transform(xmlSource, new StreamResult(writer)); <br />
<br />
System.out.println(writer.toString());<br />
<br />
<br />
Try to chenge the input type and it would help for you.<br />
Aalso I saw some info in Wrox site.<br />
<br />
http://p2p.wrox.com/xslt/48696-error-content-not-allowed-prolog-sos.htmlImesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com1tag:blogger.com,1999:blog-5884111106208245955.post-43318865905594697152010-12-02T07:08:00.000-08:002010-12-02T07:10:13.559-08:00Sri Lanka - Anyone needs B Positive Blood ?I have B+ Blood if anyone wants can donate.Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-77293964550420147622010-10-26T23:23:00.000-07:002010-10-26T23:23:01.621-07:00DIALOG GSM GPRS/MMS Settings for Sri Lanka<a href="http://jazonx.blogspot.com/2009/01/dialog-gsm-gprsmms-settings-for-sri.html">DIALOG GSM GPRS/MMS Settings for Sri Lanka</a>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0tag:blogger.com,1999:blog-5884111106208245955.post-24104748936906976092010-10-26T23:07:00.000-07:002010-10-26T23:15:24.725-07:00““Sanctuary in the middle of nature” The Wallawwa<span class="Apple-style-span" style="font-family: Verdana, Tahoma, 'Bitstream Vera Sans', sans-serif; font-size: 12px; color: rgb(44, 44, 44); line-height: 14px; ">It was a wonderful experience to be able to rest in a natural and rich surroundings before my long flight to Toronto. The Garden suite and the bathrooms were huge and I couldn’t have asked for more. I enjoyed the gentle winds and the breathtaking spectacular view of the natural beauty of the place along with the mature trees and birds. Amenities, cleanliness and impeccable service of the helpful and friendly staff made my stay pleasurable. Close to the Katunayake International airport, they have made sure that this place is always immaculate and pure for a comfortable sleep. Soft beddings with high quality linen were extras added to this relaxed atmosphere. An Escape from the ordinary, there was breathtaking landscapes and the delightful cuisine was lovely. The spa was another extra facility for tranquility. You will truly enjoy yourself if you want to get away from all the hassle before your Journey. “Sanctuary in the middle of nature”</span>dayswimerhttp://www.blogger.com/profile/01418027371468321362noreply@blogger.com3tag:blogger.com,1999:blog-5884111106208245955.post-24907387050111021412010-10-26T09:35:00.000-07:002010-10-26T09:35:55.789-07:00Mobitel MMS GPRS settingsI wanted to enable MMS and Internet for my new NOKIA 2720. I took the Mobitel customer service (0712755777) and they kept me for more than 17 minutes as they say "We Care Always".<br />
I tried another day and fortunately they caught me withing 5 min. So the person spoke from other side said that he will sms the settings shortly. As he said I got 2 sms but those are not the settings. <br />
Mobitel gives only 2 free calls to contact their customer service per month and now my free calls were finished. So I took another call from one of my friends phone and explained the discussion I had with their fellow. Without listening to me properly this stupid man said me he will send it again and if that does not work, try with 222#. He sent the configuration details to my friend's phone not to mine. <br />
Then I tried with 222# but it did not work. I took another call from my friend's phone then another girl spoke, said me that she can not send the details to my phone, I have to take the call from the one which setting wants. I said I am already done with my free calls and she said me to wait till next month Or go to their dealer shop.<br />
<br />
Later I tried in my phone settings and finally I got fixed it. Here's how I did it.<br />
<br />
Menu > Settings > Configuration > Device Manager Settings > Service Provider Software Updates<br />
<br />
In above place select "Always Allow" option. <br />
Then I tried with #222# and it worked.<br />
<br />
I found another link I would like to share with you all. I did not try with this but FYI.<br />
<a href="http://www.kavinda.net/2007/12/20/gprs-wap-and-mms-settings-for-mobitel.html">http://www.kavinda.net/2007/12/20/gprs-wap-and-mms-settings-for-mobitel.html</a>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com3tag:blogger.com,1999:blog-5884111106208245955.post-30938864776064855282010-06-28T06:41:00.000-07:002010-10-10T08:30:38.516-07:00A calm cool place to rest - Colombo, Sri Lanka<span style="font-family: verdana;">This is one of a calm place to spend your holidays. Not too far from colombo.</span><br />
<a href="http://www.rockchalet.net/">http://www.rockchalet.net/</a><br />
<span style="font-family: verdana;">TP. +94 112415166</span>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com2tag:blogger.com,1999:blog-5884111106208245955.post-45212217817377421172009-11-19T09:09:00.001-08:002010-06-21T09:48:11.645-07:00Here is some song sites...Latest Sinhala Songs - <a href="http://www.music.lk/">www.music.lk</a>Imesh Damithhttp://www.blogger.com/profile/00235083532040404435noreply@blogger.com0