<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Technocrat</title>
	<atom:link href="http://ravishbhupesh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ravishbhupesh.wordpress.com</link>
	<description>Yet Another Software Engineer</description>
	<lastBuildDate>Wed, 29 Dec 2010 17:07:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ravishbhupesh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Technocrat</title>
		<link>http://ravishbhupesh.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ravishbhupesh.wordpress.com/osd.xml" title="The Technocrat" />
	<atom:link rel='hub' href='http://ravishbhupesh.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Method Local Inner Class ! REWORKED!</title>
		<link>http://ravishbhupesh.wordpress.com/2010/12/29/method-local-inner-class-reworked/</link>
		<comments>http://ravishbhupesh.wordpress.com/2010/12/29/method-local-inner-class-reworked/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 17:06:12 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=41</guid>
		<description><![CDATA[Today I got a comment on my blog entry HERE. When I went through my blog again, I was surprised to see that the thing I explained there was not right, probably at that time my understanding was not good enough. So I apologize for providing the wrong information. I will explain it again here [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=41&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I got a comment on my blog entry <strong><a href="http://ravishbhupesh.wordpress.com/2008/06/05/method-local-inner-classes-confusion/">HERE</a>. </strong></p>
<p>When I went through my blog again, I was surprised to see that the thing I explained there was not right, probably at that time my understanding was not good enough. So I apologize for providing the wrong information. I will explain it again here :<br />
Considering the same example : </p>
<p>class MyClass{<br />
    public void showValue(){<br />
    	final int x = 0;<br />
        class MyInnerClass{<br />
            public void showOuterVar(){<br />
               System.out.println(&#8220;Hi I am method local Inner Class&#8221; + x);<br />
            }<br />
        }<br />
    }<br />
}<br />
Now as I explained earlier, the local variables of the method live on the stack, and exist only for the lifetime of the method. As we know that the scope of a local variable is limited to the method the variable is declared in so, When the method ends, the stack frame is blown away and the variable is history. But even after the method completes, the inner class object created within it might still be alive on the heap if, for example, a reference to it was passed into some other code and then stored in an some variable. Because the local variables are not guaranteed to be alive as long as the method-local inner class object, the inner class object can’t use them.<br />
So we mark the local variables as final. When marked final now our class can use it.</p>
<p>Here is the correct reason :<br />
As a part of optimizing the java code, what JAVA Programmers at SUN did, they made the JVM do some WORK, So in this case when this class is compiled there will be two class files (MyClass.class &amp; MyClass$MyInnerClass.class) and the the value of the final variable is stuffed in the inner class i:e: we will have a variable &#8220;val$x&#8221; in the inner class. Compiler does this because it knows that the variable is final so there is no harm in inserting the value as it is, in the class. You probably won&#8217;t be able to see this in your compiler class but it does this way only. The fact can be verified in another way. When you open you class file of the inner class you will see a variable &#8220;this$0&#8243;, this is actually a reference to the outer class, this is the reason that you can access the outer class variables without any reference. So this is it works. I had a lot of discussion among my friend before writing this and we decided on this only. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So if anyone gets to know a better reason, Please do share with us. Thanx. enjoy.</p>
<br />Filed under: <a href='http://ravishbhupesh.wordpress.com/category/java/'>JAVA</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=41&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2010/12/29/method-local-inner-class-reworked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Axis2-SOAP-Header problem</title>
		<link>http://ravishbhupesh.wordpress.com/2009/03/01/axis2-soap-header-problem/</link>
		<comments>http://ravishbhupesh.wordpress.com/2009/03/01/axis2-soap-header-problem/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 10:16:51 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[axis2]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=24</guid>
		<description><![CDATA[Hello everybody again. Currently I am working with web-services, and my current implementation of the project uses Axis2. Few days back I was stuck with a very weird problem. Scenario was like this. I have a Web-Application(WA) which is supposed to call a web-service (WS1) which in turn will forward the request to another web-service [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=24&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello everybody again.<br />
  Currently I am working with web-services, and my current implementation of the project uses Axis2. Few days back I was stuck with a very weird problem. Scenario was like this.<br />
  I have a Web-Application(WA) which is supposed to call a web-service (WS1) which in turn will forward the  request to another web-service (WS2) which in turn will forward the request to final web-service(WS3). I have made a generic stub which is used to call any web-service(And I have disabled the header adding code inside this stub because of project requirement.) So the WA was preparing a document and sending it to the WS1 using the generic stub, Now WS1 does some processing and send it to WS2 using the same generic stub, and WS2 again sends it to WS3 using the same generic stub. Now my requirement was that there should not be any SOAP Header in my requests because if it exists then the document will fail the validation. So the problem was that when the document was reaching WS1 it was not having any header and it passed the validation test but when it reaches the WS2 it failed validation. When I traced the log I found that it was having a SOAP Header.<br />
  It was very weird since the same stub was being used so how cum there were two documents being generated one with header and the other without header.<br />
  After tracing all the logs I didn’t found anything. So finally I used the soap-monitoring tool to see what actually is being transmitted on wires from one WS to the other. Then I came to know, when one WS is sending the document to the other WS it is adding SOAP Header into the document and after a some brain storming I concluded that it does so because by default addressing is enabled at the global level and it is the addressing which was responsible for doing this.<br />
So I disabled the addressing module and it worked. Now the document being passed from one WS to the other WS is not having the SOAP header. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
To disable the addressing module you simply go to axis2.xml file and find this line.</p>
<p>&lt;module ref=&#8221;addressing&#8221;/&gt;</p>
<p>Comment this line and the addressing module is disabled.</p>
<br />Posted in axis2, Web Services  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=24&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2009/03/01/axis2-soap-header-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Axis2 Hibernate Problem</title>
		<link>http://ravishbhupesh.wordpress.com/2009/02/26/axis2-hibernate-problem/</link>
		<comments>http://ravishbhupesh.wordpress.com/2009/02/26/axis2-hibernate-problem/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 06:32:32 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[TECHNICAL]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=19</guid>
		<description><![CDATA[Hi all, So I am back with another problem-&#62;solution, Some days back a guy pinged me up and asked for help with a problem which I found that I also have faced a long time back while in one of my project. The problem is integration of Hibernate with Axis2. Though I myself didn’t solve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=19&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;">Hi all, So I am back with another problem-&gt;solution, Some days back a guy pinged me up and asked for help with a problem which I found that I also have faced a long time back while in one of my project. The problem is integration of Hibernate with Axis2. Though I myself didn’t solve the problem at that time because we have dropped the idea of using hibernate for some other reasons. But this time this guy himself solved the problem (cheers for him) and I am sharing the solution with you all as I also tried my hand on it and it worked.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">I will explain with an example.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">I have to create a web service which will receive 3 parameters from the client and persist them into the database using Hibernate. Not a big task <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . So I created a wsdl, generated the classes using axis2’s “wsdl2java“ command and put my own business logic, created the hibernate configuration and mapping files and simply deployed the aar file with the axis2 which further was deployed as a web application into the JBoss AS . The structure of my application is like this :</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">testService.aar</p>
<p class="MsoNormal" style="margin-left:25.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->data (package)</p>
<p class="MsoNormal" style="margin-left:61.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>o<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->service (package</p>
<p class="MsoNormal" style="margin-left:97.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Wingdings;"><span>§<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->business ( package )</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DataBean.java (class)</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DataBeam.hbm.xml (class mapping file)</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DataBusinessClass.java ( business class)</p>
<p class="MsoNormal" style="margin-left:97.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Wingdings;"><span>§<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->Core (package with generated classes for web service)</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSServiceCallBackHandler.java</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSServiceMessageReciever.java</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSServiceSkeleton.java</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSServiceSkeletonInterface.java</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSServiceStub.java</p>
<p class="MsoNormal" style="margin-left:97.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Wingdings;"><span>§<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->Persistence</p>
<p class="MsoNormal" style="margin-left:133.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:Symbol;"><span>·<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->HibernateUtil.java</p>
<p class="MsoNormal" style="margin-left:25.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->Lib ( libraries used in my application)</p>
<p class="MsoNormal" style="margin-left:25.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->META-INF</p>
<p class="MsoNormal" style="margin-left:61.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>o<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->DSService.wsdl</p>
<p class="MsoNormal" style="margin-left:61.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>o<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->Services.xml</p>
<p class="MsoNormal" style="margin-left:25.5pt;text-align:justify;text-indent:-.25in;"><!--[if !supportLists]--><span style="font-family:&quot;"><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]-->hibernate.cfg.xml</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">And finally I successfully deployed my application. But when I tried to execute it using a client, it gave an error, it didn’t found the hibernate.cfg.xml file. Here was what I saw on the JBoss console</p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:9pt;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,609 INFO<span> </span>[data.service.core.DSServiceSkeleton] Document recieved : &lt;wsdl:dataRequest xmlns:wsdl=&#8221;http://www.example.com/DataService/wsdl&#8221; xmlns:soapenv=&#8221;http://schemas.xmlsoap.org/soap/envelope/&#8221;&gt;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;"><span> </span>&lt;name&gt;bhupesh&lt;/name&gt;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;"><span> </span>&lt;age&gt;25&lt;/age&gt;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;"><span> </span>&lt;sex&gt;male&lt;/sex&gt;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;"><span> </span>&lt;/wsdl:dataRequest&gt;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,656 INFO<span> </span>[data.service.core.DSServiceSkeleton] Values recieved : </span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,656 INFO<span> </span>[data.service.core.DSServiceSkeleton] Name : bhupesh</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,656 INFO<span> </span>[data.service.core.DSServiceSkeleton] Age : 25</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,671 INFO<span> </span>[data.service.core.DSServiceSkeleton] Sex : male</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,671 INFO<span> </span>[data.service.business.DataBusinessClass] insertData() method called&#8230;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,671 INFO<span> </span>[data.service.business.DataBusinessClass] execute() method called&#8230;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,687 INFO<span> </span>[data.service.persistence.HibernateUtil] static block of HibernateUtil class</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,781 INFO<span> </span>[org.hibernate.cfg.Environment] Hibernate 3.2.4.sp1</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,796 INFO<span> </span>[org.hibernate.cfg.Environment] hibernate.properties not found</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,812 INFO<span> </span>[org.hibernate.cfg.Environment] Bytecode provider name : javassist</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:08,812 INFO<span> </span>[org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:09,000 INFO<span> </span>[org.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:09,000 INFO<span> </span>[org.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:09,000 ERROR [org.apache.axis2.transport.http.AxisServlet] java.lang.ExceptionInInitializerError</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">2009-02-26 09:41:09,015 ERROR [org.apache.catalina.core.ContainerBase] Servlet.service() for servlet AxisServlet threw exception</span></p>
<p class="MsoNormal"><span style="font-size:9pt;">java.lang.NullPointerException</span></p>
<p class="MsoNormal"><span style="font-size:9pt;"> </span></p>
<p class="MsoNormal">So I found that it is not able to load the configuration from the hibernate.cfg.xml file.</p>
<p class="MsoNormal">
<p class="MsoNormal">Now this problem is resolved if you put your file configuration file inside the Axis2/WEB-INF folder as the axis2 class loader and also if you have to put the hibernate jars inside Axis2/WEB-INF/lib. But this is not a good solution.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="text-decoration:underline;">Solution to this problem : </span></p>
<p class="MsoNormal"><span style="text-decoration:underline;"><span style="text-decoration:none;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;">Axis2’s service class loader prime use case is service isolation, hot deployment and hot updates. So Axis2 creates a new class loader for every service and carefully manages which jars are available in that class loader. One common problem is that an external project uses a Thread Context class loader to load classes or resources from its environment. (TCCL-Thread Context Class Loader ) instead of trying to use the classloader that the class itself was loaded with. So to facilitate this mechanism you can specify a parameter in your services.xml file as under.( from the wso2 site )</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;"> </span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;"> </span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;"> </span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;color:teal;">&lt;serviceGroup&gt;</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&lt;</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#3f7f7f;">service </span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#7f007f;">name</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">=</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#2a00ff;">&#8220;DSService&#8221;</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&gt;</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;"><span> </span></span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#3f5fbf;">&lt;!&#8211; added for loading libraries files from the lib folder inside aar file &#8211;&gt;</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;"><span> </span></span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&lt;</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#3f7f7f;">parameter </span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#7f007f;">name</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">=</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#2a00ff;">&#8220;ServiceTCCL&#8221;</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&gt;</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">composite</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&lt;/</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#3f7f7f;">parameter</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&gt;</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;"> </span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">. . . .</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">. . . .</span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;">&lt;!&#8211; More configurations as per your service </span><span style="background:white none repeat scroll 0 0;font-size:10pt;font-family:Wingdings;color:black;"><span>à</span></span></p>
<p class="MsoNormal"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:black;"><span> </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&lt;/</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:#3f7f7f;">service</span><span style="background:white none repeat scroll 0 0;font-size:10pt;color:teal;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;color:teal;">&lt;/serviceGroup&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">By doing this libraries inside your aar file will be accessed.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><span style="text-decoration:underline;">Another Problem</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="text-decoration:underline;"><span style="text-decoration:none;"> </span></span></p>
<p class="MsoNormal" style="text-align:justify;">Now class loading problem was solved but still axis2 was not able to find the mapping file.</p>
<p class="MsoNormal" style="text-align:justify;">Since I have explained before that Axis2 has the notion of service isolation where each service/modules gets its own class loader. Using this class loader you can access any resource that you put into your service archive.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;">You can do this as under within your HibernateUtil class.</p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal"><span style="font-size:10pt;">AxisService axisService = MessageContext.getCurrentMessageContext().getAxisService();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;">ClassLoader serviceClassLoader = axisService.getClassLoader();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;">URL configURL = serviceClassLoader.getResource(&#8220;hibernate.cfg.xml&#8221;);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;">sessionFactory = new Configuration().configure(configURL).buildSessionFactory();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;"> </span></p>
<p class="MsoNormal">Work Done <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="MsoNormal">Now When you deploy your application and play with it.</p>
<p class="MsoNormal">My data was successfully persisting into the database.</p>
<p class="MsoNormal"><span style="font-size:10pt;"> </span></p>
<br />Posted in TECHNICAL  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=19&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2009/02/26/axis2-hibernate-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying Entity Bean on JBoss 5</title>
		<link>http://ravishbhupesh.wordpress.com/2008/09/02/deploying-entity-bean-on-jboss-5/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/09/02/deploying-entity-bean-on-jboss-5/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 09:04:58 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[EJB]]></category>
		<category><![CDATA[TECHNICAL]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=11</guid>
		<description><![CDATA[Hello everyone, Now a days I am trying my hands on EJB 3.0. I have been experimenting with EJB 3.0 on JBoss application Server. I went on many forums and found that some of you people are facing problems deploying Entity Beans same as I did in the begining, So i thought of writing on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=11&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">Hello everyone, Now a days I am trying my hands on EJB 3.0. I have been experimenting<br />
with EJB 3.0 on JBoss application Server. I went on many forums and found that some of<br />
you people are facing problems deploying Entity Beans same as I did in the begining,<br />
So i thought of writing on it n giving a working example.<br />
I have gone through &#8220;Enterprise java beans 3.0&#8243; book by oreilly. its a very nice book.<br />
My example is also from the same book.<br />
I will start with the example as you people can go through the definition n all from<br />
the book. Though you can get this code from book too m also writng it so that everything<br />
should be in a rytdhm <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>One more thing you can code entity bean either using annotations or by specifying the<br />
mappings in a mapping file named &#8220;orm.xml&#8221;. I will give an example based on the mapping<br />
file, I you guys want an example using annotations refer to the unlined link. He is my<br />
colleague and a good friend, he has explained clearly about the example and much more<br />
concepts of the entity beans.</p>
<p>http://ranjankumar.com/2008/08/11/ejb3-mapping-persistent-objects/</p>
<p>we will start with code now<br />
This is our customer class : ENTITY BEAN</p>
<p>package com.titan.domain;<br />
import java.io.Serializable;<br />
/**<br />
* @author bhupesh<br />
*<br />
*/<br />
public class Customer implements Serializable {<br />
private int id;<br />
private String firstName;<br />
private String lastName;<br />
public int getId() {<br />
return id;<br />
}<br />
public void setId(int id) {<br />
this.id = id;<br />
}<br />
public String getFirstName() {<br />
return firstName;<br />
}<br />
public void setFirstName(String firstName) {<br />
this.firstName = firstName;<br />
}<br />
public String getLastName() {<br />
return lastName;<br />
}<br />
public void setLastName(String lastName) {<br />
this.lastName = lastName;<br />
}<br />
}</p>
<p>We Will need a session bean which will be responsible for persisting the object into<br />
the database, though the actual work is done by an ENTITY MANAGER<br />
SESSION BEAN :<br />
INTERFACE -<br />
package com.titan.travelagent;<br />
import com.titan.domain.Customer;;<br />
/**<br />
* @author bhupesh<br />
*<br />
*/<br />
public interface TravelAgentRemote {<br />
public void createCustomer(Customer p);<br />
public Customer findCustomer(int id);<br />
}<br />
CLASS-<br />
package com.titan.travelagent;<br />
import javax.ejb.Remote;<br />
import javax.ejb.Stateless;<br />
import javax.persistence.EntityManager;<br />
import javax.persistence.PersistenceContext;<br />
import com.titan.domain.Customer;<br />
/**<br />
* @author bhupesh<br />
*<br />
*/<br />
@Stateless<br />
@Remote(TravelAgentRemote.class)<br />
public class TravelAgentBean {<br />
@PersistenceContext(unitName=&#8221;titan&#8221;)private EntityManager manager;<br />
public void createCustomer(Customer cust){<br />
manager.persist(cust);<br />
}<br />
public Customer findCustomer(int id){<br />
return manager.find(Customer.class, id);<br />
}<br />
}</p>
<p>ORM Mapping file is :<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;orm:entity-mappings version=&#8221;1.0&#8243;<br />
xmlns:orm=&#8221;http://java.sun.com/xml/ns/persistence/orm&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd &#8220;&gt;<br />
&lt;orm:description&gt;ORM file for mapping Customer entity!&lt;/orm:description&gt;<br />
&lt;orm:entity access=&#8221;PROPERTY&#8221; class=&#8221;com.titan.domain.Customer&#8221; name=&#8221;customer&#8221;&gt;<br />
&lt;orm:table name=&#8221;CUSTOMER_INFO&#8221; /&gt;<br />
&lt;orm:attributes&gt;<br />
&lt;orm:id name=&#8221;id&#8221;&gt;<br />
&lt;orm:column name=&#8221;id&#8221; nullable=&#8221;false&#8221; column-definition=&#8221;integer&#8221;/&gt;<br />
&lt;/orm:id&gt;<br />
&lt;orm:basic name=&#8221;firstName&#8221; &gt;<br />
&lt;orm:column length=&#8221;20&#8243; name=&#8221;FIRST_NAME&#8221; nullable=&#8221;false&#8221; /&gt;<br />
&lt;/orm:basic&gt;<br />
&lt;orm:basic name=&#8221;lastName&#8221; &gt;<br />
&lt;orm:column length=&#8221;20&#8243; name=&#8221;LAST_NAME&#8221; nullable=&#8221;false&#8221; /&gt;<br />
&lt;/orm:basic&gt;<br />
&lt;/orm:attributes&gt;<br />
&lt;/orm:entity&gt;<br />
&lt;/orm:entity-mappings&gt;</p>
<p>Now we also need a persistence.xml file which goes into the META-INF directory<br />
here is it :</p>
<p>&lt;persistence:persistence version=&#8221;1.0&#8243;<br />
xmlns:persistence=&#8221;http://java.sun.com/xml/ns/persistence&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/persistence persistence_1_0.xsd &#8220;&gt;<br />
&lt;persistence:persistence-unit name=&#8221;titan&#8221;&gt;<br />
&lt;persistence:description&gt;<br />
Persistence unit name is titan<br />
&lt;/persistence:description&gt;<br />
&lt;persistence:jta-data-source&gt;java:OracleDS&lt;/persistence:jta-data-source&gt;<br />
&lt;persistence:mapping-file&gt;META-INF/orm.xml&lt;/persistence:mapping-file&gt;<br />
&lt;persistence:properties&gt;<br />
&lt;persistence:property name=&#8221;hibernate.hbm2ddl.auto&#8221; value=&#8221;create&#8221; /&gt;<br />
&lt;persistence:property name=&#8221;hibernate.dialect&#8221; value=&#8221;org.hibernate.dialect.Oracle9iDialect&#8221; /&gt;<br />
&lt;/persistence:properties&gt;<br />
&lt;/persistence:persistence-unit&gt;<br />
&lt;/persistence:persistence&gt;</p>
<p>Note one thing<br />
&lt;persistence:mapping-file&gt;META-INF/orm.xml&lt;/persistence:mapping-file&gt;<br />
you have to give like this. Firstly I tried by giving only &#8220;orm.xml&#8221; and when I packaged &amp;<br />
deployed the jar it gave an error stating that the mapping file could not be found.<br />
Then i tried another bad thing, i put this file into the src directory which ultimately came into<br />
the bin folder. When I deployed the jar to my surprise it worked. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Anyway its not a good<br />
programming practice. So i tried giving in the above way META-INF/orm.xml and it worked fine.</p>
<p>JAR Structure<br />
customer.jar<br />
&#8211;com<br />
&#8212;-titan<br />
&#8212;&#8212;domain<br />
&#8212;&#8212;&#8211;Customer.class<br />
&#8212;&#8212;travelagent<br />
&#8212;&#8212;&#8211;TravelAgentRemote.class<br />
&#8212;&#8212;&#8211;TravelAgaentBean.class<br />
&#8211;META-INF<br />
&#8212;-orm.xml<br />
&#8212;-persistence.xml</p>
<p>Thats all about in how to deploy Entity Beans on JBoss 5. Wait for more to come in EJB 3.0<br />
If you still have any queries then feel free to contact me.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=11&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/09/02/deploying-entity-bean-on-jboss-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Method Local inner Classes! Confusion.</title>
		<link>http://ravishbhupesh.wordpress.com/2008/06/05/method-local-inner-classes-confusion/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/06/05/method-local-inner-classes-confusion/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 10:21:09 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Where are final variables stored]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=9</guid>
		<description><![CDATA[Last month when I was preparing for SCJP exam, I came through many new things in Java Language, some things were pretty confusing too. While going through the Inner Classes chapter I came through a problem. As we know we can define a class within a method, likewise : Class MyClass{ private int x; public [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=9&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">Last month when I was preparing for SCJP exam, I came through many new things in Java Language, some things were pretty confusing too. While going through the Inner Classes chapter I came through a problem. As we know we can define a class within a method, likewise : </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"> Class MyClass{</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"><span> </span>private int x;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"><span> </span>public showValue(){</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"> <span> </span>class MyInnerClass{</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"><span> </span><span> </span>System.out.println(“Hi I am method local Inner Class”);</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">}</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;"> A method-local inner class can be instantiated only within the method where the inner class is defined</span><span style="font-family:&quot;"> i:e: no other code running in any other method—inside or outside the outer class—can ever instantiate the method-local inner class. But, </span><span style="font-family:&quot;">the inner class object cannot use the local variables of the method the inner class is in</span><span style="font-family:&quot;">. The local variables of the method live on the stack, and exist only for the lifetime of the method. As we know that the scope of a local variable is limited to the method the variable is declared in. When the method ends, the stack frame is blown away and the variable is history. But even after the method completes, the inner class object created within it might still be alive on the heap if, for example, a reference to it was passed into some other code and then stored in an instance variable. Because the local variables aren&#8217;t guaranteed to be alive as long as the method-local inner class object, the inner class object can&#8217;t use them. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">So we mark the local variables as final. When marked final now our class can use it. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">But How? </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">I didn’t knew where the local final variables are stored. Actually if you go through the specification of the JVM you will come to know that JVM</span><span style="font-size:13pt;font-family:&quot;"> defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are created when a thread is created and destroyed when the thread exits. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">Different areas are : </span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>1.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">The PC Register</span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>2.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">Stack</span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>3.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">Heap</span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>4.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">Method Area</span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>5.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">Runtime Constant Pool</span></p>
<p class="MsoNormal" style="margin-left:36pt;text-align:justify;text-indent:-18pt;"><!--[if !supportLists]--><span style="font-size:13pt;font-family:&quot;"><span>6.<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><!--[endif]--><span style="font-size:13pt;font-family:&quot;">Native Method Stack</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:13pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:13pt;font-family:&quot;">I will not explain each of them here, for this you can refer to the Java virtual Machine Specifications. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:13pt;font-family:&quot;">The point of our discussion is where are final variables stored. They are stored in <strong>Runtime Constant Pool </strong>. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-family:&quot;">A <strong><span>runtime constant pool</span></strong> is a per-class or per-interface runtime representation of the </span><code><span style="font-family:&quot;">constant_pool</span></code><span style="font-family:&quot;"> table in a </span><code><span style="font-family:&quot;">class</span></code><span style="font-family:&quot;"> file. It contains several kinds of constants, ranging from numeric literals known at compile time to method and field references that must be resolved at run time. The runtime constant pool serves a function similar to that of a symbol table for a conventional programming language, although it contains a wider range of data than a typical symbol table. </span></p>
<p style="text-align:justify;"><a name="23189"></a><span style="font-family:&quot;">Each runtime constant pool is allocated from the Java virtual machine&#8217;s method area. The runtime constant pool for a class or interface is constructed when the class or interface is created by the Java virtual machine. <a name="23215"></a>The following exceptional condition is associated with the construction of the runtime constant pool for a class or interface:</span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">When creating a class or      interface, if the construction of the runtime constant pool requires more      memory than can be made available in the method area of the Java virtual      machine, the Java virtual machine throws an </span><code><span style="font-family:&quot;">OutOfMemoryError</span></code><span style="font-family:&quot;">.</span></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=9&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/06/05/method-local-inner-classes-confusion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Accessing SSL enabled Web Services</title>
		<link>http://ravishbhupesh.wordpress.com/2008/06/05/accessing-ssl-enabled-web-services/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/06/05/accessing-ssl-enabled-web-services/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 06:04:34 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=8</guid>
		<description><![CDATA[&#60;!&#8211; @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } &#8211;&#62; This document will guide you in Consuming a Web Service over a HTTPS protocol. I am using AXIS2 for deploying my Web Service and hence here I will present you with an example of making a client for a Web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=8&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&lt;!&#8211; 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	&#8211;&gt;</p>
<p style="margin-bottom:0;">This document will guide you in Consuming a Web Service over a HTTPS protocol.</p>
<p style="margin-bottom:0;">I am using AXIS2 for deploying my Web Service and hence here I will present you with an example of making a client for a Web Service ( Version ) which comes deployed in AXIS2.</p>
<p style="margin-bottom:0;">For security we usually deploy out Web Service over the HTTPS protocol. As you must be knowing HTTPS protocol uses Digital Certificate for the authentication and to ensure that no one else except the the authenticated parties may access/tamper the data.</p>
<p style="margin-bottom:0;">Since in my previous post i:e:  <span style="color:#000080;"><span style="text-decoration:underline;"><a href="../2008/05/06/enabling-ssl-on-jboss-2/">http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/</a></span></span> I described how to enable the JBOSS Application Server.</p>
<p style="margin-bottom:0;">There we created a keystore ( which contains a certificate ).</p>
<p style="margin-bottom:0;">Now we have to export the server certificate so that clients can use it. For exporting the certificate we will write</p>
<p style="margin-bottom:0;">keytool – export -alias &lt;keystore-alias-name&gt; -keystore &lt;keystore-name&gt; -rfc -file &lt;your-cert-name.cer&gt;</p>
<p style="margin-bottom:0;">then it will prompt for the password ( of the keystore ) : give it  and your certificate will be generated by the name.</p>
<p style="margin-bottom:0;">In my case I did :</p>
<p style="margin-bottom:0;">keytool -export -alias nsdg_ssl -keystore nsdg.keystore -rfc -file nsdg_temp.cer</p>
<p style="margin-bottom:0;">and a certificate by name nsdg_temp.cer was generated.</p>
<p style="margin-bottom:0;">If you want to see the certificate you can write at the terminal  :</p>
<p style="margin-bottom:0;">cat you-cert-name.cer</p>
<p style="margin-bottom:0;">If a client has to communicate to a server over SSL, it must have a truststore file.  Below is given the command which will import the certificate to the client truststore :</p>
<p style="margin-bottom:0;">keytool -import -alias &lt;trust-store-name&gt; -file &lt;cert-file-name.cer&gt; -keystore &lt;client-trust-store&gt;</p>
<p style="margin-bottom:0;">FINALLY We will write a JAVA CLIENT which will call a web service.</p>
<p style="margin-bottom:0;">To access a secure website from a web service client you need to set the following properties :</p>
<p style="margin-bottom:0;">javax.net.ssl.trustStore and</p>
<p style="margin-bottom:0;">javax.net.ssl.trustStorePassword</p>
<p style="margin-bottom:0;">The value of javax.net.ssl.trustStore should be the path of your truststore file. You must have already imported the certificate to this truststore from th server to which you are going to communicate.</p>
<p style="margin-bottom:0;">This is how i did :</p>
<p style="margin-bottom:0;">System.setProperty(&#8220;javax.net.ssl.trustStore&#8221;,&#8221;E:\\Workplace\\workspace\\nsdgClientTrustStore&#8221;);</p>
<p style="margin-bottom:0;">System.setProperty(&#8220;javax.net.ssl.trustStorePassword&#8221;, &#8220;rmi+ssl&#8221;);</p>
<p style="margin-bottom:0;">My Client looked like :</p>
<p style="margin-bottom:0;">import javax.xml.namespace.QName;</p>
<p style="margin-bottom:0;">import javax.xml.stream.XMLOutputFactory;</p>
<p style="margin-bottom:0;">import javax.xml.stream.XMLStreamWriter;</p>
<p style="margin-bottom:0;">import org.apache.axiom.om.OMAbstractFactory;</p>
<p style="margin-bottom:0;">import org.apache.axiom.om.OMElement;</p>
<p style="margin-bottom:0;">import org.apache.axiom.om.OMFactory;</p>
<p style="margin-bottom:0;">import org.apache.axiom.om.OMNamespace;</p>
<p style="margin-bottom:0;">import org.apache.axis2.AxisFault;</p>
<p style="margin-bottom:0;">import org.apache.axis2.addressing.EndpointReference;</p>
<p style="margin-bottom:0;">import org.apache.axis2.client.*;</p>
<p style="margin-bottom:0;">/**</p>
<p style="margin-bottom:0;">* @author bhupesh</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">*/</p>
<p style="margin-bottom:0;">public class VersionJavaClient {</p>
<p style="margin-bottom:0;">private EndpointReference targetEPR;</p>
<p style="margin-bottom:0;">private QName operationName = new QName(&#8220;version&#8221;);</p>
<p style="margin-bottom:0;">public static void main(String[] args) throws AxisFault {</p>
<p style="margin-bottom:0;">System.setProperty(&#8220;javax.net.ssl.trustStore&#8221;,</p>
<p style="margin-bottom:0;">&#8220;E:\\Workplace\\workspace\\nsdgClientTrustStore&#8221;);</p>
<p style="margin-bottom:0;">System.setProperty(&#8220;javax.net.ssl.trustStorePassword&#8221;, &#8220;rmi+ssl&#8221;);</p>
<p style="margin-bottom:0;">VersionJavaClient client = new VersionJavaClient();</p>
<p style="margin-bottom:0;">client.getAxisVersion();</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">private void getAxisVersion() throws AxisFault {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;getAxisVersion() STARTS&#8221;);</p>
<p style="margin-bottom:0;">OMElement payload = createRequestMethod();</p>
<p style="margin-bottom:0;">ServiceClient serviceClient = new ServiceClient();</p>
<p style="margin-bottom:0;">Options options = new Options();</p>
<p style="margin-bottom:0;">options.setTo(new EndpointReference(&#8220;https://202.141.151.147:8443/axis2/services/Version&#8221;));</p>
<p style="margin-bottom:0;">options.setAction(&#8220;getVersion&#8221;);</p>
<p style="margin-bottom:0;">serviceClient.setOptions(options);</p>
<p style="margin-bottom:0;">OMElement result = serviceClient.sendReceive(payload);</p>
<p style="margin-bottom:0;">System.out.println(&#8220;getAxisVersion() ENDS&#8221;);</p>
<p style="margin-bottom:0;">if (result != null) {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;RESULT WILL BE DISPLAYED NOW&#8221;);</p>
<p style="margin-bottom:0;">displayResult(result);</p>
<p style="margin-bottom:0;">} else {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;Got Null Result&#8221;);</p>
<p style="margin-bottom:0;">}}</p>
<p style="margin-bottom:0;">private OMElement createRequestMethod() {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;createRequestMethod() :: creating envelope&#8221;);</p>
<p style="margin-bottom:0;">OMFactory fac = OMAbstractFactory.getSOAP11Factory();</p>
<p style="margin-bottom:0;">OMNamespace omNs = fac.createOMNamespace(&#8220;http://localhost/d2&#8243;, &#8220;d2&#8243;);</p>
<p style="margin-bottom:0;">OMElement requestMethod = fac.createOMElement(&#8220;getVersion&#8221;, omNs);</p>
<p style="margin-bottom:0;">OMElement firstElement = fac.createOMElement(&#8220;firstElement&#8221;, null);</p>
<p style="margin-bottom:0;">requestMethod.addChild(firstElement);</p>
<p style="margin-bottom:0;">//System.out.println(requestMethod.getText());</p>
<p style="margin-bottom:0;">System.out.println(&#8220;createRequestMethod() :: request method returned..&#8221;);</p>
<p style="margin-bottom:0;">return requestMethod;</p>
<p style="margin-bottom:0;">}</p>
<p style="margin-bottom:0;">private void displayResult(OMElement result) {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;displayResult() :: STARTS&#8221;);</p>
<p style="margin-bottom:0;">try {</p>
<p style="margin-bottom:0;">XMLStreamWriter writer = XMLOutputFactory.newInstance()</p>
<p style="margin-bottom:0;">.createXMLStreamWriter(System.out);</p>
<p style="margin-bottom:0;">//result.serialize(new OMOutputImpl(writer));</p>
<p style="margin-bottom:0;">result.serialize(writer);</p>
<p style="margin-bottom:0;">System.out.println(&#8220;trying to serialize the result. FLUSHING&#8230;.&#8221;);</p>
<p style="margin-bottom:0;">System.out.println(&#8220;displayResult() :: ENDS&#8221;);</p>
<p style="margin-bottom:0;">writer.flush();</p>
<p style="margin-bottom:0;">} catch (Exception e) {</p>
<p style="margin-bottom:0;">System.out.println(&#8220;got Exception while printing&#8221;);</p>
<p style="margin-bottom:0;">e.printStackTrace();</p>
<p style="margin-bottom:0;">}}}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=8&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/06/05/accessing-ssl-enabled-web-services/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference between SOA and Web Services</title>
		<link>http://ravishbhupesh.wordpress.com/2008/05/07/difference-between-soa-and-web-services/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/05/07/difference-between-soa-and-web-services/#comments</comments>
		<pubDate>Wed, 07 May 2008 10:25:55 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=7</guid>
		<description><![CDATA[SOA and Web Services are two buzzwords in the software industry now a days. Most of the people are confused about, What they are?. And they dnt knw the difference, they take them as synonyms. Well I will try to clear the difference between these two. Before going for the definition of SOA, we should [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=7&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">SOA and Web Services are two buzzwords in the software industry now a days. Most of the people are confused about, What they are?. And they dnt knw the difference, they take them as synonyms. Well I will try to clear the difference between these two.<br />
Before going for the definition of SOA, we should atleast know what actually a service is ?</p>
<p>A Service is a unit of work done by a service provider to achieve desired end results for a service consumer. It represents a publicized package of functionality. </span><span style="font-size:100%;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">Both service provider and service consumer are the roles played by software agents on behalf of their owner.</span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">A service is : </span></p>
<p class="MsoNormal" style="margin-left:90pt;text-align:justify;text-indent:-18pt;font-family:times new roman;"><span style="font-size:100%;">· Composeable</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="margin-left:90pt;text-align:justify;text-indent:-18pt;font-family:times new roman;"><span style="font-size:100%;">· Discoverable</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The actual use of service is often based upon an agreed-upon contract with the provider, including in detail what is provided and what is the quality( availability, cost etc ) of the service.<br />
Definition<br />
SOA is an architectural style whose goal is to achieve loose coupling among interacting software agents.<br />
Or<br />
SOA is a specific architectural style that is concerned with loose coupling and dynamic binding between services.<br />
A very good example of SOA, which I went through in one of the tutorial on <a href="http://webservices.xml.com/">http://webservices.xml.com</a> is :<br />
Take a CD for instance. If you want to play it, you put your CD into a CD player and the player plays it for you. The CD player offers a CD playing service. Which is nice because you can replace one CD player with another. You can play the same CD on a portable player or on your expensive stereo. They both offer the same CD playing service, but the quality of service is different.<br />
The idea of SOA departs significantly from that of object oriented programming, which strongly suggests that you should bind data and its processing together. So, in object oriented programming style, every CD would come with its own player and they are not supposed to be separated. This sounds odd, but it&#8217;s the way we have built many software systems.</span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">On the other hand, Web Services is an approach to realizing a SOA.</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="doctext" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The World Wide Web Consortium (W3C), which has managed the evolution of the SOAP and WSDL specifications, defines Web services as follows:<br />
A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with XML serialization in conjunction with other Web-related standards.</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">Inspite of explaining each and every concept I will just present the architecture diagrams of the two</p>
<p>SOA :</span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;"><br />
</span><span style="font-size:100%;"> </span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">Web Services is the base for implementing SOA and the Service bus is the centerpiece of this implementation. So here is the architecture of the Service bus.</span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;"><a href="http://bp0.blogger.com/_XBd24IJ243E/SBxUaVod6BI/AAAAAAAABWk/v1xmdPlgbYw/s1600-h/soa_stack.bmp"><img style="cursor:pointer;" src="http://bp0.blogger.com/_XBd24IJ243E/SBxUaVod6BI/AAAAAAAABWk/v1xmdPlgbYw/s320/soa_stack.bmp" border="0" alt="" /></a></span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">Web Services :</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;"><a href="http://bp1.blogger.com/_XBd24IJ243E/SBxUalod6CI/AAAAAAAABWs/Kml-cgzG6Ww/s1600-h/webservices_stack.bmp"><img style="cursor:pointer;" src="http://bp1.blogger.com/_XBd24IJ243E/SBxUalod6CI/AAAAAAAABWs/Kml-cgzG6Ww/s320/webservices_stack.bmp" border="0" alt="" /></a></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The bottom (transport) layer presents its capabilities to cope with various transport protocols to communicate between a service and a requester. In case of web services you can transport messages by using the ubiquitous Web protocols such as HyperText Transport Protocol <a name="idd1e4835"></a><a name="idd1e4830"></a>(HTTP) or Secure HTTP <a name="idd1e4852"></a><a name="idd1e4847"></a>(HTTPS) to give <a name="idd1e4866"></a><a name="idd1e4861"></a>the widest possible coverage in terms of support for the protocols, you can also transport them over any communications protocol.</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The messaging layer on top of the transport layer enables the bus to deal with messages, both XML and non-XML. The latter is important, for example, if a requester and the service needed reside in the same J2EE application server and the bus can simply transport the data in its Java rendering, avoiding unnecessary transformations. The messaging <a name="idd1e4913"></a><a name="idd1e4908"></a><a name="idd1e4903"></a>services component of the framework contains the most fundamental Web services specifications and technologies, including eXtensible Markup Language <a name="idd1e4926"></a><a name="idd1e4921"></a>(XML), SOAP, and WS-Addressing. Collectively, these specifications form the basis of interoperable messaging between Web services. XML provides the interoperable format to describe message content between Web services and is the basic language in which the Web <a name="idd1e4954"></a><a name="idd1e4949"></a><a name="idd1e4944"></a>services specifications are defined. </span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The next ( description )layer of the bus facilitates and deals with the description of services in terms of functions supported, quality of services of these functions, and supported binding mechanisms. This metadata is important, and it is fundamental to achieving the loose coupling that is associated with an SOA viz. WSDL, WS-Policy</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The actual quality of services that the bus enforces based on appropriate parameterization via polices resides in the layer that follows. The specific issues involving this layer include security, reliability of message delivery, and support for transactions. Likewise web Services provides WS-Reliable Messaging, WS-Security.</span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span></p>
<p class="MsoNormal" style="text-align:justify;font-family:times new roman;"><span style="font-size:100%;">The top layer represents the various kinds of virtual components that Web services represent. This layer has atomic services that are not composed as far as a requester&#8217;s experience with the service is concerned. Composite services that the service bus inherently supports are choreographies and societies of services that cooperate following an agreement protocol to decide on the success of the cooperation at the end of the cooperation. </span></p>
<p><span style="font-size:100%;font-family:times new roman;"></span> <span style="font-size:100%;">Finally, another layer provides features for discovery of services and their descriptions and to agree on a mode of interaction between a requester and a <a name="idd1e3443"></a><a name="idd1e3438"></a>service. UDDI and META-DATA Exchange are the ways it is done using web services.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=7&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/05/07/difference-between-soa-and-web-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>

		<media:content url="http://bp0.blogger.com/_XBd24IJ243E/SBxUaVod6BI/AAAAAAAABWk/v1xmdPlgbYw/s320/soa_stack.bmp" medium="image" />

		<media:content url="http://bp1.blogger.com/_XBd24IJ243E/SBxUalod6CI/AAAAAAAABWs/Kml-cgzG6Ww/s320/webservices_stack.bmp" medium="image" />
	</item>
		<item>
		<title>Connect to SSL enabled database via JBoss</title>
		<link>http://ravishbhupesh.wordpress.com/2008/05/06/connect-to-ssl-enabled-database-via-jboss/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/05/06/connect-to-ssl-enabled-database-via-jboss/#comments</comments>
		<pubDate>Tue, 06 May 2008 17:11:02 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[TECHNICAL]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=5</guid>
		<description><![CDATA[How to enable JBoss 4.2 to connect to a SSL enabled DATABASE In my last post I explained how to enable SSL inJBoss. There may be a chance when you need to make your database to accept only SSL connections. In that case what you have to do is to put the appropriate datasource file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=5&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span style="font-size:17pt;">How to enable JBoss 4.2 to connect to a SSL enabled DATABASE</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>In my last post I explained how to enable SSL inJBoss. There may be a chance when you need to make your database to accept only SSL connections. In that case what you have to do is to put the appropriate datasource file into the deploy folder of your database. The point to make sure here is that mention the url in the database for ssl and not for simple.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>I used JBoss-eap-as 4.2 and Postgres8.1</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Copy the datasource file from </span></p>
<p class="MsoNormal"><span>jboss-eap-4.2\jboss-as\docs\examples\jca</span></p>
<p class="MsoNormal"><span>Or in you case it could be</span></p>
<p class="MsoNormal"><span>jboss-as\docs\examples\jca</span></p>
<p class="MsoNormal"><span>Into the deploy folder of your configuration.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>jboss-eap-4.2\jboss-as\server\default\deploy</span></p>
<p class="MsoNormal"><span>or </span></p>
<p class="MsoNormal"><span>jboss4.x\server\default\deploy</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Provide the connection url, username and password :</span></p>
<p class="MsoNormal"><span>In case of postgres url is : </span></p>
<p class="MsoNormal"><span>&#8221; &lt;connection-url&gt;jdbc:postgresql://ipaddress:5432/databasename?ssl=true&amp;a m p;<br />
</span></p>
<p class="MsoNormal"><span>sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;a m p;&lt;/connection-url&gt; &#8220;</span></p>
<p class="MsoNormal">NOTE : DONT GIVE SPACE IN &amp;a m p; OTHERWISE IT WILL NOT WORK, i HAVE TO DO THIS OTHER IT WILL NOT HAVE APPEARED IN THIS BLOG. THANX</p>
<p class="MsoNormal">Remember in this case there is no client-side authentication. In case you want to have a client-side authentication then you need to  have a digital Certificate given by a certifying authority or you can either generate one for your self ( I have explained about how to generate a keystore in my previous post http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/ ).</p>
<p class="MsoNormal">ENJOY!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=5&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/05/06/connect-to-ssl-enabled-database-via-jboss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Enabling SSL on JBoss</title>
		<link>http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/#comments</comments>
		<pubDate>Tue, 06 May 2008 12:10:31 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[Application Server - JBoss]]></category>

		<guid isPermaLink="false">http://ravishbhupesh.wordpress.com/?p=4</guid>
		<description><![CDATA[How to enable SSL on JBoss 4.2 I am going to explain how to enable JBoss to accept SSL connection and also how to make JBoss to connect to a database which only accepts SSL connections. I am using JBoss-eap-4.2 and Postgres8.1 My Postgres is configured to accept on SSL connections. Firstly, lets enable ssl [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=4&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size:19pt;">How to enable SSL on JBoss 4.2</span></p>
<p class="MsoNormal"><span style="font-size:19pt;"> </span></p>
<p class="MsoNormal"><span>I am going to explain how to enable JBoss to accept SSL connection and also how to make JBoss to connect to a database which only accepts SSL connections.</span></p>
<p class="MsoNormal"><span>I am using JBoss-eap-4.2 <span> </span>and Postgres8.1</span></p>
<p class="MsoNormal"><span>My Postgres is configured to accept on SSL connections.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><strong><span>Firstly, lets enable ssl for jboss. </span></strong></p>
<p class="MsoNormal"><strong><span> </span></strong></p>
<p class="MsoNormal"><span>JBoss uses JSEE, the Java Secure Socket Extension (JSSE), for SSL. To start we need a public key/private key pair in the form of an X509 certificate for use by the SSL server sockets. Let us create a self-signed certificate using the JDK keytool. It was created using the following command and input:</span></p>
<p class="MsoNormal"><span>keytool -genkey -keystore “NAME_OF_YOUR_KEYSTORE” -storepass “STOREPASS _OF_YOUR_KEYSTORE” –keypass “KEYPASS_OF_YOUR_KEYSTORE” -keyalg RSA -alias “ALIAS_OF_YOUR_KEYSTORE” -validity 3650 -dname</span></p>
<p class="MsoNormal"><span>&#8220;cn=myKeystore,ou=jboss admin,dc=jboss,dc=org&#8221;</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>“NAME_OF_YOUR_KEYSTORE” <span> </span>= myKeystore.keystore</span></p>
<p class="MsoNormal"><span>“NAME_OF_YOUR_KEYSTORE” <span> </span><span> </span>= myKeystore</span></p>
<p class="MsoNormal"><span>“STOREPASS_OF_YOUR_KEYSTORE”<span> </span>= rmi+ssl</span></p>
<p class="MsoNormal"><span>“KEYPASS_OF_YOUR_KEYSTORE” <span> </span>= rmi+ssl</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Finally it is : </span></p>
<p class="MsoNormal"><span>keytool -genkey -keystore myKeystore.keystore -storepass rmi+ssl –keypass rmi+ssl -keyalg RSA -alias myKeystore -validity 3650 -dname&#8221;cn=myKeystore,ou=jboss admin,dc=jboss,dc=org&#8221;</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>You can view your keyStore file if you want to using this command</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>keytool -list -v –keystore myKeystore.keystore</span></p>
<p class="MsoNormal"><span style="font-size:16pt;"> </span></p>
<p class="MsoNormal"><span>Then copy the keystore file in the conf directory of ur jboss configuration.</span></p>
<p class="MsoNormal"><span>jboss-eap-4.2\jboss-as\server\default\conf</span></p>
<p class="MsoNormal"><span>in your case it could be</span></p>
<p class="MsoNormal"><span>jboss4.x\server\default\conf</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Now open the server.xml file in your conf directory :</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>jboss-eap-4.2\jboss-as\server\default\deploy\jboss-web.deployer</span></p>
<p class="MsoNormal"><span>in your case it could be</span></p>
<p class="MsoNormal"><span>jboss4.x\server\default\deploy\jboss-web.deployer</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>uncomment this block </span></p>
<p class="MsoNormal"><span>&lt;!&#8211;</span></p>
<p class="MsoNormal"><span><span> </span>&lt;Connector port=&#8221;8443&#8243; protocol=&#8221;HTTP/1.1&#8243; SSLEnabled=&#8221;true&#8221;</span></p>
<p class="MsoNormal"><span><span> </span>maxThreads=&#8221;150&#8243; scheme=&#8221;https&#8221; secure=&#8221;true&#8221;</span></p>
<p class="MsoNormal"><span><span> </span>clientAuth=&#8221;false&#8221; sslProtocol=&#8221;TLS&#8221; /&gt;</span></p>
<p class="MsoNormal"><span><span> </span>&#8211;&gt;</span></p>
<p class="MsoNormal"><span>And add these things</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span><span> </span></span><span class="tag"><span style="font-size:11pt;">&lt;</span></span><span class="tag-name"><span style="font-size:11pt;">Connector</span></span><span style="font-size:11pt;"> <span class="attribute">port</span>=<span class="attribute-value">&#8220;THE_PORT_YOU_LIKE&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">protocol</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;HTTP/1.1&#8243;</span> <span class="attribute">SSLEnabled</span>=<span class="attribute-value">&#8220;true&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">maxThreads</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;150&#8243;</span> <span class="attribute">scheme</span>=<span class="attribute-value">&#8220;https&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">secure</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;true&#8221;</span> <span class="attribute">clientAuth</span>=<span class="attribute-value">&#8220;false&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">keystoreFile</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;${jboss.server.home.dir}/conf/THE_KEYSTORE_NAME&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">keystorePass</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;PASSWORD_FOR_THE_KEYSTORE&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">truststoreFile</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;${jboss.server.home.dir}/conf/THE_KEYSTORE_NAME&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">truststorePass</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;PASSWORD_FOR_THE_KEYSTORE&#8221;</span> </span></p>
<p class="MsoNormal" style="margin-left:72pt;"><span class="attribute"><span style="font-size:11pt;">sslProtocol</span></span><span style="font-size:11pt;">=<span class="attribute-value">&#8220;TLS&#8221;</span><span class="tag">/&gt;</span></span><span style="font-size:11pt;"> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span><span> </span>And it is done. Now start the jboss and type the url</span></p>
<p class="MsoNormal"><span><a href="https://ipaddress:8443/">https://ipaddress:8443</a> <span> </span>or<span> </span><a href="https://localhost:8443/">https://localhost:8443</a> </span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>and its done.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>If you don’t want to access your jboss server via 8080 port then you need to disable the connector 8080 in the server.xml file located at</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>jboss-eap-4.2\jboss-as\server\default\deploy\jboss-web.deployer</span></p>
<p class="MsoNormal"><span>in your case it could be</span></p>
<p class="MsoNormal"><span>jboss4.x\server\default\deploy\jboss-web.deployer</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=4&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://ravishbhupesh.wordpress.com/2008/05/06/hello-world/</link>
		<comments>http://ravishbhupesh.wordpress.com/2008/05/06/hello-world/#comments</comments>
		<pubDate>Tue, 06 May 2008 11:53:09 +0000</pubDate>
		<dc:creator>ravishbhupesh</dc:creator>
				<category><![CDATA[TECHNICAL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=1&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ravishbhupesh.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ravishbhupesh.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ravishbhupesh.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ravishbhupesh.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ravishbhupesh.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ravishbhupesh.wordpress.com&amp;blog=3658762&amp;post=1&amp;subd=ravishbhupesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ravishbhupesh.wordpress.com/2008/05/06/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce12bbce123bc2c8680332d0cc217a95?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">bhupi</media:title>
		</media:content>
	</item>
	</channel>
</rss>
