<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5289317672382806955</atom:id><lastBuildDate>Fri, 25 Oct 2024 01:50:41 +0000</lastBuildDate><category>seam</category><category>ubuntu</category><category>hibernate</category><category>spring security</category><category>weblogic portal</category><category>ajaxtags</category><category>appengine</category><category>appengine grails</category><category>bugzilla admin password lostrd</category><category>console mode</category><category>headless</category><category>jersey restful</category><category>linux</category><category>subversion</category><title>Maniezhilan Shanmugam</title><description></description><link>http://maniezhilan.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-8403696846643838244</guid><pubDate>Wed, 24 Oct 2012 19:55:00 +0000</pubDate><atom:updated>2012-10-24T14:55:22.163-05:00</atom:updated><title>Install gettext on mac</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #424242; font-family: sans-serif, Helvetica, Arial, Verdana; font-size: 14px; line-height: 21px;&quot;&gt;$ brew install gettext&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #424242; font-family: sans-serif, Helvetica, Arial, Verdana; font-size: 14px; line-height: 21px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #424242; font-family: sans-serif, Helvetica, Arial, Verdana; font-size: 14px; line-height: 21px;&quot;&gt;$ brew link gettext&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #424242; font-family: sans-serif, Helvetica, Arial, Verdana; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #424242; font-family: sans-serif, Helvetica, Arial, Verdana; font-size: 14px; line-height: 21px;&quot;&gt;did the trick.&lt;/span&gt;&lt;/div&gt;
</description><link>http://maniezhilan.blogspot.com/2012/10/install-gettext-on-mac.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-459599611128554058</guid><pubDate>Fri, 31 Aug 2012 01:18:00 +0000</pubDate><atom:updated>2012-08-30T20:20:00.182-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">console mode</category><category domain="http://www.blogger.com/atom/ns#">headless</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>Start Red Hat Linux - head less / without gnome</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Edit the file /etc/inittab&lt;br /&gt;
&lt;br /&gt;
and&amp;nbsp;set&amp;nbsp;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;id:3:initdefault:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;a href=&quot;http://www.itworld.com/operating-systems/103722/unix-how-to-linux-etcinittab-file&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
</description><link>http://maniezhilan.blogspot.com/2012/08/start-red-hat-linux-head-less-without.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-3651067732478793864</guid><pubDate>Mon, 12 Apr 2010 13:42:00 +0000</pubDate><atom:updated>2010-04-12T08:42:45.782-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">bugzilla admin password lostrd</category><title>How to reset admin user in Bugzilla</title><description>I lost the admin password for bugzilla, but i had a test user with no admin privileges.&lt;br /&gt;
Following query enabled me to set the test user into admin. Run these queries in bugzilla&#39;s mysql DB. &lt;br /&gt;
&lt;br /&gt;
1. SELECT @myusr := userid FROM profiles WHERE login_name=&quot;your email here&quot;; &lt;br /&gt;
2. SELECT @admin := id FROM groups WHERE name=&quot;admin&quot;; &lt;br /&gt;
3. INSERT INTO user_group_map (user_id,group_id,isbless,grant_type) VALUES &lt;br /&gt;
(@myusr,@admin,0,0);</description><link>http://maniezhilan.blogspot.com/2010/04/how-to-reset-admin-user-in-bugzilla.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-9036381142684583898</guid><pubDate>Sat, 16 Jan 2010 17:56:00 +0000</pubDate><atom:updated>2010-01-17T09:39:06.659-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Skype in Ubuntu 9.10</title><description>1.Download and install Skype from &lt;a href=&quot;http://www.skype.com/intl/en/download/skype/linux/choose/&quot;&gt; their website&lt;/a&gt;. I downloaded skype-ubuntu-intrepid_2.1.0.47-1_i386.deb for my 32 bit ubuntu 9.10&lt;br /&gt;
&lt;br /&gt;
2.Run  sudo dpkg -i skype-ubuntu-intrepid_2.1.0.47-1_i386.deb command on terminal&lt;br /&gt;
&lt;br /&gt;
3.If skype had no video , like mine did. Go Right click on the Ubuntu symbol on the left hand side of the screen. Select Internet then Skype , edit the command as follows.&lt;br /&gt;
env LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so skype. &lt;br /&gt;
While launching if it complains about missing lib32, change it to &lt;br /&gt;
env LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to launch the skype from menu Applications -&gt; Internet -&gt; Skype and do video chat.</description><link>http://maniezhilan.blogspot.com/2010/01/skype-in-ubuntu-910.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-5246352079147483217</guid><pubDate>Tue, 12 Jan 2010 10:26:00 +0000</pubDate><atom:updated>2010-01-12T04:26:03.115-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">appengine grails</category><title>Grails Based Deals (affiliate) Website on AppEngine</title><description>When i am not working i spend most of the time looking for good deals on tech stuffs. I was wondering how this business model works. Quick search got me Linkshare and Commission junction.&lt;br /&gt;
I thought of creating such an website myself. Since i already have my website running on appengine with grails, setting up such an website was just an breeze, i used the Data feeds from affiliates. I used the rome to read the RSS feeds. Voila &lt;a href=&quot;http://deals.maniezhilan.org&quot;&gt;Deals website&lt;/a&gt; is born in no time.</description><link>http://maniezhilan.blogspot.com/2010/01/grails-based-deals-affiliate-website-on.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-5852555819594028470</guid><pubDate>Sun, 15 Nov 2009 04:44:00 +0000</pubDate><atom:updated>2010-01-13T18:26:30.184-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Ubuntu 9.10 - Five things i did after install</title><description>Installed Karmic Koala on my AMD64, the things i noticed from my previous installation are nvidia drivers are available, its lightning fast (boot up time) and software response time, more nice wallpapers, sound worked after enabling it going to System/preferences/sound/hardware tab&lt;br /&gt;
and clicking on my Sound blaster X-Fi and selecting the profile as Analog Surround 5.1 output , also go to the output and select your device.&lt;br /&gt;
&lt;br /&gt;
1.Enabled sound as mentioned above.(People with NVidia, do not upgrade ubuntu through synaptic ,it breaks without warning ).&lt;br /&gt;
&lt;br /&gt;
2.Installed Gnome-do through synaptic (can&#39;t work without gnome-do for linux and quicksilver for mac).&lt;br /&gt;
&lt;br /&gt;
3.Enabled Micro-blogging plugin from the gnome-do preferences (make sure you select all  plugins) for twitter.&lt;br /&gt;
&lt;br /&gt;
4.Installed screen sudo apt-get install screen , ubuntu byobu is too good for people who want to multitask with command lines.&lt;br /&gt;
&lt;br /&gt;
5.Installed chrome browser aka crossover chromium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;hr&quot;&gt;&lt;hr /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href=&quot;http://click.linksynergy.com/fs-bin/click?id=RcoVQU7h/OY&amp;amp;offerid=141510.10000014&amp;amp;type=4&amp;amp;subid=0&quot;&gt;&lt;img border=0 alt=&quot;Banner 468x60&quot; src=&quot;http://images.compusa.com/adserve/compusa_default_468x60.gif&quot;&gt;&lt;/a&gt;&lt;img border=0 width=1 height=1 alt=banner src=&quot;http://ad.linksynergy.com/fs-bin/show?id=RcoVQU7h/OY&amp;amp;bids=141510.10000014&amp;type=4&amp;amp;subid=0&quot;&gt;</description><link>http://maniezhilan.blogspot.com/2009/11/ubuntu-910-five-things-i-did-after.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-6704858884681378445</guid><pubDate>Wed, 03 Jun 2009 13:01:00 +0000</pubDate><atom:updated>2012-09-03T21:11:38.014-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam Chat (gmail like chat) Example with SMACK API</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
For one of my projects i wanted to develop an simple chat application , something like gmail chat.&lt;br /&gt;
The things i should consider before start were , the existing technology the project is developed (with Seam framework and richfaces) , also it should be reusable across different websites ( hence ability to handle huge volume of traffic). Richfaces &amp;lt;a4j:poll&amp;gt; is the easy and simple way of building an asynchronous chat (i will blog about this later). But the draw back is it has to keep polling the database tables for chat related data (performance bottleneck) and no DBA wants to store in the DB people&#39;s howdy &#39;s and LOL&#39;s.&lt;br /&gt;
&lt;br /&gt;
Earlier in our company we had Openfire installed for developers to communicate among themselves inside NetBeans IDE .  So i thought of giving a try on setup like that, which led me into SMACK API.  After some googling i hit upon an &lt;a href=&quot;http://today.java.net/pub/a/today/2006/10/05/instant-messaging-for-jabber-with-smack.html&quot;&gt;excellent article&lt;/a&gt;  in java.net by &lt;a href=&quot;http://today.java.net/pub/au/431&quot;&gt;John Ferguson Smart&lt;/a&gt; which helped me a lot in  understanding about the SMACK API.&lt;br /&gt;
&lt;br /&gt;
I dont want to explain here about SMACK API, but i will explain how i integrated it with Seam and richfaces.&lt;br /&gt;
&lt;br /&gt;
1. Created an Seam Action Class as follows , for brevity omitting getters and setters&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;@Scope(ScopeType.SESSION)
@Name(&quot;chataction&quot;)
public class ChatAction{

private static XMPPConnection connection = null;
private String tomessage;
private String frommessage;
private List&lt;string&gt; conversationList=new ArrayList&lt;string&gt;();
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Wrote an method as follows to get the XMPPConnection.&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;private static  XMPPConnection getConnection(){
if(connection == null) {
connection = new XMPPConnection(&quot;gmail.com&quot;);
try{
connection.connect();
connection.login(&quot;websiteuserlogin@gmail.com&quot;,&quot;password&quot;);
}catch(XMPPException xmppe){
xmppe.printStackTrace();
}
}
return connection;
}

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
3. Check for the Contacts /Chat users availability.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public boolean chatAvailability(){
Roster roster = getConnection().getRoster();
Presence presence = roster.getPresence(&quot;websitechatadmin@gmail.com&quot;);
if (presence.getType() == Presence.Type.available) {
return true;
}
return false;
}

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
4. Start Chat method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public void startChat(){

try{
XMPPConnection connection =  getConnection();
ChatManager chatmanager = connection.getChatManager();
Chat chat = chatmanager.createChat(websitechatadmin@gmail.com, null);
Message msgObj = new Message(to, Message.Type.chat);
conversationList.add(&quot;&lt;b&gt; me :&lt;/b&gt; &quot;+getTomessage());
msgObj.setBody(getTomessage());
chat.sendMessage(msgObj);
setTomessage(&quot;&quot;);

// Accept only messages from
PacketFilter filter
= new AndFilter(new PacketTypeFilter(Message.class),
new FromContainsFilter(to));

// Collect these messages
PacketCollector collector = connection.createPacketCollector(filter);

Packet packet = collector.pollResult();

PacketListener myListener = new PacketListener() {
public void processPacket(Packet packet) {
if (packet instanceof Message) {
Message msg = (Message) packet;
if(msg!=null &amp;amp;&amp;amp; !conversationList.contains(&quot;&lt;b&gt;website chat admin:&lt;/b&gt; &quot;+msg.getBody())){
// Process message by adding to conversationList
conversationList.add(&quot;&lt;b&gt;website chat admin:&lt;/b&gt; &quot;+msg.getBody());
}
}
}
};
// Register the listener.
connection.addPacketListener(myListener, filter);
}catch (Exception e) {
e.printStackTrace();
}

}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
5. Stop chat method.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;public void stopChat(){

if(connection!=null){
connection.disconnect();
}
if(conversationList!=null){
conversationList.clear();
}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
6. Create chat.xhtml , i used &amp;lt;a4j:poll&amp;gt; to keep polling the server for message replies and updating the chat window on the browser.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;!DOCTYPE composition PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;ui:composition xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
xmlns:s=&quot;http://jboss.com/products/seam/taglib&quot;
xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
xmlns:a4j=&quot;http://richfaces.org/a4j&quot;
xmlns:rich=&quot;http://richfaces.org/rich&quot;&amp;gt;

&amp;lt;ui:define name=&quot;body&quot;&amp;gt;
&amp;lt;a4j:region&amp;gt;
&amp;lt;h:form&amp;gt;
&amp;lt;a4j:poll id=&quot;poll&quot; interval=&quot;1000&quot;  reRender=&quot;chatwindow,chat&quot;/&amp;gt;
&amp;lt;/h:form&amp;gt;
&amp;lt;/a4j:region&amp;gt;

&amp;lt;a4j:form&amp;gt;
&amp;lt;a4j:outputPanel id=&quot;chatwindow&quot;&amp;gt;

&amp;lt;h:outputText  value=&quot;User  is unavailable try again later.....&quot; rendered=&quot;#{!chataction.chatAvailability()}&quot;/&amp;gt;
&amp;lt;ui:repeat value=&quot;#{chataction.conversationList}&quot; var=&quot;frommesg&quot;&amp;gt;
&amp;lt;h:outputText value=&quot;#{frommesg}&quot; escape=&quot;false&quot; /&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/br&amp;gt;
&amp;lt;/ui:repeat&amp;gt;

&amp;lt;/a4j:outputPanel&amp;gt;

&amp;lt;/a4j:form&amp;gt;
&amp;lt;a4j:form&amp;gt;

&amp;lt;h:inputText id=&quot;txtbox&quot; value=&quot;#{chataction.tomessage}&quot; /&amp;gt;
&amp;lt;br&amp;gt;&amp;lt;/br&amp;gt;

&amp;lt;a4j:commandButton id=&quot;chat&quot; value=&quot;Chat&quot;  action=&quot;#{chataction.startChat()}&quot;  reRender=&quot;chatwindow,txtbox&quot;/&amp;gt;
&amp;lt;/a4j:form&amp;gt;

&amp;lt;/ui:define&amp;gt;
&amp;lt;/ui:composition&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
maven project source code can be downloaded from &lt;a href=&quot;http://maniezhilan.googlepages.com/seamchat.zip&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://click.linksynergy.com/fs-bin/click?id=RcoVQU7h/OY&amp;amp;offerid=141510.10000014&amp;amp;type=4&amp;amp;subid=0&quot;&gt;&lt;img border=0 alt=&quot;Banner 468x60&quot; src=&quot;http://images.compusa.com/adserve/compusa_default_468x60.gif&quot;&gt;&lt;/a&gt;&lt;img border=0 width=1 height=1 alt=banner src=&quot;http://ad.linksynergy.com/fs-bin/show?id=RcoVQU7h/OY&amp;amp;bids=141510.10000014&amp;type=4&amp;amp;subid=0&quot;&gt;</description><link>http://maniezhilan.blogspot.com/2009/06/seam-chat-gmail-like-chat-example-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-225860578317143280</guid><pubDate>Sun, 26 Apr 2009 17:25:00 +0000</pubDate><atom:updated>2012-09-02T00:52:08.363-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Upgraded to Ubuntu Jaunty Jackalope from Interpid</title><description>Wow !!!, thats my initial reaction to the jaunty. The reason being i have used ubuntu from Gutsy, hardy and interpid. All the above release had some glitches with my crazy architecture (AMD64 running on VMWare Server on vista home basic , partition on my external hard disk plugged through an USB port).&lt;br /&gt;
&lt;br /&gt;
The upgrade was easy , but this time it was slow may be too many users downloading it.&lt;br /&gt;
&lt;br /&gt;
I always had trouble with flash player on AMD64, but in jaunty it works like an charm. Oh hoo ..youtube for my wife on Ubuntu.&lt;br /&gt;
&lt;br /&gt;
Visual Effects never used to work for my Nvidia , but with jaunty i get custom visual effects.&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;The booting is lightning fast.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;Lot of themes to choose from , i chose the Dust, its awesome.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><link>http://maniezhilan.blogspot.com/2009/04/upgraded-to-ubuntu-jaunty-jackalope.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-331979121855130776</guid><pubDate>Sun, 26 Apr 2009 15:47:00 +0000</pubDate><atom:updated>2010-01-13T21:29:27.572-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">appengine</category><title>My Experiments with Google App Engine</title><description>The moment i saw on dzone about the google appengine for java, i applied for an early bird account and i was promptly given an account in 24 hours. Its an coincidence or something my home ubuntu linux hosting my &lt;a href=&quot;http://maniezhilan.org&quot;&gt;website&lt;/a&gt; was not able to be accessed , may be my port 80 was blocked by my ISP. Anyways i thought let me try to host my website on google appengine. I was able to host my &lt;a href=&quot;http://maniezhilan.appspot.com&quot;&gt;website&lt;/a&gt; in couple of hours without any glitch.&lt;br /&gt;
&lt;br /&gt;
The things i liked about the appengine are,&lt;br /&gt;
1. The eclipse plugin.&lt;br /&gt;
2. Jetty Server&lt;br /&gt;
3. The GWT plugin (good reason to learn GWT)&lt;br /&gt;
4. Ease of deployment to the cloud.&lt;br /&gt;
5. Gives avid java professional&#39;s like me to use java based website instead of my previous drupal CMS based on php.&lt;br /&gt;
6. I saw one post on dzone about someone&#39;s stint of seam on appengine (going to be my next task)&lt;br /&gt;
7. Use of google infrastructure api&#39;s like Users authentication (in my website i use it for comments section), other things i get on appengine are my own domain email id ex. mani@maniezhilan.org (for which i had difficulties when tried postfix mailserver from my home ubuntu mainly due to my dynamic ip shooting emails...spammer mani).&lt;br /&gt;
8. I can use either JDO or JPA as persistence mechanism. My favorite is JPA.&lt;br /&gt;
9. It supports lot of different languages (including my mother tongue Tamil).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://click.linksynergy.com/fs-bin/click?id=RcoVQU7h/OY&amp;amp;offerid=141510.10000014&amp;amp;type=4&amp;amp;subid=0&quot;&gt;&lt;img border=0 alt=&quot;Banner 468x60&quot; src=&quot;http://images.compusa.com/adserve/compusa_default_468x60.gif&quot;&gt;&lt;/a&gt;&lt;img border=0 width=1 height=1 alt=banner src=&quot;http://ad.linksynergy.com/fs-bin/show?id=RcoVQU7h/OY&amp;amp;bids=141510.10000014&amp;type=4&amp;amp;subid=0&quot;&gt;</description><link>http://maniezhilan.blogspot.com/2009/04/my-experiments-with-google-app-engine.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-8652011074625108564</guid><pubDate>Fri, 13 Feb 2009 19:48:00 +0000</pubDate><atom:updated>2012-09-01T20:11:12.532-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hibernate</category><title>oracle major version error</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
I got the below error message when i use JPA with oracle 11g.&lt;br /&gt;
&lt;br /&gt;
javax.persistence.PersistenceException: org.hibernate.HibernateException: unknown Oracle major version [11]&lt;br /&gt;
&lt;br /&gt;
The fix for the error is add&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;
&amp;lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.Oracle10gDialect&quot;/&amp;gt&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
in your persistence.xml&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Updated:&lt;/b&gt;
Thanks to &lt;b&gt;Saranga&lt;/b&gt; and &lt;b&gt;Ben&lt;/b&gt;
&lt;/br&gt;
Before:
&lt;pre class=&#39;brush:xml&#39;&gt;
&lt;bean id=&quot;entityManagerFactory&quot; class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot; &gt;
&lt;property name=&quot;persistenceUnitName&quot; value=&quot;JPA&quot;/&gt;
&lt;property name=&quot;persistenceXmlLocation&quot; value=&quot;classpath:persistence.xml&quot; /&gt;

&lt;property name=&quot;jpaVendorAdapter&quot;&gt;
&lt;bean class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;&gt;
&lt;property name=&quot;showSql&quot; value=&quot;false&quot; /&gt;
&lt;/bean&gt;
&lt;/property&gt; 
&lt;/bean&gt; 
&lt;/pre&gt;
After:
&lt;pre class=&#39;brush:xml&#39;&gt;
&lt;bean id=&quot;entityManagerFactory&quot; class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot; &gt;
&lt;property name=&quot;persistenceUnitName&quot; value=&quot;JPA&quot;/&gt;
&lt;property name=&quot;persistenceXmlLocation&quot; value=&quot;classpath:persistence.xml&quot; /&gt;

&lt;property name=&quot;jpaVendorAdapter&quot;&gt;
&lt;bean class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;&gt;
&lt;property name=&quot;showSql&quot; value=&quot;false&quot; /&gt;
&lt;property name=&quot;databasePlatform&quot; value=&quot;org.hibernate.dialect.Oracle10gDialect&quot; /&gt;
&lt;/bean&gt;
&lt;/property&gt; 
&lt;/bean&gt;
&lt;/pre&gt;</description><link>http://maniezhilan.blogspot.com/2009/02/oracle-major-version-error.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-9195089545715598785</guid><pubDate>Thu, 05 Feb 2009 15:59:00 +0000</pubDate><atom:updated>2012-09-02T00:44:59.227-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">spring security</category><title>Custom authentication - Active Directory credentials using spring security 2.0</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
Last week IncorrectResultSizeDataAccessException showed up during login process of  one of our application, which uses spring security authentication approach(discussed earlier in this &lt;a href=&quot;http://maniezhilan.blogspot.com/2008/10/spring-security-204-with-active.html&quot;&gt;blog posting&lt;/a&gt;) .&lt;br /&gt;
The error is result of more than one sAMAccountName returned by active directory.&lt;br /&gt;
This is possible because of the same sAMAccountName present in different domain.&lt;br /&gt;
&lt;br /&gt;
For example hsimpson is unique sAMAccountName under domain SALES , sAMAccountName by hsimpson can also be under different domain called IT. In this case, when one of these hsimpson login , &quot;yoink&quot; the IncorrectResultSizeDataAccessException shows up.&lt;br /&gt;
&lt;br /&gt;
Easy solution to this problem is,  make the user login with domainName\sAMAccountName (example SALES\hsimpson or IT\hsimpson).&lt;br /&gt;
&lt;br /&gt;
In order to make the above mentioned work, i have to write a custom LdapAuthenticationProvider class , thanks to this &lt;a href=&quot;http://stackoverflow.com/questions/84680/how-do-you-authenticate-against-an-active-directory-server-using-spring-security&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The modifications i did from this &lt;a href=&quot;http://stackoverflow.com/questions/84680/how-do-you-authenticate-against-an-active-directory-server-using-spring-security&quot;&gt;post&lt;/a&gt;  are ,&lt;br /&gt;
&lt;br /&gt;
Step 1.&lt;br /&gt;
I removed the &amp;lt;property name=&quot;principalPrefix&quot; value=&quot;SALES\&quot; /&amp;gt;  from applicationContext-security.xml. Since i want both hsimpson from SALES and IT able to login. If i had the above it defaults to domain &quot;SALES&quot; and no need of adding SALES\ while logging in.&lt;br /&gt;
Step 2.&lt;br /&gt;
Since my use case allows both  hsimpson from SALES and IT able to login as SALES\hsimpson or IT\hsimpson, i had to tweak the  LdapAuthenticatorImpl class using string tokenizer as shown below&lt;br /&gt;
&lt;pre class=&#39;brush:java&#39;&gt;public class LdapAuthenticatorImpl implements LdapAuthenticator {

private DefaultSpringSecurityContextSource contextFactory;
private String principalPrefix = &quot;&quot;;

public DirContextOperations authenticate(Authentication authentication) {

// Grab the username and password out of the authentication object.
StringTokenizer st = new StringTokenizer(authentication.getName(),&quot;\\&quot;);
while(st.hasMoreTokens()){

principalPrefix = st.nextToken();

}
String principal = authentication.getName();
String password = &quot;&quot;;
if (authentication.getCredentials() != null) {
password = authentication.getCredentials().toString();
}

// If we have a valid username and password, try to authenticate.
if (!(&quot;&quot;.equals(principal.trim())) &amp;amp;&amp;amp; !(&quot;&quot;.equals(password.trim()))) {
InitialLdapContext ldapContext = (InitialLdapContext) contextFactory
.getReadWriteContext(principal, password);

// We need to pass the context back out, so that the auth provider can add it to the
// Authentication object.
DirContextOperations authAdapter = new DirContextAdapter();
authAdapter.addAttributeValue(&quot;ldapContext&quot;, ldapContext);

return authAdapter;
} else {
throw new BadCredentialsException(&quot;Blank username and/or password!&quot;);
}
}
&lt;/pre&gt;&lt;br /&gt;
Sample custom login page&lt;br /&gt;
&lt;pre class=&#39;brush:html&#39;&gt;&lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&gt;

&lt;form action=&quot;${pageContext.request.contextPath}/customloginAD/j_spring_security_check&quot; method=&quot;post&quot;&gt;&lt;table width=&quot;400px&quot; cellspacing=&quot;5&quot; cellpadding=&quot;5&quot; style=&quot;padding:1em; background-color:#EEEEEE; border:silver;border-width:.2em; border-style:solid;&quot;&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;center&quot;&gt;&lt;b&gt;Please Login To The System&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;             &lt;td align=&quot;right&quot;&gt;UserID:&lt;/td&gt;             &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;j_username&quot; size=&quot;15&quot;/&gt;&lt;/td&gt;         &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;             &lt;td align=&quot;right&quot;&gt;Password:&lt;/td&gt;             &lt;td&gt;&lt;input type=&quot;password&quot; name=&quot;j_password&quot; size=&quot;15&quot;/&gt;&lt;/td&gt;         &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;             &lt;td colspan=&quot;2&quot;&gt;&lt;center&gt;&lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt;&lt;/center&gt;&lt;/td&gt;         &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/form&gt;&lt;/pre&gt;&lt;br /&gt;
maven project source code can be downloaded &lt;a href=&quot;http://maniezhilan.googlepages.com/customloginAD.zip&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In my next post i will explain about single-sign-on using JOSSO with LDAP&lt;br /&gt;
&lt;br /&gt;
</description><link>http://maniezhilan.blogspot.com/2009/02/custom-authentication-using-spring.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-6428471993162494251</guid><pubDate>Thu, 05 Feb 2009 15:53:00 +0000</pubDate><atom:updated>2012-09-01T20:03:45.671-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>ManagedConnectionFactory is null with seam-gen</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
I got the below error &lt;br /&gt;
&lt;br /&gt;
&quot;You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.&quot;&lt;br /&gt;
&lt;br /&gt;
whenever the i save something on my IDE and hot deployment is done.&lt;br /&gt;
&lt;br /&gt;
The fix for the above error is change overwrite=&quot;true&quot; to overwrite=&quot;false&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt; 
&amp;lt;target name=&quot;datasource&quot;&amp;gt;&lt;br /&gt;
&amp;lt;fail unless=&quot;jboss.home&quot;&amp;gt;jboss.home not set&amp;lt;/fail&amp;gt;&lt;br /&gt;
&amp;lt;copy file=&quot;${basedir}/resources/${project.name}-${profile}-ds.xml&quot;&lt;br /&gt;
tofile=&quot;${deploy.dir}/${project.name}-ds.xml&quot;&lt;br /&gt;
overwrite=&quot;false&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
as shown above in your build.xml file.&lt;br /&gt;
&lt;br /&gt;</description><link>http://maniezhilan.blogspot.com/2009/02/managedconnectionfactory-is-null-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-3273867060751105594</guid><pubDate>Sun, 30 Nov 2008 03:49:00 +0000</pubDate><atom:updated>2012-09-01T19:39:28.943-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam Framework - ManyToMany relationship in JPA using join table example</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
In my recent project i have to create a user who can be assigned multiple roles. The class structure looks as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCHNSwbq6ehfSuR81hoTPneRhu37uxnZLxGwdxcPoKQeyIyErtQTV4X5uliP0Be5R_XycJZlCYk9putdc0EQ26p2Af-Bx2HeaJI7N-XwHgx4IzrSntuyEi42Jte_yL88ytyxdWsAeV-Oo/s1600-h/manytomany.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 391px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCHNSwbq6ehfSuR81hoTPneRhu37uxnZLxGwdxcPoKQeyIyErtQTV4X5uliP0Be5R_XycJZlCYk9putdc0EQ26p2Af-Bx2HeaJI7N-XwHgx4IzrSntuyEi42Jte_yL88ytyxdWsAeV-Oo/s400/manytomany.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5274488997739089138&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In my UserAccount class the @ManyToMany relationship looks like as follows,&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;@ManyToMany
@JoinTable(name=&quot;USER_ROLE&quot;,
joinColumns=@JoinColumn(name=&quot;USER_NAME&quot;,referencedColumnName=&quot;USER_NAME&quot;),
inverseJoinColumns=@JoinColumn(name=&quot;SITE_ROLE_ID&quot;,referencedColumnName=&quot;ID&quot;))
private List&lt;siterole&gt; userRoles=new Vector(); 
public UserAccount() {
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
In SiteRole class the @ManyToMany relationship looks like as follows,&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;@ManyToMany
@JoinTable(name=&quot;USER_ROLE&quot;,
joinColumns=@JoinColumn(name=&quot;SITE_ROLE_ID&quot;,referencedColumnName=&quot;ID&quot;),
inverseJoinColumns=@JoinColumn(name=&quot;USER_NAME&quot;,referencedColumnName=&quot;USER_NAME&quot;))
private List&lt;useraccount&gt; users =new Vector();
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
In the UserRole (mapped to join table) attributes are as follows,&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;@EmbeddedId
protected UserRolePK userRolePK;

@JoinColumn(name = &quot;SITE_ROLE_ID&quot;, referencedColumnName = &quot;ID&quot;, insertable = false, updatable = false)
@ManyToOne
private SiteRole siteRole;
@JoinColumn(name = &quot;USER_NAME&quot;, referencedColumnName = &quot;USER_NAME&quot;, insertable = false, updatable = false)
@ManyToOne
private UserAccount userAccount;
&lt;/pre&gt;&lt;br /&gt;
The UserRolePK class attributes are as follows&lt;br /&gt;
&lt;pre class=&quot;brush:java&quot;&gt;@Embeddable
public class UserRolePK implements Serializable {
@Column(name = &quot;SITE_ROLE_ID&quot;, nullable = false)
private long siteRoleId;
@Column(name = &quot;USER_NAME&quot;)
private String userName;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The UserRolePK class is needed as the UserRole table has composite key ( remember ?? the ejb days writing the PKClass).&lt;br /&gt;
&lt;br /&gt;
Hmm..the title goes like Seam Framework ...., what seam has anything to do with this?&lt;br /&gt;
&lt;br /&gt;
Well seam makes the user creation with multiple roles easy using seam tags like &lt;span style=&quot;font-weight:bold;&quot;&gt;selectManyCheckboxes&lt;/span&gt;  as explained &lt;a href=&quot;http://maniezhilan.blogspot.com/2008/11/seam-framework-cheat-sheets-3.html&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Moreover &lt;span style=&quot;font-weight:bold;&quot;&gt;jpaidentitystore&lt;/span&gt; in seam framework helps in declaring the user-class and role-class inside of components class as explained &lt;a href=&quot;  http://docs.jboss.com/seam/latest/reference/en-US/html/security.html#d0e8839&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
</description><link>http://maniezhilan.blogspot.com/2008/11/seam-framework-manytomany-relationship.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCHNSwbq6ehfSuR81hoTPneRhu37uxnZLxGwdxcPoKQeyIyErtQTV4X5uliP0Be5R_XycJZlCYk9putdc0EQ26p2Af-Bx2HeaJI7N-XwHgx4IzrSntuyEi42Jte_yL88ytyxdWsAeV-Oo/s72-c/manytomany.jpg" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-4668313119452394421</guid><pubDate>Sun, 30 Nov 2008 02:55:00 +0000</pubDate><atom:updated>2012-09-01T19:51:27.085-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam framework Cheat Sheets 3. selectManyCheckbox example</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Example usage of selectManyCheckBox&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In this example i want to create selectManyCheckbox in order to assign a user with multiple roles. The example code is as follows  &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;h:selectManyCheckbox id=&quot;groups&quot; value=&quot;#{userAccount.userRoles}&quot; layout=&quot;pageDirection&quot;&amp;gt;
&amp;lt;s:selectItems value=&quot;#{rolesListing.roles}&quot; var=&quot;role&quot; label=&quot;#{role.roleName}&quot;/&amp;gt;
&amp;lt;s:convertEntity/&amp;gt;
&amp;lt;/h:selectManyCheckbox&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
In the above example &quot;userAccount.userRoles&quot; is the form value (users associated roles) and the rolesListing.roles is bunch of roleids and rolename from  entity named SiteRole.&lt;br /&gt;
&lt;br /&gt;
The helper class RolesListing is as follows &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:java&quot;&gt;@Name(&quot;rolesListing&quot;)
@Scope(ScopeType.APPLICATION)
public class RolesListing {

@In(create=true)  
EntityManager entityManager;
@Out
private List&lt;siterole&gt; roles;

@Factory(&quot;roles&quot;)
public List&lt;siterole&gt; getRoles(){
roles=  entityManager.createNamedQuery(&quot;SiteRole.findRoles&quot;).getResultList();
return roles;
}

public void setRoles(List&lt;siterole&gt; roles){
this.roles = roles;
}

}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Important things to make sure, this seam tag work are&lt;/span&gt;&lt;br /&gt;
a)Make sure the #{userAccount.userRoles} and #{rolesListing.roles} are of same type for example i made both of them as List. If they are different type, you will encounter &quot;Conversion Error setting value&quot;.&lt;br /&gt;
&lt;br /&gt;
b)Make sure the &amp;lt;s:convertEntity/&amp;gt; tag is applied at the right location as shown in the example.&lt;br /&gt;
&lt;br /&gt;
c)In my &lt;a href=&quot;http://maniezhilan.blogspot.com/2008/11/seam-framework-manytomany-relationship.html&quot;&gt;next post&lt;/a&gt; i will explain the @ManyToMany relationship between userAccount entity and Roles entity using a USER_ROLE join table.&lt;br /&gt;
&lt;br /&gt;
</description><link>http://maniezhilan.blogspot.com/2008/11/seam-framework-cheat-sheets-3.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>12</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-5483233818156786081</guid><pubDate>Sun, 30 Nov 2008 00:46:00 +0000</pubDate><atom:updated>2012-09-01T19:52:15.249-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam framework Cheat Sheets 2. SelectOneMenu example</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Example usage of SelectOneMenu &lt;/span&gt;&lt;br /&gt;
In this example i want to use selectOneMenu to select a country from list of countries and save the country code for the user in USER_ACCOUNT table. &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:html&quot;&gt;&amp;lt;h:selectOneMenu id=&quot;country&quot; value=&quot;#{userForm.countryCode}&quot; require=&quot;true&quot;&amp;gt;
&amp;lt;s:selectItems value=&quot;#{countries.list}&quot; var=&quot;country&quot; label=&quot;#{country.countryName}&quot;/&amp;gt;
&amp;lt;s:convertEntity/&amp;gt;
&amp;lt;/h:selectOneMenu&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
In the above code &quot;userForm.countryCode&quot; refers to model &quot;UserForm&quot; with property countryCode,  &lt;br /&gt;
&lt;br /&gt;
The helper class to load countries list is as follows , the scope is application as the countries and their code doesn&#39;t change.  &lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:java&quot;&gt;@Name(&quot;countries&quot;)
@Scope(ScopeType.APPLICATION)
public class CountriesList {
@Out
private List&lt;country&gt; list;
@In(create=true)  
EntityManager entityManager;

@Factory(&quot;countriesList&quot;)
public List&lt;country&gt; getList() {

Query query=entityManager.createNamedQuery(&quot;Country.findAll&quot;);
list=query.getResultList();

return list;
}

public void setCountriesList(List&lt;country&gt; list) {
this.list = list;
}

}

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Entity class Country is as follows,&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:java&quot;&gt;@Entity
@Name(&quot;country&quot;)
@Table(name = &quot;COUNTRY&quot;)
@NamedQueries({@NamedQuery(name = &quot;Country.findAll&quot;, query = &quot;SELECT c FROM Country c ORDER BY c.countryName&quot;), @NamedQuery(name = &quot;Country.findByCountryCode&quot;, query = &quot;SELECT c FROM Country c WHERE c.countryCode = :countryCode&quot;), @NamedQuery(name = &quot;Country.findByCountryName&quot;, query = &quot;SELECT c FROM Country c WHERE c.countryName = :countryName&quot;)})
public class Country extends Model implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = &quot;COUNTRY_CODE&quot;, nullable = false)
private String countryCode;
@Column(name = &quot;COUNTRY_NAME&quot;, nullable = false)
private String countryName;

public Country() {
}

public Country(String countryCode) {
this.countryCode = countryCode;
}

public Country(String countryCode, String countryName) {
this.countryCode = countryCode;
this.countryName = countryName;
}

public String getCountryCode() {
return countryCode;
}

public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}

public String getCountryName() {
return countryName;
}

public void setCountryName(String countryName) {
this.countryName = countryName;
}
}

&lt;/pre&gt;</description><link>http://maniezhilan.blogspot.com/2008/11/seam-framework-cheat-sheets-2.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-3533474477481790079</guid><pubDate>Sat, 29 Nov 2008 23:51:00 +0000</pubDate><atom:updated>2012-09-01T19:53:42.143-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam framework Cheat Sheets 1. Hibernate persistence provider / JPA</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;

I recently started using seam framework for my new project. I thought of documenting my learning experience here, which may be of help for newbie&#39;s to seam like me.&lt;br /&gt;
I used seam version 2.1.0.SP1 with Jboss-4.2.2.GA.&lt;br /&gt;
&lt;br /&gt;
I preferred to use JPA and Hibernate as persistence provider , no EJB 3.0. My components.xml file looks like as follows. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Seam with just hibernate / JPA no entity beans components.xml file.&lt;/span&gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;transaction:entity-transaction entity-manager=&quot;#{entityManager}&quot;/&amp;gt;
&amp;lt;persistence:entity-manager-factory name=&quot;entityManagerFactory&quot; persistence-unit-name=&quot;seamDS&quot;/&amp;gt;  
&amp;lt;persistence:managed-persistence-context name=&quot;entityManager&quot; entity-manager-factory=&quot;#{entityManagerFactory}&quot;/&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The entityManager can be injected as follows&lt;br /&gt;
@In    private EntityManager entityManager;&lt;br /&gt;
&lt;br /&gt;
The persistence.xml looks like as follows.&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;persistence version=&quot;1.0&quot; xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;&amp;gt;
&amp;lt;persistence-unit name=&quot;seamDS&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&amp;gt;
&amp;lt;provider&amp;gt;org.hibernate.ejb.HibernatePersistence&amp;lt;/provider&amp;gt;
&amp;lt;class&amp;gt;com.mani.seam.examples.model.SiteRole&amp;lt;/class&amp;gt;
&amp;lt;class&amp;gt;com.mani.seam.examples.model.UserAccount&amp;lt;/class&amp;gt;
&amp;lt;class&amp;gt;com.mani.seam.examples.model.UserRole&amp;lt;/class&amp;gt;
&amp;lt;properties&amp;gt;
&amp;lt;property name=&quot;hibernate.connection.driver_class&quot; value=&quot;oracle.jdbc.OracleDriver&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernate.connection.username&quot; value=&quot;SCOTT&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernate.connection.password&quot; value=&quot;TIGER&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernate.connection.url&quot; value=&quot;jdbc:oracle:thin:@192.168.1.102:1521:ORCL&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.Oracle10gDialect&quot; /&amp;gt;
&amp;lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot;/&amp;gt;
&amp;lt;/properties&amp;gt;
&amp;lt;/persistence-unit&amp;gt;
&amp;lt;/persistence&amp;gt;
&lt;/pre&gt;</description><link>http://maniezhilan.blogspot.com/2008/11/seam-framework-cheat-sheets-1-hibernate.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-3006117510464850570</guid><pubDate>Thu, 16 Oct 2008 13:08:00 +0000</pubDate><atom:updated>2012-09-01T19:43:35.303-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">spring security</category><title>Spring Security 2.0.4 with Active Directory Example</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
Here i will explain how to authenticate and authorize users against Windows Active directory using the latest spring security version 2.0.4. The Spring security LDAP samples helped me making this work.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;1.&lt;/span&gt; I used maven to build this , the contents of my pom.xml are as follows, &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&amp;gt;
&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
&amp;lt;groupId&amp;gt;com.mani&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;loginAD&amp;lt;/artifactId&amp;gt;
&amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;
&amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;
&amp;lt;name&amp;gt;loginAD Maven Webapp&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://maven.apache.org&amp;lt;/url&amp;gt;
&amp;lt;dependencies&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.springframework.security&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;spring-security-core&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.5.0-SNAPSHOT&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;spring-web&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0.8&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;spring-jdbc&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0.8&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;spring-aop&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0.8&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.slf4j&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;slf4j-log4j12&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.4.3&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.springframework.ldap&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;spring-ldap&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.2.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;!-- Log4J --&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;log4j&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;log4j&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.2.14&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;/dependencies&amp;gt;
&amp;lt;build&amp;gt;
&amp;lt;finalName&amp;gt;loginAD&amp;lt;/finalName&amp;gt;
&amp;lt;/build&amp;gt;
&amp;lt;/project&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;2.&lt;/span&gt; The web.xml of my application is as follows. &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;

&amp;lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot; version=&quot;2.4&quot;&amp;gt;

&amp;lt;display-name&amp;gt;Active Directory Based Login Application&amp;lt;/display-name&amp;gt;

&amp;lt;!--
- Location of the XML file that defines the root application context
- Applied by ContextLoaderListener.
--&amp;gt;
&amp;lt;context-param&amp;gt;
&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;
&amp;lt;param-value&amp;gt;
/WEB-INF/applicationContext-security.xml
&amp;lt;/param-value&amp;gt;
&amp;lt;/context-param&amp;gt;

&amp;lt;filter&amp;gt;
&amp;lt;filter-name&amp;gt;springSecurityFilterChain&amp;lt;/filter-name&amp;gt;
&amp;lt;filter-class&amp;gt;org.springframework.web.filter.DelegatingFilterProxy&amp;lt;/filter-class&amp;gt;
&amp;lt;/filter&amp;gt;

&amp;lt;filter-mapping&amp;gt;
&amp;lt;filter-name&amp;gt;springSecurityFilterChain&amp;lt;/filter-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/filter-mapping&amp;gt;

&amp;lt;!--
- Loads the root application context of this web app at startup.
- The application context is then available via
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
--&amp;gt;
&amp;lt;listener&amp;gt;
&amp;lt;listener-class&amp;gt;org.springframework.web.context.ContextLoaderListener&amp;lt;/listener-class&amp;gt;
&amp;lt;/listener&amp;gt;

&amp;lt;!--
- Publishes events for session creation and destruction through the application
- context. Optional unless concurrent session control is being used.
--&amp;gt;
&amp;lt;listener&amp;gt;
&amp;lt;listener-class&amp;gt;org.springframework.security.ui.session.HttpSessionEventPublisher&amp;lt;/listener-class&amp;gt;
&amp;lt;/listener&amp;gt;

&amp;lt;/web-app&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;3.&lt;/span&gt; The last but not the least applicationContext-security.xml. I used the sAMAccountName which is my login id. Moreover i used the port 3268 to look for the entire AD. You can use the port 389 instead too(based on your AD search). &lt;br /&gt;
&lt;br /&gt;
The things configured in this xml file are ,  &lt;br /&gt;
a) Login to the AD with UserDn /passoword to get the LDAPCONTEXT and then search for the user based on the sAMAccountName in the LDAPCONTEXT. When the user is found, populate his authorities. &lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
xmlns:s=&quot;http://www.springframework.org/schema/security&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd&quot;&amp;gt;
&amp;lt;s:http&amp;gt;
&amp;lt;s:intercept-url pattern=&quot;/secure/extreme/**&quot; access=&quot;ROLE_eCommunications&quot;/&amp;gt;
&amp;lt;s:intercept-url pattern=&quot;/secure/**&quot; access=&quot;IS_AUTHENTICATED_REMEMBERED&quot;/&amp;gt;
&amp;lt;s:intercept-url pattern=&quot;/**&quot; access=&quot;IS_AUTHENTICATED_ANONYMOUSLY&quot;/&amp;gt;
&amp;lt;s:form-login/&amp;gt;
&amp;lt;s:anonymous/&amp;gt;
&amp;lt;s:logout/&amp;gt;
&amp;lt;/s:http&amp;gt;


&amp;lt;bean id=&quot;contextSource&quot; class=&quot;org.springframework.security.ldap.DefaultSpringSecurityContextSource&quot;&amp;gt;
&amp;lt;constructor-arg value=&quot;ldap://server.url.goes.here:3268/DC=example,DC=com?sAMAccountName?sub?(objectClass=*)&quot;/&amp;gt;
&amp;lt;property name=&quot;userDn&quot; value=&quot;username&quot;/&amp;gt;
&amp;lt;property name=&quot;password&quot; value=&quot;password&quot;/&amp;gt;

&amp;lt;/bean&amp;gt;

&amp;lt;bean id=&quot;secondLdapProvider&quot; class=&quot;org.springframework.security.providers.ldap.LdapAuthenticationProvider&quot;&amp;gt;
&amp;lt;s:custom-authentication-provider /&amp;gt;
&amp;lt;constructor-arg&amp;gt;
&amp;lt;bean class=&quot;org.springframework.security.providers.ldap.authenticator.BindAuthenticator&quot;&amp;gt;
&amp;lt;constructor-arg ref=&quot;contextSource&quot;/&amp;gt;
&amp;lt;property name=&quot;userSearch&quot;&amp;gt;
&amp;lt;bean id=&quot;userSearch&quot; class=&quot;org.springframework.security.ldap.search.FilterBasedLdapUserSearch&quot;&amp;gt;
&amp;lt;constructor-arg index=&quot;0&quot; value=&quot;&quot;/&amp;gt;
&amp;lt;constructor-arg index=&quot;1&quot; value=&quot;(&amp;amp;(sAMAccountName={0})(objectclass=user))&quot;/&amp;gt;
&amp;lt;constructor-arg index=&quot;2&quot; ref=&quot;contextSource&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;    
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;/constructor-arg&amp;gt;
&amp;lt;constructor-arg&amp;gt; 
&amp;lt;bean class=&quot;org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator&quot;&amp;gt;
&amp;lt;constructor-arg ref=&quot;contextSource&quot; /&amp;gt;
&amp;lt;constructor-arg value=&quot;&quot; /&amp;gt;
&amp;lt;property name=&quot;rolePrefix&quot; value=&quot;ROLE_&quot;/&amp;gt;
&amp;lt;property name=&quot;searchSubtree&quot; value=&quot;true&quot;/&amp;gt;
&amp;lt;property name=&quot;convertToUpperCase&quot; value=&quot;false&quot;/&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;/constructor-arg&amp;gt;

&amp;lt;/bean&amp;gt;
&amp;lt;/beans&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;4.&lt;/span&gt; My index.jsp under my webapp is as follows. &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:html&quot;&gt;&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;Home Page&lt;/h1&gt;&lt;p&gt;Anyone can view this page.&lt;/p&gt;&lt;p&gt;Your principal object is....: &lt;%= request.getUserPrincipal() %&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;secure/index.jsp&quot;&gt;Secure page&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;secure/extreme/index.jsp&quot;&gt;Extremely secure page&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;5.&lt;/span&gt;Under webapp/secure index.jsp is as follows &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:html&quot;&gt;&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;Secure Page&lt;/h1&gt;This is a protected page. You can get to me if you&#39;ve been remembered,
or if you&#39;ve authenticated this session.



&lt;%if (request.isUserInRole(&quot;ROLE_SUPERVISOR&quot;)) { %&gt;
You are a supervisor! You can therefore see the &lt;a href=&quot;extreme/index.jsp&quot;&gt;extremely secure page&lt;/a&gt;.


&lt;% } %&gt;


&lt;p&gt;&lt;a href=&quot;../&quot;&gt;Home&lt;/a&gt;
&lt;p&gt;&lt;a href=&quot;../j_spring_security_logout&quot;&gt;Logout&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;6.&lt;/span&gt; Under secure/extreme/index.jsp its as follows &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:html&quot;&gt;&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;VERY Secure Page&lt;/h1&gt;This is a protected page. You can only see me if you belong to SUPERVISOR

&lt;p&gt;&lt;a href=&quot;../../&quot;&gt;Home&lt;/a&gt;
&lt;p&gt;&lt;a href=&quot;../../j_spring_security_logout&quot;&gt;Logout&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;7.&lt;/span&gt; Deploy on tomcat and access using url http://localhost:8080/loginAD &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Soon i will post a &lt;a href=&quot;http://maniezhilan.blogspot.com/2009/02/custom-authentication-using-spring.html&quot;&gt;blog&lt;/a&gt; about customizing the spring security authentication provider for authentication against Active directory using domain name / username as login &lt;br /&gt;
&lt;br /&gt;
</description><link>http://maniezhilan.blogspot.com/2008/10/spring-security-204-with-active.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>25</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-6669993901988374608</guid><pubDate>Sun, 21 Sep 2008 13:17:00 +0000</pubDate><atom:updated>2012-09-01T20:01:48.920-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">jersey restful</category><title>Jersey Restful JPA toplink example using Maven and netbeans6.1</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
In this example i  will explain with screen shots how to create jersey based restful applications using maven. The biggest issue i had doing this was finding the right jars. When i am done with finding the right dependencies ,it was a breeze from there on.&lt;br /&gt;
I could have done the whole thing with the netbeans6.1 wizard for restful webservices , but it was too much of magic for me , so thought of going step by step myself for better understanding of the jersey and restful.&lt;br /&gt;
&lt;br /&gt;
I used netbeans6.1, JPA with toplink and mysql as my database.&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;
Step 1&lt;/span&gt;. Create a Maven project with netbeans(Make sure you the maven plugin is installed in netbeans). &lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBGIfgT0ESno-u2f4_XNi0yVWoItpXHsXf4M2Kw0UbmEdLLaQ5245hIcFJVdVUCVpYgBihXCjUYY7ydQbEYkVtZ7WOUKAJSxdo3R-bJsXPAbKLW3SmpWA0GHZOC3yOAlSacOoAI_gs6A/s1600-h/Jersey1.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBGIfgT0ESno-u2f4_XNi0yVWoItpXHsXf4M2Kw0UbmEdLLaQ5245hIcFJVdVUCVpYgBihXCjUYY7ydQbEYkVtZ7WOUKAJSxdo3R-bJsXPAbKLW3SmpWA0GHZOC3yOAlSacOoAI_gs6A/s400/Jersey1.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248480880997678850&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 2.&lt;/span&gt; Select the Maven Webapp Archetype&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYAK2JmS7dfWhtCMYh8KXd_GHxe6S86IOHYbsJF-y2p1mpWZXElE3C8W7aHlnyMpEkQSlqWMqfy26QCgzbfgcAi9-5bs-qxG6IE7f_DfgL32lpVDnjLZ7iSGYYGLDXNW-ZkR24CQm36Ro/s1600-h/Jersey2.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYAK2JmS7dfWhtCMYh8KXd_GHxe6S86IOHYbsJF-y2p1mpWZXElE3C8W7aHlnyMpEkQSlqWMqfy26QCgzbfgcAi9-5bs-qxG6IE7f_DfgL32lpVDnjLZ7iSGYYGLDXNW-ZkR24CQm36Ro/s400/Jersey2.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248482975268944658&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 3.&lt;/span&gt; Name your project (i named it as restMaven)&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRjg7ziw0tDgXe_cfhe-3LmmAiVGcIghr4rdTygjHpLjdkjkxJJhAuIxehrN9B64ZiYHn3KWI5m4LFkmYmaMivxfz0loTeil2xGyLuWMIGp1-MPzMnnNoxKoUsaO5Zm7AGQR59Waynkj0/s1600-h/Jersey3.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRjg7ziw0tDgXe_cfhe-3LmmAiVGcIghr4rdTygjHpLjdkjkxJJhAuIxehrN9B64ZiYHn3KWI5m4LFkmYmaMivxfz0loTeil2xGyLuWMIGp1-MPzMnnNoxKoUsaO5Zm7AGQR59Waynkj0/s400/Jersey3.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248483639507769010&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 4.&lt;/span&gt; Click Finish and then open pom.xml from the project files folder, edit the pom.xml by adding the dependencies as shown.&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&amp;gt;
&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
&amp;lt;groupId&amp;gt;com.mani&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;restMaven&amp;lt;/artifactId&amp;gt;
&amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;
&amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;
&amp;lt;name&amp;gt;restMaven Maven Webapp&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://maven.apache.org&amp;lt;/url&amp;gt;
&amp;lt;dependencies&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;jersey&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;jersey&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;0.5-ea&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;javax.xml.bind&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;jaxb-api&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;com.sun.xml.bind&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;jaxb-impl&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0.3&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;javax.annotation&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;jsr250-api&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;javax.persistence&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;persistence-api&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.0.2&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;javax.servlet&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;servlet-api&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;asm&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;asm&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;3.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;toplink.essentials&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;toplink-essentials-agent&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0-36&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;toplink.essentials&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;toplink-essentials&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0-36&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;/dependencies&amp;gt;
&amp;lt;repositories&amp;gt;
&amp;lt;repository&amp;gt;
&amp;lt;id&amp;gt;javamaven2&amp;lt;/id&amp;gt;
&amp;lt;name&amp;gt;Repository for Maven2&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://download.java.net/maven/2/&amp;lt;/url&amp;gt;
&amp;lt;/repository&amp;gt;
&amp;lt;repository&amp;gt;
&amp;lt;id&amp;gt;toplink&amp;lt;/id&amp;gt;
&amp;lt;name&amp;gt;Repository for library Library[toplink]&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://download.java.net/maven/1&amp;lt;/url&amp;gt;
&amp;lt;layout&amp;gt;legacy&amp;lt;/layout&amp;gt;
&amp;lt;/repository&amp;gt;
&amp;lt;/repositories&amp;gt;
&amp;lt;build&amp;gt;
&amp;lt;finalName&amp;gt;restMaven&amp;lt;/finalName&amp;gt;
&amp;lt;plugins&amp;gt;
&amp;lt;plugin&amp;gt;
&amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.0.2&amp;lt;/version&amp;gt;
&amp;lt;configuration&amp;gt;
&amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;
&amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;
&amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;
&amp;lt;/plugins&amp;gt;
&amp;lt;/build&amp;gt;
&amp;lt;/project&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 5.&lt;/span&gt; Right click on project and do clean and build , maven will download and build will be successful.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 6.&lt;/span&gt; Edit the web.xml as follows , the servlet adaptor from previous release is removed and you no longer need to register your resource classes. The only thing you have to make sure is , mention the right package where your resource classes are (i put them under package called service).&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE web-app PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot; &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&amp;gt;
&amp;lt;web-app&amp;gt;
&amp;lt;servlet&amp;gt;
&amp;lt;servlet-name&amp;gt;Jersey&amp;lt;/servlet-name&amp;gt;
&amp;lt;servlet-class&amp;gt;com.sun.ws.rest.spi.container.servlet.ServletContainer&amp;lt;/servlet-class&amp;gt;
&amp;lt;init-param&amp;gt;
&amp;lt;param-name&amp;gt;com.sun.ws.rest.config.property.resourceConfigClass&amp;lt;/param-name&amp;gt;
&amp;lt;param-value&amp;gt;com.sun.ws.rest.api.core.PackagesResourceConfig&amp;lt;/param-value&amp;gt;
&amp;lt;/init-param&amp;gt;
&amp;lt;init-param&amp;gt;
&amp;lt;param-name&amp;gt;com.sun.ws.rest.config.property.packages&amp;lt;/param-name&amp;gt;
&amp;lt;param-value&amp;gt;service&amp;lt;/param-value&amp;gt;
&amp;lt;/init-param&amp;gt;
&amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
&amp;lt;servlet-name&amp;gt;Jersey&amp;lt;/servlet-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt;
&amp;lt;/web-app&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 7.&lt;/span&gt;Create Persistence unit for accessing the db.&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtA8RymjAhINXJvcWTHOnaXKYQny0DAx_PCjvxv3L8uZOKyeFdrA96XSq2vmllOQHFsgSrf-XUWpN0RZctEOIhmmlXgQhPA2ajIemCSehgcy-AQxBi5qFgw_TMPJpOPS4uGSY2mA2HX-k/s1600-h/Jersey7.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtA8RymjAhINXJvcWTHOnaXKYQny0DAx_PCjvxv3L8uZOKyeFdrA96XSq2vmllOQHFsgSrf-XUWpN0RZctEOIhmmlXgQhPA2ajIemCSehgcy-AQxBi5qFgw_TMPJpOPS4uGSY2mA2HX-k/s400/Jersey7.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248488874508066562&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;
Step 8.&lt;/span&gt; Leave the default toplink persistence library, give the db connection , i used mysql, also make sure u placed the mysql jdbc jar under server lib in tomcat.&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWaZxu9K6vX-QwAmH_7cKbTEFOwdc6xjeH7KOS6qZnQpr_eiejNQkE9cAlhk7I5mW0E9eeRihMyZMn9RNYV7B-QLOfHblZkeQb252J0OmMVKzJJ6DKYvVeoYqGiNHY6cbjq1eeHEB33uQ/s1600-h/Jersey8.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWaZxu9K6vX-QwAmH_7cKbTEFOwdc6xjeH7KOS6qZnQpr_eiejNQkE9cAlhk7I5mW0E9eeRihMyZMn9RNYV7B-QLOfHblZkeQb252J0OmMVKzJJ6DKYvVeoYqGiNHY6cbjq1eeHEB33uQ/s400/Jersey8.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248489534102871474&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;
Step 9.&lt;/span&gt; Create Entity Classes from Database as shown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD0Mwvi3LQ-IpIcOz1kPj_Cizhq0oNidgzrRaBqdLS9Y17Mn_wvkvkovr8iuBzzeQd5xkAgXPXuDlWN9SeIK4WxAHobYGA9QgjVsth_u3Q7Eoa6-zyjIku1XKu18EFpC8TwUYT568WRIg/s1600-h/Jersey9.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD0Mwvi3LQ-IpIcOz1kPj_Cizhq0oNidgzrRaBqdLS9Y17Mn_wvkvkovr8iuBzzeQd5xkAgXPXuDlWN9SeIK4WxAHobYGA9QgjVsth_u3Q7Eoa6-zyjIku1XKu18EFpC8TwUYT568WRIg/s400/Jersey9.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248490675814167874&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8hWAXJyfjTWME0rK_2XO-PhQwlOCx-rhRz3MbleTAqa68zo8eDUDNXTvMledPoF5Bgq6vjmmPKUc6gGYw63c9ppNo8hSzRn_tS3mR_eyWd1tDBPgvT7-rGr6xkp0fc4BiH5T2wQKzSZY/s1600-h/Jersey10.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8hWAXJyfjTWME0rK_2XO-PhQwlOCx-rhRz3MbleTAqa68zo8eDUDNXTvMledPoF5Bgq6vjmmPKUc6gGYw63c9ppNo8hSzRn_tS3mR_eyWd1tDBPgvT7-rGr6xkp0fc4BiH5T2wQKzSZY/s400/Jersey10.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248490345925809410&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1UUr_1plGlr1FVFoY01QE_ogCEWqrC430UG3tmcesannP7XfVCpX6mJLGzazDzU-LwVunsLLZW2oUcZYGCkXQTLNaeaU6vs2N4l6hyphenhyphenOyEhjSmCLBJbh-liOWXxJYo92z74RRWP4lEMwg/s1600-h/Jersey11.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1UUr_1plGlr1FVFoY01QE_ogCEWqrC430UG3tmcesannP7XfVCpX6mJLGzazDzU-LwVunsLLZW2oUcZYGCkXQTLNaeaU6vs2N4l6hyphenhyphenOyEhjSmCLBJbh-liOWXxJYo92z74RRWP4lEMwg/s400/Jersey11.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248491018841771266&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 10.&lt;/span&gt; The generated person entity looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEictXBQhW1vAxmc2ycNOrfplFtR6_pgU825sZykU5Q_5luFIeC8tVA6LYqflqakuhTIEhRtsKMRZHJzlyl1gas8kA-EANLOlcaoItcfG1tajLczVrcIltKoPBsEe0YkyiBTyW2Xxq4bNrU/s1600-h/Jersey13.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEictXBQhW1vAxmc2ycNOrfplFtR6_pgU825sZykU5Q_5luFIeC8tVA6LYqflqakuhTIEhRtsKMRZHJzlyl1gas8kA-EANLOlcaoItcfG1tajLczVrcIltKoPBsEe0YkyiBTyW2Xxq4bNrU/s400/Jersey13.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248491828578731250&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;
Step 11.&lt;/span&gt; Create a new package for your resource class i named it service.&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgo16ftO5xxvv59f-cpQsxYQmwhH4XVwC-e542iDcrOLg7K99grUaRFTvZEugSV6Gz-R0CBHtlirXexQkR-Twr7J9pyr5hTtWCmTewwpRiMlvQwddhPuIbAQuoRjmAWZPA9oblCDrUfMM/s1600-h/Jersey14.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgo16ftO5xxvv59f-cpQsxYQmwhH4XVwC-e542iDcrOLg7K99grUaRFTvZEugSV6Gz-R0CBHtlirXexQkR-Twr7J9pyr5hTtWCmTewwpRiMlvQwddhPuIbAQuoRjmAWZPA9oblCDrUfMM/s400/Jersey14.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248492394216621394&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;
Step 12.&lt;/span&gt; The resource class looks like shown below.&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy4MUj7PC4hyphenhyphenqzn23Po_KPH7pc7lE89NBKIQXXFps6njMhUT51FsdNrs5eKjSCvcs3Iej_2366KBFMfQUppoF463iFcIr3LV3Ep6CpkFclxqkna5yuQuC644RjvXR_aOXld-9vxLR5Ul4/s1600-h/Jersey15.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy4MUj7PC4hyphenhyphenqzn23Po_KPH7pc7lE89NBKIQXXFps6njMhUT51FsdNrs5eKjSCvcs3Iej_2366KBFMfQUppoF463iFcIr3LV3Ep6CpkFclxqkna5yuQuC644RjvXR_aOXld-9vxLR5Ul4/s400/Jersey15.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248492805427680594&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Nothing fancy in the above class, its accessing the persistence unit to retrieve the data from db in the method getTest(). The catch are the annotations the @GET , @ProduceMime(&quot;text/plain&quot;) and @Path(&quot;/person/&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Step 13.&lt;/span&gt; Access the data through the URL (http://localhost:8080/restMaven/person/ ) after clean and build and deploying on the server. Mine looked as below&lt;br /&gt;
&lt;br /&gt;
&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFhLVFNLvw483yUQOyp-828CtozPnNEIX1xJ7gHZ80_rgwWL0kSaxQ8RFuiFu0vfRtKMCmv72vHrdzIxWAKeQam8yLDoyWrEwKNgVoHsHpHIesj6AmgFY9MAPtQ9VTqr_OLfF6uNDdY2w/s1600-h/Jersey16.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFhLVFNLvw483yUQOyp-828CtozPnNEIX1xJ7gHZ80_rgwWL0kSaxQ8RFuiFu0vfRtKMCmv72vHrdzIxWAKeQam8yLDoyWrEwKNgVoHsHpHIesj6AmgFY9MAPtQ9VTqr_OLfF6uNDdY2w/s400/Jersey16.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5248494263418197154&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight:bold;&quot;&gt;Conclusion: &lt;/span&gt; In this example i just sticked to html output maybe in my next post i will try to get the xml output and also may be generating the URIs for accessing the resource as done by the netbeans restful wizard.</description><link>http://maniezhilan.blogspot.com/2008/09/jersey-restful-jpa-toplink-example.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBGIfgT0ESno-u2f4_XNi0yVWoItpXHsXf4M2Kw0UbmEdLLaQ5245hIcFJVdVUCVpYgBihXCjUYY7ydQbEYkVtZ7WOUKAJSxdo3R-bJsXPAbKLW3SmpWA0GHZOC3yOAlSacOoAI_gs6A/s72-c/Jersey1.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-6367985909412168040</guid><pubDate>Sun, 15 Jun 2008 00:26:00 +0000</pubDate><atom:updated>2012-09-02T00:53:38.016-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">subversion</category><title>Subversion apache 2.2.8 LDAP windows active directory</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
I setup subversion by integrating with apache2.2.8. I also used the windows active directory for authentication. I did the following steps on the windows machine.&lt;br /&gt;
1.Downloaded and installed subversion( version 1.5).&lt;br /&gt;
2.Downloaded and installed apache2.2.8&lt;br /&gt;
3.Copy all dll&#39;s and modules from subversion/bin directory to the apache2.2 /modules directory&lt;br /&gt;
4.Load the following modules by editing apache/conf/httpd.conf&lt;br /&gt;
LoadModule dav_module modules/mod_dav.so&lt;br /&gt;
LoadModule dav_svn_module modules/mod_dav_svn.so&lt;br /&gt;
LoadModule ldap_module modules/mod_ldap.so&lt;br /&gt;
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so (note: authnz and not authz as earlier releases of apache)&lt;br /&gt;
5.Restart apache server.(If complains about loading modules check these following platform specific notes else conveniently ignore the following)&lt;br /&gt;
&lt;br /&gt;
6.If all is well create svn repository &lt;br /&gt;
svnadmin create C:\svn\repositories&lt;br /&gt;
7.Edit apache/conf/httpd.conf to add the repository location information and your windows active directory details.&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush:xml&quot;&gt;&amp;lt;Location /svn&amp;gt;
DAV svn
SVNParentPath C:/svn/repositories
# Disables Path Checking
SVNPathAuthz off
# Display available Repos
SVNListParentPath on
Allow from all
SetHandler ldap-status

AuthType Basic
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthName &quot;some meaningful name&quot;

AuthLDAPBindDN &quot;usersgroup@companyname.com&quot;
AuthLDAPBindPassword 
AuthLDAPURL &quot;ldap://companyname.com:3268/DC=companyname,DC=com?  sAMAccountName?   sub?(objectClass=*)&quot;
require valid-user
&amp;lt;/Location&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
8.Save the http.conf and restart the apache.&lt;br /&gt;
9.Access the subversion using the url http://yourmachinename/svn&lt;br /&gt;
10.The browser will prompt for login. Login using your credentials and access the subversion.&lt;br /&gt;
&lt;br /&gt;
If interested in active directory and new spring security 2.0.4 read&lt;br /&gt;
&lt;a href=&#39;http://maniezhilan.blogspot.com/2008/10/spring-security-204-with-active.html&#39;&gt;Spring Security with AD&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Notes: If your login failed check your apache error log file.&lt;br /&gt;
Most common errors you may see are&lt;br /&gt;
1.auth_ldap authenticate: user butters authentication failed; URI /svn/ [LDAP: ldap_simple_bind_s() failed][Invalid Credentials]&lt;br /&gt;
to resolve the above try to talk with your windows active directory administrator and find out about the port info like 389 or 3286 should be used etc...&lt;br /&gt;
2.[ldap_search_ext_s() for user failed][Operations Error]&lt;br /&gt;
this error is good sign your able to connect to win AD but not able to find the user.&lt;br /&gt;
since win AD does not allow anonymous binding make sure you have the correct  AuthLDAPBindDN&lt;br /&gt;
AuthLDAPBindPassword info.</description><link>http://maniezhilan.blogspot.com/2008/06/subversion-apache-228-ldap-windows.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-5232091853893693025</guid><pubDate>Wed, 20 Feb 2008 14:59:00 +0000</pubDate><atom:updated>2012-09-02T00:58:02.570-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ajaxtags</category><title>Ajaxtags autocomplete with struts1.2 spring jpa &amp; hibernate</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;
&lt;a href=&quot;http://technorati.com/tag/ajaxtags&quot; rel=&quot;tag&quot;&gt;&lt;img style=&quot;border:0;vertical-align:middle;margin-left:.4em&quot; src=&quot;http://static.technorati.com/static/img/pub/icon-utag-16x13.png?tag=ajaxtags&quot; alt=&quot; &quot; /&gt;ajaxtags&lt;/a&gt;&lt;br /&gt;
I wanted to use struts2 with weblogic portal 10 for its cool dojo built in, but BEA havent kept pace with struts open source community(only way you can use struts2 in portal ,  is as uri portlet). So i was trying to figure out a way to do things similar to dojo autocomplete , i luckily found in some blogs about AJAXTAGS which uses scriptaculous and prototype javascripts. &lt;br /&gt;
The chosen technologies where Struts1.2 , Spring , JPA , Hibernate ,  ajaxtags  ,  scriptaculous and prototype.&lt;br /&gt;
&lt;br /&gt;
1.Download ajaxtags from &lt;a href=&quot;http://ajaxtags.sourceforge.net/&quot;&gt;http://ajaxtags.sourceforge.net/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2. Add the jars downloaded to web-inf lib and add the following to your web.xml for ajaxtags to work&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;&amp;lt;jsp-config&amp;gt;
&amp;lt;taglib&amp;gt;
&amp;lt;taglib-uri&amp;gt;http://ajaxtags.org/tags/ajax&amp;lt;/taglib-uri&amp;gt;
&amp;lt;taglib-location&amp;gt;/WEB-INF/ajaxtags.tld&amp;lt;/taglib-location&amp;gt;
&amp;lt;/taglib&amp;gt;
&amp;lt;/jsp-config&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
3.Import all the required libraries for spring jpa and struts to work.&lt;br /&gt;
&lt;br /&gt;
4.  Add  these in web.xml&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;&amp;lt;filter&amp;gt;
&amp;lt;filter-name&amp;gt;Spring OpenEntityManagerInViewFilter&amp;lt;/filter-name&amp;gt;
&amp;lt;filter-class&amp;gt;
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
&amp;lt;/filter-class&amp;gt;
&amp;lt;/filter&amp;gt;

&amp;lt;filter-mapping&amp;gt;
&amp;lt;filter-name&amp;gt;Spring OpenEntityManagerInViewFilter&amp;lt;/filter-name&amp;gt;
&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/filter-mapping&amp;gt;
&amp;lt;listener&amp;gt;
&amp;lt;listener-class&amp;gt;
org.springframework.web.context.ContextLoaderListener
&amp;lt;/listener-class&amp;gt;
&amp;lt;/listener&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
5. Add  the bean class  in applicationContext.xml&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;&amp;lt;bean  class=&quot;org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor&quot; /&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
6. Add the entitymanagerfactory in applicationContext.xml&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;&amp;lt;bean id=&quot;entityManagerFactory&quot;
class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot;&amp;gt;
&amp;lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&amp;gt;
&amp;lt;property name=&quot;jpaVendorAdapter&quot;&amp;gt;
&amp;lt;bean
class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;&amp;gt;
&amp;lt;property name=&quot;database&quot; value=&quot;MYSQL&quot; /&amp;gt;
&amp;lt;property name=&quot;showSql&quot; value=&quot;true&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
7. Add the datasource to applicationContext.xml&lt;br /&gt;
&lt;pre class=&#39;brush:xml&#39;&gt;&amp;lt;bean id=&quot;dataSource&quot;
class=&quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot;&amp;gt;
&amp;lt;property name=&quot;driverClassName&quot; value=&quot;com.mysql.jdbc.Driver&quot; /&amp;gt;
&amp;lt;property name=&quot;url&quot; value=&quot;jdbc:mysql://localhost/test&quot; /&amp;gt;
&amp;lt;property name=&quot;username&quot; value=&quot;bobsmith&quot; /&amp;gt;
&amp;lt;property name=&quot;password&quot; value=&quot;bobsmith&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
8.Add the  transactionmanager to  applicationContext.xml&lt;br /&gt;
&lt;pre  class=&#39;brush:xml&#39;&gt;
&amp;lt;bean id=&quot;transactionManager&quot;
class=&quot;org.springframework.orm.jpa.JpaTransactionManager&quot;&amp;gt;
&amp;lt;property name=&quot;entityManagerFactory&quot; ref=&quot;entityManagerFactory&quot; /&amp;gt;
&amp;lt;/bean&amp;gt;

&amp;lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot; /&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
9. Write the  pojo , service and serviceimpl  lets  have a  Users  pojo ,  UsersService and UsersServiceImpl&lt;br /&gt;
&lt;br /&gt;
10.Write the UsersAction class and extend the BaseAjaxAction (SOURCE is included in download code for this tutorial or download the earlier 1.2 version of ajaxtags-src). In the action access user service layer to get list of users and pass it into the method call getXMLContent.&lt;br /&gt;
&lt;br /&gt;
11.Wire your action and service in applicationContext.xml as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre  class=&#39;brush:xml&#39;&gt;&amp;lt;bean name=&quot;/users&quot;
class=&quot;UsersAction&quot;&amp;gt;
&amp;lt;property name=&quot;UsersService&quot;&amp;gt;
&amp;lt;ref bean=&quot;UsersService&quot;/&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
12. Add this in your struts-config.xml&lt;br /&gt;
&lt;pre  class=&#39;brush:xml&#39;&gt;&amp;lt;action-mappings&amp;gt;
&amp;lt;action path=&quot;/users&quot;
type=&quot;org.springframework.web.struts.DelegatingActionProxy&quot;&amp;gt;
&amp;lt;forward name=&quot;success&quot; path=&quot;/username.jsp&quot;&amp;gt;&amp;lt;/forward&amp;gt;
&amp;lt;/action&amp;gt;
&amp;lt;/action-mappings&amp;gt;


&amp;lt;plug-in
className=&quot;org.springframework.web.struts.ContextLoaderPlugIn&quot;&amp;gt;
&amp;lt;set-property property=&quot;contextConfigLocation&quot;
value=&quot;/WEB-INF/applicationContext.xml&quot; /&amp;gt;
&amp;lt;/plug-in&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
13. Write a autocomplete.jsp and use the ajax:autocomplete tag as follows&lt;br /&gt;
&lt;pre  class=&#39;brush:xml&#39;&gt;&amp;lt;ajax:autocomplete
source=&quot;username&quot;
target=&quot;username&quot;
baseUrl=&quot;${contextPath}/users.do&quot;
className=&quot;autocomplete&quot;
indicator=&quot;throbbing&quot;
minimumCharacters=&quot;1&quot;
/&amp;gt;
&lt;/pre&gt;</description><link>http://maniezhilan.blogspot.com/2008/02/ajaxtags-autocomplete-with-struts12.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-6991662560875847419</guid><pubDate>Fri, 15 Feb 2008 14:53:00 +0000</pubDate><atom:updated>2010-01-13T21:33:10.462-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hibernate</category><title>Hibernate org.hibernate.PropertyAccessException</title><description>org.hibernate.PropertyAccessException: could not set a field value by reflection setter&lt;br /&gt;
&lt;br /&gt;
The reason for the exception is ,&lt;br /&gt;
&lt;br /&gt;
i used primitive long datatype   for an database column which can take null, so my primitive long cannot store null value.&lt;br /&gt;
&lt;br /&gt;
Solution&lt;br /&gt;
Changed it to Long .&lt;br /&gt;
&lt;br /&gt;
problem solved.</description><link>http://maniezhilan.blogspot.com/2008/02/hibernate-orghibernatepropertyaccessexc.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-8364927722085615874</guid><pubDate>Fri, 15 Feb 2008 13:42:00 +0000</pubDate><atom:updated>2010-01-13T18:48:54.591-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hibernate</category><title>hibernate antlr.jar with weblogic server</title><description>In weblogic 10 server , if you run hibernate applications you will be annoyed to see this error&lt;br /&gt;
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken&lt;br /&gt;
&lt;br /&gt;
the solution is to tell the server to use the antlr.jar in your lib directory instead of servers antlr.&lt;br /&gt;
You can do it by placing the antlr.jar in classpath.&lt;br /&gt;
&lt;br /&gt;
add this to your startweblogic.cmd  change path to wherever your antlr is&lt;br /&gt;
set PRE_CLASSPATH=C:\bea_portal\user_projects\w4WP_workspaces\poc1.0\poc2.0WAR\WebContent\WEB-INF\lib\antlr-2.7.5H3.jar;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and also add&lt;br /&gt;
&lt;br /&gt;
set CLASSPATH=%PRE_CLASSPATH%;%SAVE_CLASSPATH%&lt;br /&gt;
&lt;br /&gt;
You will be good to go</description><link>http://maniezhilan.blogspot.com/2008/02/hibernate-antlrjar-with-weblogic-server.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-1323719814896266527</guid><pubDate>Fri, 08 Feb 2008 18:39:00 +0000</pubDate><atom:updated>2010-01-13T21:34:28.277-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Install Weblogic Portal 10 on Ubuntu</title><description>I was trying to install the weblogic portal on leopard mac osx  , i was able to start server and create the portal domains , but had no luck on the weblogic workshop IDE. So i thought of ubuntu and did the following to install.&lt;br /&gt;
1. I downloaded the portal1001_linux32.bin from the bea downloads the HPUX version&lt;br /&gt;
2. mkdir bea_portal&lt;br /&gt;
3.cp  portal1001_linux32.bin  to bea_portal&lt;br /&gt;
4.cd into bea_portal&lt;br /&gt;
5.chmod +x portal1001_linux32.bin&lt;br /&gt;
6.run ./portal1001_linux32.bin&lt;br /&gt;
5.cat AUTORUN.inf&lt;br /&gt;
6.run anyone of the  cmd line  eg for gui&lt;br /&gt;
java -mx256 -cp installer.jar com.bea.plateng.wizard.WizardController mode=gui&lt;br /&gt;
7.Installer will guide your from there on.&lt;br /&gt;
&lt;br /&gt;
Workshop can be launched from /home/mani/bea_portal/workshop_10.0/workshop4WP&lt;br /&gt;
&lt;br /&gt;
Trust me its lightning fast on macbook pro and ubuntu.</description><link>http://maniezhilan.blogspot.com/2008/02/install-weblogic-portal-10-on-ubuntu.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-547963460439087265</guid><pubDate>Fri, 08 Feb 2008 18:31:00 +0000</pubDate><atom:updated>2010-01-13T21:33:38.271-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Ubuntu on MacBook Pro</title><description>&lt;a href=&quot;http://technorati.com/tag/ubuntu+macbook+pro&quot; rel=&quot;tag&quot;&gt;&lt;img style=&quot;border:0;vertical-align:middle;margin-left:.4em&quot; src=&quot;http://static.technorati.com/static/img/pub/icon-utag-16x13.png?ubuntu+macbook+pro&quot; alt=&quot; &quot; /&gt;ubuntu macbook pro&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I installed leopard  on my Mac  Book Pro  (which had tiger already)  and installed ubuntu (7.10)  thro bootcamp. This is the fastest ubuntu machine i ever had,(i already have ubuntu on Dell Latitude , Dell Inspiron (one with intel and ther with AMD 64 bit).Most of the keys work fine.&lt;br /&gt;
But when i tried to display through apple cinema 23 inch monitor ,  i dont get the resolution  good enough.</description><link>http://maniezhilan.blogspot.com/2008/02/ubuntu-on-macbook-pro.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5289317672382806955.post-3118859299933617817</guid><pubDate>Tue, 05 Feb 2008 01:25:00 +0000</pubDate><atom:updated>2012-09-01T19:56:38.227-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seam</category><title>Seam example seam-blog using mysql</title><description>&lt;script src=&quot;http://crux-framework-tools.googlecode.com/svn/trunk/misc/highlight/highlightLoader.js&quot;&gt;
type=&#39;text/javascript&#39;
&lt;/script&gt;

Sunday i was watching the super bowl and thought about connecting mysql  database instead of the default HSSQLDB for the blog example  comes with seam. I did the following to  make it work.&lt;br /&gt;
1. Installed mysql and created DB.&lt;br /&gt;
2. For the mysql to work with jboss , downloaded the Connector/J from mysql website and copied the file                         &lt;tt class=&quot;literal&quot;&gt;mysql-connector-java-3.0.15-ga-bin.jar &lt;/tt&gt;to the lib folder under server default.&lt;br /&gt;
3.Jboss server will bitch about the no class def found error &lt;a href=&quot;http://forums.mysql.com/read.php?39,22579,22579#msg-22579&quot;&gt;java.lang.NoClassDefFoundError: org/aspectj/lang/Signature&lt;/a&gt; , to solve this add the aspectrt.jar which is availale in the connector/J download.&lt;br /&gt;
4.Now we have to create datasource for mysql , copy the sample mysql-ds.xml from examples and change it as follows&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;&lt;datasources&gt;
&lt;local-tx-datasource&gt;
&lt;jndi-name&gt;MySqlDS&lt;/jndi-name&gt;
&lt;connection-url&gt;jdbc:mysql://localhost:3306/jboss&lt;/connection-url&gt;
&lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
&lt;user-name&gt;jboss&lt;/user-name&gt;
&lt;password&gt;password&lt;/password&gt;
&lt;/local-tx-datasource&gt;
&lt;/datasources&gt; &lt;/pre&gt;
5. Change the blog-ds.xml under jboss-seam/examples/blog/resource as follows&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;
&lt;datasources&gt;&lt;br /&gt;
&lt;local-tx-datasource&gt;&lt;br /&gt;
&lt;jndi-name&gt;blogDatasource&lt;/jndi-name&gt;&lt;br /&gt;
&lt;connection-url&gt;jdbc:mysql:localhost:3306:jboss&lt;/connection-url&gt;&lt;br /&gt;
&lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;&lt;br /&gt;
&lt;user-name&gt;jboss&lt;/user-name&gt;&lt;br /&gt;
&lt;password&gt;pass&lt;/password&gt;&lt;br /&gt;
&lt;/local-tx-datasource&gt;&lt;br /&gt;
&lt;/datasources&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/pre&gt;
6.Add the jndi name of datasource to the persistence.xml under jboss-seam/examples/blog/resources/META-INF folder&lt;br /&gt;
&lt;pre class=&quot;brush:xml&quot;&gt;
&lt;jta-data-source&gt;java:/MySqlDS&lt;/jta-data-source&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
7.Run ant deploy under jboss-seam/examples/blog/&lt;br /&gt;
&lt;br /&gt;
8. Visit the blog working on seam and mysql&lt;a href=&quot;http://maniezhilan.homelinux.org/seam-blog&quot;&gt; http://maniezhilan.homelinux.org/seam-blog&lt;/a&gt;</description><link>http://maniezhilan.blogspot.com/2008/02/seam-example-seam-blog-using-mysql.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item></channel></rss>