<?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>Rocksolutions&#039;s Blog</title>
	<atom:link href="http://rocksolutions.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rocksolutions.wordpress.com</link>
	<description>Blog on Java/Jee, Weblogic, Flex</description>
	<lastBuildDate>Fri, 30 Dec 2011 07:14:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rocksolutions.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/15ceb513bd6c6ac7763327cad754f8e8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Rocksolutions&#039;s Blog</title>
		<link>http://rocksolutions.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rocksolutions.wordpress.com/osd.xml" title="Rocksolutions&#039;s Blog" />
	<atom:link rel='hub' href='http://rocksolutions.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Coming soon&#8230; my new learnings on IBM Websphere</title>
		<link>http://rocksolutions.wordpress.com/2011/12/30/coming-soon-my-new-learnings-on-ibm-websphere/</link>
		<comments>http://rocksolutions.wordpress.com/2011/12/30/coming-soon-my-new-learnings-on-ibm-websphere/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 07:14:44 +0000</pubDate>
		<dc:creator>®V</dc:creator>
		
		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1060</guid>
		<description><![CDATA[Coming soon my new learnings on IBM Websphere&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1060&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Coming soon my new learnings on IBM Websphere&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1060/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1060/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1060/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1060&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/12/30/coming-soon-my-new-learnings-on-ibm-websphere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Configuring Wired LAN(internet) on Ubuntu</title>
		<link>http://rocksolutions.wordpress.com/2011/12/25/configuring-wired-laninternet-on-ubuntu/</link>
		<comments>http://rocksolutions.wordpress.com/2011/12/25/configuring-wired-laninternet-on-ubuntu/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 09:30:16 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Configuring Wired LAN(internet) on Ubuntu]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1047</guid>
		<description><![CDATA[Hi, In this post I will explain the ways we can configure Wired LAN connection on Ubuntu. While configuring any network resource we always need the IP Address to connect to the Domain/Network System. And this IP Address we configure either manually or using DHCP option(DHCP &#8211; the Dynamic Host Configuration Protocol &#8211; allows network [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1047&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>In this post I will explain the ways we can configure Wired LAN connection on Ubuntu. While configuring any network resource we always need the IP Address to connect to the Domain/Network System. And this IP Address we configure either manually or using DHCP option(<em>DHCP</em> &#8211; the <em>Dynamic Host Configuration Protocol</em> &#8211; allows network devices to automatically obtain a valid IP address from a server.). There are many networking utilities we can use to configure the network, Now let see Network Interface configuration Using Command-Line.</p>
<p>Step 1: Go to <strong>Terminal</strong> and Type the below command.</p>
<pre>gksudo gedit /etc/network/interfaces (if you have GUI)
OR
sudo vi /etc/network/interfaces (use vi if no GUI installed)</pre>
<p>Step 2:<br />
<strong>-&gt; Change to set if using DHCP</strong></p>
<pre>auto eth0
iface eth0 inet manually
<strong>TO</strong>
auto eth0
iface eth0 inet dhcp</pre>
<p><strong>-&gt; Change to set if using Static IP</strong></p>
<pre>auto eth0
iface eth0 inet static
address 192.125.1.10
gateway 192.125.1.2
netmask 255.255.255.0</pre>
<p><strong>Step 3: Save the file.</strong></p>
<p><strong>Step 4: After you save the file, Its time to restart networking services.</strong></p>
<pre>sudo /etc/init.d/networking restart</pre>
<p>Now go to <strong>Administration</strong> -&gt; <strong>System Monitor</strong> and click on the <strong>Resources Tab</strong> and observe the <strong>Network History</strong> to see the Network connection graph.</p>
<p>Yepeee.. you are now connected <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;<br />
Thanks,<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1047/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1047/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1047/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1047&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/12/25/configuring-wired-laninternet-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Phases of Java Class loading</title>
		<link>http://rocksolutions.wordpress.com/2011/12/10/phases-of-java-class-loading/</link>
		<comments>http://rocksolutions.wordpress.com/2011/12/10/phases-of-java-class-loading/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 11:36:45 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[Phases of Java Class loading]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1037</guid>
		<description><![CDATA[Hi All, This post is regarding the phases of class loading in any java based application.  I came across a very good write up material, and thought of sharing with all my blog users. The loading of a class can essentially be broken down into three phases: 1. Loading 2. Linking 3. Initializing. Most, if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1037&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>This post is regarding the phases of class loading in any java based application.  I came across a very good write up material, and thought of sharing with all my blog users.</p>
<p>The loading of a class can essentially be broken down into three phases:<br />
1. Loading<br />
2. Linking<br />
3. Initializing.</p>
<p>Most, if not all, problems relating to class loading can be tracked down to a problem occurring in one of these phases. Therefore, a thorough understanding of each phase helps in the diagnosing of class loading problems. The phases are illustrated in Figure 2</p>
<div id="attachment_1038" class="wp-caption alignleft" style="width: 160px"><a href="http://rocksolutions.files.wordpress.com/2011/12/class_loading.jpg"><img class="size-thumbnail wp-image-1038" title="class_loading" src="http://rocksolutions.files.wordpress.com/2011/12/class_loading.jpg?w=150&#038;h=83" alt="" width="150" height="83" /></a><p class="wp-caption-text">class loading</p></div>
<p>The <strong><em>loading</em></strong> phase consists of locating the required class file (by searching though the respective classpaths) and loading in the bytecode. Within the JVM, the loading process gives a very basic memory structure to the class object. Methods, fields, and other referenced classes are not dealt with at this stage. As a result, the class is not usable.</p>
<p><strong><br />
Linking</strong> is the most complicated of the three phases. It can be broken down into three main stages:</p>
<ul>
<li><strong>Bytecode verification.</strong> The class loader does a number of checks on the bytecodes of the class to ensure that it is well-formed and well-behaved.</li>
<li><strong>Class preparation.</strong> This stage prepares the necessary data structures that represent fields, methods, and implemented interfaces that are defined within each class.</li>
<li><strong>Resolving.</strong> In this stage, the class loader loads all the other classes referenced by a particular class. The classes can be referenced in a number of ways:</li>
<ul>
<li>Superclasses</li>
<li>Interfaces</li>
<li>Fields</li>
<li>Method signatures</li>
<li>Local variables used in methods</li>
</ul>
</ul>
<p>During the <strong><em>initializing</em></strong> phase, any static initializers contained within a class are executed. At the end of this phase, static fields are initialized to their default values.</p>
<p>At the end of these three phases, a class is fully loaded and is ready for use.</p>
<p><strong>Note that class loading can be performed in a lazy manner and therefore some parts of the class loading process may be done on first use of the class rather than at load time.</strong></p>
<p>Hope this helps.</p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1037/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1037&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/12/10/phases-of-java-class-loading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>

		<media:content url="http://rocksolutions.files.wordpress.com/2011/12/class_loading.jpg?w=150" medium="image">
			<media:title type="html">class_loading</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Log4j to log Hibernate queries with values</title>
		<link>http://rocksolutions.wordpress.com/2011/12/03/using-log4j-to-log-hibernate-queries-with-values/</link>
		<comments>http://rocksolutions.wordpress.com/2011/12/03/using-log4j-to-log-hibernate-queries-with-values/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:52:05 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[JSP/Servlets]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[Using Log4j to log Hibernate queries with values]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1033</guid>
		<description><![CDATA[Hi All, Hibernate is one of most used ORM framework across the J2EE Applications, It provides many features which helps us to organize the SQL queries in a very easy manner just by playing with java entity bean properties. In this post I will explain the way we can display the named queries in log file including the run time value bindings, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1033&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>Hibernate is one of most used ORM framework across the J2EE Applications, It provides many features which helps us to organize the SQL queries in a very easy manner just by playing with java entity bean properties. In this post I will explain the way we can display the named queries in log file including the run time value bindings,</p>
<p>In bigger applications debugging SQL queries is a very crucial thing came into picture, a query containing more SQL Joins is not that easy to debug in case if some misalignment in data found.  To ease that just follow the below steps to enable this sort of hibernate logging in logger(LOG4J).</p>
<p><strong><br />
</strong> <strong>In Log4j properties add the below two category entries.</strong></p>
<blockquote><p><strong>log4j.category.org.hibernate.SQL= STDOUT //</strong> this is as equivalent hibernate.show_sql=true<br />
<strong>log4j.category.org.hibernate.type= DEBUG//</strong> this basically prints the bound parameters among other things.</p></blockquote>
<p><strong>Output in Logger file</strong></p>
<blockquote><p>Hibernate: select emp0_.dept_id as dept2_1_, emp0_.emp_id as emp1_1_, emp0_.emp_id as emp1_0_0_, emp0_.dept_id as dept2_0_0_, emp0_.emp_join_date as emp3_0_0_, emp0_.emp_name as emp4_0_0_, emp0_.bank_name as bank5_0_0_, emp0_.salary as salary0_0_ from Employee emp0_ where emp0_.dept_id=?<br />
2011-12-03 13:08:50,031 DEBUG [main] AbstractBatcher &#8211; preparing statement<br />
<strong>2011-12-03 13:08:50,031 DEBUG [main] NullableType &#8211; binding &#8217;1&#8242; to parameter: 1</strong><br />
2011-12-03 13:08:50,031 DEBUG [main] AbstractBatcher &#8211; about to open ResultSet (open ResultSets: 0, globally: 0)</p></blockquote>
<p>Hope this helps <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1033/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1033/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1033/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1033&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/12/03/using-log4j-to-log-hibernate-queries-with-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Configure Log4j in simple steps</title>
		<link>http://rocksolutions.wordpress.com/2011/12/03/configure-log4j-in-simple-steps/</link>
		<comments>http://rocksolutions.wordpress.com/2011/12/03/configure-log4j-in-simple-steps/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:02:34 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[Configure Log4j in simple steps]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1027</guid>
		<description><![CDATA[Hi All, The logging framework always plays a crucial part in your application. In this post i will explain how to configure Log4J in simple steps. Step1: Put the Log4j jars file in classpath. Step 2: Create a log4j properties &#124; xml file. # Set root logger level to INFO log4j.rootLogger=INFO,STDOUT log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%d %p [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1027&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>The logging framework always plays a crucial part in your application. In this post i will explain how to configure Log4J in simple steps.<br />
<strong>Step1:</strong></p>
<blockquote><p>Put the Log4j jars file in classpath.</p></blockquote>
<p><strong>Step 2:</strong><br />
Create a log4j properties | xml file.</p>
<blockquote>
<pre># Set root logger level to INFO
log4j.rootLogger=INFO,STDOUT

log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d %p [%t] %C{1} - %m\n

log4j.category.org.hibernate.SQL= STDOUT
log4j.category.org.hibernate.type= STDOUT</pre>
</blockquote>
<p><strong>XML</strong></p>
<blockquote><p><code>&lt;!--?<span class="hiddenSpellError">xml version="1.0" encoding="UTF-8"?&gt;</code><br />
<code> </code></p></blockquote>
<p><strong>Step 3:</strong><br />
Write a program to load and start the logging in application</p>
<blockquote><p>private static Logger logger = Logger.getLogger(TestJPAConfiguration.class);</p>
<p>public static void main(String[] args) {</p>
<p>//this is for basic loading<br />
BasicConfigurator.configure();</p>
<p>//Use property configurator to explicit load the log4j properties file.<br />
//PropertyConfigurator.configure(&#8220;log4j.properties&#8221;);</p>
<p>//in case of using XML config, Use DOM Configurator<br />
// DOMConfigurator.configure(&#8220;log4j.xml&#8221;);</p>
<p>logger.info(&#8220;Log4J Configured  successfully&#8221;);</p>
<p>}</p></blockquote>
<p>Hope this helps. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1027/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1027&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/12/03/configure-log4j-in-simple-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>XML Schema Validation using JAXB</title>
		<link>http://rocksolutions.wordpress.com/2011/11/26/xml-schema-validation-using-jaxb/</link>
		<comments>http://rocksolutions.wordpress.com/2011/11/26/xml-schema-validation-using-jaxb/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 09:42:44 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[JAXB]]></category>
		<category><![CDATA[XML Schema Validation using JAXB]]></category>
		<category><![CDATA[XSD validation]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1015</guid>
		<description><![CDATA[Hi All, This is a very small post on a very important part of XML Schema validation. While interchanging the data across different systems using XML format, it becomes  more important to validate the XML data with XML schema. As XSD plays a crucial part to validate all the possible combination of data to carry in XML [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1015&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>This is a very small post on a very important part of XML Schema validation. While interchanging the data across different systems using XML format, it becomes  more important to validate the XML data with XML schema. As XSD plays a crucial part to validate all the possible combination of data to carry in XML document.</p>
<p><strong>Now lets see an example of performing XSD Validation using JAXB.</strong></p>
<blockquote><p><strong>//Setting the Validation</strong><br />
Schema schema;<br />
SchemaFactory schemaFactory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI ); //W3C XML Schema Namespace URI.<br />
schema = schemaFactory.newSchema(new File(&#8220;src/product.xsd&#8221;)); //THE XSD Location<br />
marshaller.setSchema(schema); //Register the schema in marshaller<br />
marshaller.marshal(product, System.out); //marshal the object</p></blockquote>
<p>To list all the validation  issues in logger  or on system console, you can use my previous post on registering <strong>ValidationHandler</strong> in JAXB.(Read POST http://wp.me/pQKn2-gj )</p>
<p>Hope this helps.</p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1015/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1015/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1015/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1015&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/11/26/xml-schema-validation-using-jaxb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Using ValidationEventHandler while converting XML to Java object in JAXB</title>
		<link>http://rocksolutions.wordpress.com/2011/11/26/using-validationeventhandler-while-converting-xml-to-java-object-in-jaxb/</link>
		<comments>http://rocksolutions.wordpress.com/2011/11/26/using-validationeventhandler-while-converting-xml-to-java-object-in-jaxb/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 09:23:27 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[JAXB]]></category>
		<category><![CDATA[JAXB validation]]></category>
		<category><![CDATA[Using ValidationEventHandler while converting XML to Java object in JAXB]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1011</guid>
		<description><![CDATA[Hi All, JAXB as we know is an API  for XML Binding. It is heavily used in JAX-WS web services as a binding standard. XML Data binding describes the conversion of data between its XML and Java representations. So this post talks about the phase when we convert the XML Data to its corresponding Java objects. It seems [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1011&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>JAXB as we know is an API  for XML Binding. It is heavily used in JAX-WS web services as a binding standard. XML <em>Data binding</em> describes the conversion of data between its XML and Java representations.</p>
<p>So this post talks about the phase when we convert the XML Data to its corresponding Java objects. It seems easy as just by calling the unmarshaller.unmarshal method. But what goes behind the scene is not that quite easy.</p>
<p>And think about a scenario where you have data payload in XML format of more than 3mb and just seeing some &#8220;<strong>NullPointerException</strong>&#8221; during un-marshalling will make you go mad(specially which I had felt so many times <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>So to tackle this lets first of all understand what JAXB does during un-marshalling. JAXB reports validation of data through events.  It uses a handler called as &#8220;<strong>ValidationEventHandler</strong>&#8220;, And this handler represent an instance of &#8220;<strong>ValidationEvent</strong>&#8221; and provides many details about the un-marshalling related issues.</p>
<p>Lets see in an example(I am taking the base example I have posted in this post) <a href="http://rocksolutions.wordpress.com/2010/08/04/sample-on-jaxb-using-eclipse/">http://rocksolutions.wordpress.com/2010/08/04/sample-on-jaxb-using-eclipse/</a></p>
<p><strong>Step 1: Create a Custom Handler Class</strong></p>
<pre>import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;

public class CustomValidationEventHandler implements ValidationEventHandler {

    public boolean handleEvent(ValidationEvent event) {
        System.out.println("Event");
        System.out.println("Severity:  " + event.getSeverity());
        System.out.println("Message:  " + event.getMessage());
        System.out.println("Linked Exception:  " + event.getLinkedException());
        System.out.println("Locator:::");
        System.out.println("    Line Nbr:  " + event.getLocator().getLineNumber());
        System.out.println("    Column Nbr:  " + event.getLocator().getColumnNumber());
        System.out.println("    Offset:  " + event.getLocator().getOffset());
        System.out.println("    Objct:  " + event.getLocator().getObject());
        System.out.println("    Node:  " + event.getLocator().getNode());
        System.out.println("    URL:  " + event.getLocator().getURL());
        return true;
    }

}</pre>
<p><strong><br />
Step 2: Register the Handler with the Unmarshller</strong></p>
<pre>unmarshaller.setEventHandler(new CustomValidationEventHandler());</pre>
<p><strong><br />
Now run the program and you will see the somewhat similar output.</strong></p>
<pre>Severity:  1
Message:  cvc-maxLength-valid: Value 'TESTPRODUCT' with length = '10' is not facet-valid with respect to maxLength '8' for type 'stringWithMaxSize8'.
Linked Exception:  org.xml.sax.SAXParseException: cvc-maxLength-valid: Value 'TESTPRODUCT' with length = '10' is not facet-valid with respect to maxLength '8' for type 'stringWithMaxSize8'.
Locator:::
    Line Nbr:  3
    Column Nbr:  12
    Offset:  -1
    Object:  null
    Node:  null
    URL:  null</pre>
<p>One thing which I have observed is that the Node and URL properties are not always available to be set on the locator. This is something which I am investigating will sure post the reasons on the same, would appreciate if somebody share the reason.</p>
<p>Please do share your thoughts about this Post <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1011/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1011/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1011/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1011&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/11/26/using-validationeventhandler-while-converting-xml-to-java-object-in-jaxb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Preparing for Java Interview.. well here is the link&#8230;</title>
		<link>http://rocksolutions.wordpress.com/2011/09/04/preparing-for-java-interview-well-here-is-the-link/</link>
		<comments>http://rocksolutions.wordpress.com/2011/09/04/preparing-for-java-interview-well-here-is-the-link/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 16:54:35 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[Java Interview questions]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=1005</guid>
		<description><![CDATA[Hi, Preparing for any interview is one of the toughest job in this universe.  I would like to share one reference link with you all. Hope it helps http://www.java-questions.com/ &#8211; Thanks R Vashi<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1005&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Preparing for any interview is one of the toughest job in this universe.  I would like to share one reference link with you all. Hope it helps <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.java-questions.com/">http://www.java-questions.com/</a></p>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/1005/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/1005/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/1005/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=1005&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/09/04/preparing-for-java-interview-well-here-is-the-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome to Java7 Quick tour</title>
		<link>http://rocksolutions.wordpress.com/2011/09/03/welcome-to-java7-quick-tour/</link>
		<comments>http://rocksolutions.wordpress.com/2011/09/03/welcome-to-java7-quick-tour/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 14:11:45 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[Welcome to Java7 Quick tour]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=997</guid>
		<description><![CDATA[Hi, While browsing some information about Java 7, I came across a very nice blog covering few major changes in Java 7. Would like to share with all my blog users. Here it goes.. The first example will show switch with String, previously this functionality was only possible  with Enums and integer values. In actual fact the JDK retrieves [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=997&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>While browsing some information about Java 7, I came across a very nice blog covering few major changes in Java 7. Would like to share with all my blog users. Here it goes..</p>
<p><span class="Apple-style-span" style="font-size:small;">The first example will show switch with String, previously this functionality was only possible  with Enums and integer values. In actual fact the JDK retrieves the hashcode for the String which is an integer. Below is an example of this feature.</span></p>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="font-size:small;">String drink=&#8221;coffee&#8221;;</span></div>
<div><span style="font-size:small;">switch (drink){</span></div>
<div><span style="font-size:small;">case &#8220;coffee&#8221;:</span></div>
<div><span style="font-size:small;">System.out.println(&#8220;So you need milk&#8221;);</span></div>
<div><span style="font-size:small;">break;</span></div>
<div><span style="font-size:small;">case &#8220;juice&#8221;:</span></div>
<div><span style="font-size:small;">System.out.println(&#8220;So you need sugar&#8221;);</span></div>
<div><span style="font-size:small;">break;</span></div>
<div><span style="font-size:small;">case &#8220;refrigerate&#8221;:</span></div>
<div><span style="font-size:small;">System.out.println(&#8220;So you need ice&#8221;);</span></div>
<div><span style="font-size:small;">break;</span></div>
<div><span style="font-size:small;">default:</span></div>
<div><span style="font-size:small;">System.out.println(&#8220;unknown drink &#8220;);</span></div>
<div><span style="font-size:small;">break;</span></div>
<div>}</div>
</td>
</tr>
</tbody>
</table>
<div><span style="font-size:small;">I will now show you the ARM, Automatic Resource management, you don&#8217;t need to concern yourself with the resources that will be used in your program because it will automatically close when it exits the Try block. For this just implement the interface java.lang.AutoCloseable, the only method is the Close, The AutoCloseable is the better option than Closeable because an exception is not thrown when you close the resource, in the second picture we can see this.</span></div>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="color:#000000;"><span style="font-size:small;">public void copyFile(File original, File copy) throws FileNotFoundException, IOException {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">try (</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">InputStream in = new FileInputStream(original);</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">OutputStream out = new FileOutputStream(copy)) {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">byte[] buf = new byte[1024];</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">int n;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">while ((n = in.read(buf)) &gt;= 0) {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">out.write(buf, 0, n);</span></span></div>
<div><span style="color:#000000;">}</span></div>
<div><span style="color:#000000;">}// <span style="font-size:small;">it <span style="font-size:small;">is automatically close</span></span></span></div>
<div><span style="color:#000000;">}</span></div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="font-size:small;">The multi-try, for some people is the most important feature in this version, it now allows many exceptions inside the catch block just separate with a “|” pipe.</span></span></div>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="color:#000000;"><span style="font-size:small;">ExemploARM arm=new ExemploARM();</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">try {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">arm.copyFile(origem, destino);</span></span></div>
<div><span style="color:#000000;">} <span style="font-size:small;">catch (FileNotFoundException | IOException ex) {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">ex.printStackTrace();</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">System.out.println(&#8220;It&#8217;s can&#8217;t copy file&#8221;);</span></span></div>
<div><span style="color:#000000;">}</span></div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="font-size:small;">using multy-try</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">In Java 7 there are some improvements to Generics and collections making it easy to make this type Object. Now it is possible to make generic collections easily with the  diamond operator “&lt;&gt;”</span></span></div>
<table width="644" cellspacing="0" cellpadding="4">
<col width="634" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="634">
<div><span style="color:#000000;"><span style="font-size:small;">List&lt;Object&gt; diamond=new ArrayList&lt;&gt;(); // diamond</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">List&lt;Drink&gt; Drinks;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">Map&lt;String, List&lt;Drink&gt;&gt; maps=new HashMap&lt;&gt;();</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">maps.put(&#8220;diamond&#8221;, drinks=new ArrayList&lt;&gt;() );</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">maps.put(&#8220;other example&#8221;, new ArrayList&lt;Bebida&gt;() );</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">maps.put(&#8220;erro&#8221;, new ArrayList&lt;&gt;() );</span></span></div>
<div><span style="color:#000000;">[/<span style="font-size:small;">code] Picture 4: diamond</span></span></div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="font-size:small;">Talking more about generic collections there is the annotation @SafeVarargs for ensuring this method is safe.</span></span></div>
<div> <span style="font-size:small;">Applying this annotation to a method or constructor suppresses unchecked warnings about a non-reifiable variable-arity (vararg) type and suppresses unchecked warnings about parameterized array creation at call sites.</span></div>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="color:#000000;">@<span style="font-size:small;">SafeVarargs</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">static  List asList (T&#8230; elements) {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">System.out.println(elements);</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">return null;</span></span></div>
<div><span style="color:#000000;">}</span></div>
<div><span style="color:#000000;">@<span style="font-size:small;">SafeVarargs</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">static void varags(List&#8230; stringLists) {</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">Object[] array = stringLists;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">List tmpList = Arrays.asList(42);</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">array[0] = tmpList; //run with warning</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">String s = stringLists[0].get(0); // ClassCastException</span></span></div>
<div><span style="color:#000000;">}</span></div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;">@<span style="font-size:small;">SafeVarargs</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">The digit separator allows for good understand when writing big numbers in java code, the only rule is you can&#8217;t separate the last and the first number, now you can write separator numbers with the character “_” it is also possible to write Double values and Float values, for example, for the JDK is equals 22 and 2_2. There is also literal in binary, which is most important when programming in embedding devices,  just put “ob” (zero and b) in front of a number, this Features can also use the separator.</span></span></div>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="color:#000000;"><span style="font-size:small;">long longPrimitive=9_999_999_99;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">Long longObjete=9__3234_300l;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">double doublePrimitive=232_32.32_12d;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">Double doubleObjeto=88_32.32_12d;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">int binA=0b01_01;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">int binB=0b0101_0111;</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">if(2222==22_22){</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">System.out.println(&#8220;equals values&#8221;);</span></span></div>
<div><span style="color:#000000;">}</span></div>
<div><span style="color:#000000;"><span style="font-size:small;">if(binA==5){</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">System.out.println(&#8220;equals binary values&#8221;);</span></span></div>
<div><span style="color:#000000;">}</span></div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="font-size:small;">picture 5: using separator and literal binary.</span></span></div>
<div><span style="color:#000000;"><span style="font-size:small;">Other feature interesting is try with resource now it possible instantiate one variable if it does not generate an exception.</span></span></div>
<table width="641" cellspacing="0" cellpadding="4">
<col width="631" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="631">
<div><span style="font-size:small;">BufferedWriter writer=null;</span></div>
<div><span style="font-size:small;">try {</span></div>
<div><span style="font-size:small;">writer = Files.newBufferedWriter(arquivo, charset);</span></div>
<div><span style="font-size:small;">writer.write(s, 0, s.length());</span></div>
<div>} <span style="font-size:small;">catch (IOException x) {</span></div>
<div><span style="font-size:small;">System.err.format(&#8220;IOException: %s%n&#8221;, x);</span></div>
<div>}</div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="font-size:small;">Picture 6: before was necessary create the variable</span></span></div>
<table width="100%" cellspacing="0" cellpadding="4">
<col width="256*" />
<tbody>
<tr>
<td valign="TOP" bgcolor="#c0c0c0" width="100%">
<div><span style="font-size:small;">try (BufferedWriter writer = Files.newBufferedWriter(file, charset)) {</span></div>
<div><span style="font-size:small;">writer.write(s, 0, s.length());</span></div>
<div>} <span style="font-size:small;">catch (IOException x) {</span></div>
<div><span style="font-size:small;">System.err.format(&#8220;IOException: %s%n&#8221;, x);</span></div>
<div>}</div>
</td>
</tr>
</tbody>
</table>
<div><span style="color:#000000;"><span style="color:#000000;"><span style="font-size:small;">Picture 7: after using try with resource in java 7</span></span></span>&nbsp;</p>
</div>
<div><span style="color:#000000;"><span style="color:#000000;"><span style="font-size:small;">Some more features..<br />
</span></span></span></p>
<ul>
<li>The new <a href="http://download.java.net/jdk7/docs/api/java/util/Objects.html">java.util.Objects</a> class provides some nice static convenience methods as described in my blog post <a href="http://marxsoftware.blogspot.com/2011/03/jdk-7-new-objects-class.html">JDK 7: The New Objects Class</a>.</li>
<li>Three new convenience methods have been added to the <a href="http://marxsoftware.blogspot.com/2009/03/java-collections-class.html">already useful</a> <a href="http://download.java.net/jdk7/docs/api/java/util/Collections.html">Collections</a> class:<a href="http://download.java.net/jdk7/docs/api/java/util/Collections.html#emptyIterator()">Collections.emptyIterator()</a>, <a href="http://download.java.net/jdk7/docs/api/java/util/Collections.html#emptyListIterator()">Collections.emptyListIterator()</a>, and<a href="http://download.java.net/jdk7/docs/api/java/util/Collections.html#emptyEnumeration()">Collections.emptyEnumeration()</a>.</li>
<li>New static methods for comparing primitives [similar to the already existing<a href="http://download.java.net/jdk7/docs/api/java/lang/Double.html#compare(double, double)">Double.compare(double,double)</a> and <a href="http://download.java.net/jdk7/docs/api/java/lang/Float.html#compare(float, float)">Float.compare(float,float)</a>] are now available for additional numeric/boolean types: <a href="http://download.java.net/jdk7/docs/api/java/lang/Byte.html#compare(byte, byte)">Byte.compare(byte, byte)</a>, <a href="http://download.java.net/jdk7/docs/api/java/lang/Integer.html#compare(int, int)">Integer.compare(int,int)</a>,<a href="http://download.java.net/jdk7/docs/api/java/lang/Long.html#compare(long, long)">Long.compare(long,long)</a>, <a href="http://download.java.net/jdk7/docs/api/java/lang/Short.html#compare(short, short)">Short.compare(short,short)</a>, and<a href="http://download.java.net/jdk7/docs/api/java/lang/Boolean.html#compare(boolean, boolean)">Boolean.compare(boolean,boolean)</a>.</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/util/Calendar.html">Calendar</a> gets some Java 7 attention (even if it&#8217;s <a href="http://www.wolkje.net/2010/01/06/java-date-and-time-api-and-jsr-310/">not the overhaul</a> many of us had <a href="http://trulsjor.wordpress.com/2010/01/31/jsr-310-a-specification-request-to-free-java-from-the-date-handling-nightmare/">hoped for</a>): <a href="http://download.java.net/jdk7/docs/api/java/util/Calendar.html#isWeekDateSupported()">Calendar.isWeekDateSupported()</a>, <a href="http://download.java.net/jdk7/docs/api/java/util/Calendar.html#getWeekYear()">Calendar.getWeekYear()</a>,<a href="http://download.java.net/jdk7/docs/api/java/util/Calendar.html#setWeekDate(int, int, int)">Calendar.setWeekDate(int,int,int)</a>, and <a href="http://download.java.net/jdk7/docs/api/java/util/Calendar.html#getWeeksInWeekYear()">Calendar.getWeeksInWeekYear()</a>. The<a href="http://download.java.net/jdk7/docs/api/java/util/TimeZone.html#observesDaylightTime()">TimeZone.observesDaylightTime()</a> method has also been added. The implementation of this interface that most of us use, <a href="http://download.java.net/jdk7/docs/api/java/util/GregorianCalendar.html">GregorianCalendar</a>, has these methods implemented now.</li>
<li>There are several changes related to Java reflection:
<ul>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html">java.lang.reflect.Modifier</a> class has new static methods: <a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html#classModifiers()">classModifiers()</a>,<a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html#interfaceModifiers()">interfaceModifiers()</a>, <a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html#constructorModifiers()">constructorModifiers()</a>, <a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html#methodModifiers()">methodModifiers()</a>, and<a href="http://download.java.net/jdk7/docs/api/java/lang/reflect/Modifier.html#fieldModifiers()">fieldModifiers()</a>.</li>
<li>I have written a <a href="http://marxsoftware.blogspot.com/2011/03/jdk-7-reflexion-exception-handling-with.html">more detailed blog post</a> on the new <a href="http://download.java.net/jdk7/docs/api/java/lang/ReflectiveOperationException.html">ReflectionOperationException</a>class.</li>
</ul>
</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/util/concurrent/ConcurrentLinkedDeque.html">ConcurrentLinkedDeque</a> and <a href="http://download.java.net/jdk7/docs/api/java/util/concurrent/LinkedTransferQueue.html">LinkedTransferQueue</a> are now available.</li>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/util/ConcurrentModificationException.html">java.util.ConcurrentModificationException</a> has two new constructors that each accept a<a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html#getCause()">cause</a> and one of them accepts a <a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html#getMessage()">detailed message</a> as well.</li>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/net/ProtocolFamily.html">java.net.ProtocolFamily</a> interface is new as is the enum <a href="http://download.java.net/jdk7/docs/api/java/net/StandardProtocolFamily.html">StandardProtocolFamily</a> that implements this interface.</li>
<li>The class <a href="http://download.java.net/jdk7/docs/api/java/net/InetAddress.html">InetAddress</a> has a new method called <a href="http://download.java.net/jdk7/docs/api/java/net/InetAddress.html#getLoopbackAddress()">getLoopbackAddress()</a>. The method<a href="http://download.java.net/jdk7/docs/api/java/net/InetAddress.html#isLoopbackAddress()">InetAddress.isLoopbackAddress()</a> has been available since JDK 1.4.</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/lang/ProcessBuilder.html">ProcessBuilder</a> gets a new nested class called <a href="http://download.java.net/jdk7/docs/api/java/lang/ProcessBuilder.Redirect.html">Redirect</a>, which itself contains a nested <a href="http://download.java.net/jdk7/docs/api/java/lang/ProcessBuilder.Redirect.Type.html">Type</a>enum.</li>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/lang/Character.html">Character</a> class now contains a nested <a href="http://download.java.net/jdk7/docs/api/java/lang/Character.UnicodeScript.html">UnicodeScript</a> enum.</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/util/BitSet.html#valueOf(long[])">BitSet.valueOf(long[])</a></li>
<li>Multiple JDBC enhancements:
<ul>
<li>The <a href="http://download.oracle.com/javase/7/docs/api/java/sql/Statement.html">Statement</a> interface prescribes two new methods: <a href="http://download.oracle.com/javase/7/docs/api/java/sql/Statement.html#closeOnCompletion()">closeOnCompletion()</a> and<a href="http://download.oracle.com/javase/7/docs/api/java/sql/Statement.html#isCloseOnCompletion()">isCloseOnCompletion()</a>.</li>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/sql/DatabaseMetaData.html">java.sql.DatabaseMetaData</a> interface has two new methods:<a href="http://download.java.net/jdk7/docs/api/java/sql/DatabaseMetaData.html#getPseudoColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)">getPseudoColumns()</a> and <a href="http://download.java.net/jdk7/docs/api/java/sql/DatabaseMetaData.html#generatedKeyAlwaysReturned()">generatedKeyAlwaysReturned()</a>.</li>
<li>JDBC&#8217;s <a href="http://download.java.net/jdk7/docs/api/java/sql/CallableStatement.html">CallableStatement</a> gets two new overloaded <a href="http://download.java.net/jdk7/docs/api/java/sql/CallableStatement.html#getObject(int, java.lang.Class)">getObject()</a> methods that get an object based on provided name or index along with the expected object&#8217;s class type.</li>
<li>The <a href="http://download.java.net/jdk7/docs/api/java/sql/Driver.html">Driver</a> class got a new method <a href="http://download.java.net/jdk7/docs/api/java/sql/Driver.html#getParentLogger()">Driver.getParentLogger()</a> that returns a<a href="http://download.java.net/jdk7/docs/api/java/util/logging/Logger.html">java.util.logging.Logger</a>. <a href="http://download.oracle.com/javase/7/docs/api/javax/sql/CommonDataSource.html">CommonDataSource</a> gets the <a href="http://download.oracle.com/javase/7/docs/api/javax/sql/CommonDataSource.html#getParentLogger()">same new method</a>.</li>
</ul>
</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/io/File.html#toPath()">File.toPath()</a> provides a <a href="http://download.java.net/jdk7/docs/api/java/nio/file/Path.html">java.nio.file.Path</a>.</li>
<li>There are several new classes and interfaces related to security:
<ul>
<li>The new <a href="http://download.java.net/jdk7/docs/api/java/security/AlgorithmConstraints.html">java.security.AlgorithmConstraints</a> interface &#8220;specifies constraints for cryptographic algorithms, keys (key sizes), and other algorithm parameters.&#8221;</li>
<li>The new <a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertificateRevokedException.html">CertificateRevokedException</a> &#8221;indicates an X.509 certificate is revoked.&#8221;</li>
<li><a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.html">CertPathValidatorException</a> got a <a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.html#CertPathValidatorException(java.lang.String, java.lang.Throwable, java.security.cert.CertPath, int, java.security.cert.CertPathValidatorException.Reason)">new constructor</a> that accepts an implementation of the new nested <a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.Reason.html">CertPathValidatorException.Reason</a> interface as a parameter and there is a method to <a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.html#getReason()">get this reason</a>. The new<a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.BasicReason.html">CertPathValidatorException.BasicReason</a> enum implements the<a href="http://download.java.net/jdk7/docs/api/java/security/cert/CertPathValidatorException.Reason.html">CertPathValidatorException.Reason</a> interface and &#8220;enumerates the potential reasons that a certification path of any type may be invalid.&#8221;</li>
</ul>
</li>
<li>The new <a href="http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html">invokedynamic</a> feature requires new support:
<ul>
<li>The new <a href="http://download.java.net/jdk7/docs/api/java/dyn/InvokeDynamicBootstrapError.html">java.dyn.InvokeDynamicBootstrapError</a> is thrown &#8220;to indicate that an<a href="http://java.sun.com/developer/technicalArticles/DynTypeLang/index.html">invokedynamic</a> instruction&#8221; has had some sort of problem (not found or other problem). The <a href="http://download.oracle.com/javase/7/docs/api/java/dyn/MethodHandle.html">MethodHandle</a> class and related functionality are further described in <a href="http://www.java7developer.com/blog/?p=191">A glimpse at MethodHandle and its usage</a>.</li>
<li>There is a new reflection exception called <a href="http://download.oracle.com/javase/7/docs/api/java/dyn/WrongMethodTypeException.html">WrongMethodTypeException</a>.</li>
</ul>
</li>
<li>Two new methods have been added to <a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html">Throwable</a> to support the new <a href="http://blogs.sun.com/darcy/entry/project_coin_try_out_try">try-with-resources</a>feature: <a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)">addSuppressed(Throwable)</a> and <a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html#getSuppressed()">getSuppressed()</a>. Because both <a href="http://download.java.net/jdk7/docs/api/java/lang/Exception.html">Exception</a> and<a href="http://download.java.net/jdk7/docs/api/java/lang/Error.html">Error</a> extend <code>Throwable</code>, all exceptions and errors can support providing the suppressed exceptions as appropriate.</li>
<li><a href="http://download.oracle.com/javase/7/docs/api/java/lang/AssertionError.html">AssertionError</a> has a <a href="http://download.oracle.com/javase/7/docs/api/java/lang/AssertionError.html#AssertionError(java.lang.String, java.lang.Throwable)">new constructor</a> accepting a <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Throwable.html#getCause()">cause</a>.</li>
<li>Numerous <a href="http://openjdk.java.net/projects/jdk7/features/#client">Swing/AWT-related</a> changes.</li>
<li>Numerous <a href="http://openjdk.java.net/projects/jdk7/features/#f250">NIO-related</a> changes (<a href="http://java.sun.com/developer/technicalArticles/javase/nio/">NIO.2</a>).</li>
<li><a href="http://download.oracle.com/javase/7/docs/api/java/applet/Applet.html">Applet</a> even gets something in Java 7: <a href="http://download.oracle.com/javase/7/docs/api/java/applet/Applet.html#isValidateRoot()">Applet.isValidateRoot()</a>.</li>
<li><a href="http://openjdk.java.net/projects/jdk7/features/#f530073">New JMX features</a> include the <a href="http://download.oracle.com/javase/7/docs/api/java/lang/management/PlatformManagedObject.html">PlatformManagedObject</a> interface and the<a href="http://download.java.net/jdk7/docs/api/java/lang/management/ManagementFactory.html#getAllPlatformMXBeanInterfaces()">ManagementFactory.getAllPlatformMXBeanInterfaces()</a> method, both of which I discussed in my blog post <a href="http://marxsoftware.blogspot.com/2011/03/jdk-7-jmx-platform-management-beans.html">JDK 7 JMX Platform Management Beans: A First Peek</a>.</li>
<li>There are numerous new <a href="http://openjdk.java.net/projects/jdk7/features/#f515">concurrency support</a> constructs coming to JDK 7 above and beyond some I highlighted above.</li>
<li>The <a href="http://download.oracle.com/javase/7/docs/api/java/util/Locale.html">Locale</a> class documentation mentions &#8220;1.7&#8243; sixteen times! The 1.7 changes to the class are called out in the class&#8217;s main description. One significant method is <a href="http://download.oracle.com/javase/7/docs/api/java/util/Locale.html#toLanguageTag()">toLanguageTag()</a>that provides &#8220;a well-formed <a href="http://tools.ietf.org/html/bcp47">IETF BCP 47</a> language tag representing this locale.&#8221; The static method <a href="http://download.oracle.com/javase/7/docs/api/java/util/Locale.html#forLanguageTag(java.lang.String)">forLanguageTag(String)</a> provides an instance of Locale corresponding to the provided String representing the &#8220;specified IETF BCP 47 language tag.&#8221; The very extensive documentation for this method points out an important caveat: &#8220;there is no guarantee that toLanguageTag and forLanguageTag will round-trip.&#8221; The Java Tutorials&#8217; <a href="http://download.oracle.com/javase/tutorial/i18n/locale/create.html">Creating a Locale</a>is already updated to reflect using Java 7 features of this class. Among other things, it highlights the new nested <a href="http://download.oracle.com/javase/7/docs/api/java/util/Locale.Builder.html">Locale.Builder</a> class and the new nested <a href="http://download.oracle.com/javase/7/docs/api/java/util/Locale.Category.html">Locale.Category</a> enum.</li>
</ul>
<p><span style="color:#000000;"><span style="font-size:small;"> </span></span></p>
</div>
<p>[Source]<br />
<a href="http://weblogs.java.net/blog/otaviojava/archive/2011/08/21/welcome-java-7-part-2-jsr-334-coin-0">http://weblogs.java.net/blog/otaviojava/archive/2011/08/21/welcome-java-7-part-2-jsr-334-coin-0<br />
</a><a href="http://marxsoftware.blogspot.com/2011/03/jdk-7-new-interfaces-classes-enums-and.html">http://marxsoftware.blogspot.com/2011/03/jdk-7-new-interfaces-classes-enums-and.html</a><a href="http://weblogs.java.net/blog/otaviojava/archive/2011/08/21/welcome-java-7-part-2-jsr-334-coin-0"><br />
</a><br />
&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/997/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/997/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/997/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=997&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/09/03/welcome-to-java7-quick-tour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist</title>
		<link>http://rocksolutions.wordpress.com/2011/09/03/javax-persistence-persistenceexception-org-hibernate-persistentobjectexception-detached-entity-passed-to-persist/</link>
		<comments>http://rocksolutions.wordpress.com/2011/09/03/javax-persistence-persistenceexception-org-hibernate-persistentobjectexception-detached-entity-passed-to-persist/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 06:31:46 +0000</pubDate>
		<dc:creator>®V</dc:creator>
				<category><![CDATA[Core Java]]></category>
		<category><![CDATA[JSP/Servlets]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist]]></category>

		<guid isPermaLink="false">http://rocksolutions.wordpress.com/?p=991</guid>
		<description><![CDATA[Hi, One of the issues to get your head around in both Hibernate and JPA is how to handle detached entities. In Hibernate one has to deal with the session object and in JPA it is called the persistence context. An object when loaded in the persistence context is managed by JPA/Hibernate. You can force [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=991&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>One of the issues to get your head around in both Hibernate and JPA is how to handle detached entities. In Hibernate one has to deal with the session object and in JPA it is called the persistence context.</p>
<p>An object when loaded in the persistence context is managed by JPA/Hibernate. You can force an object to be detached (ie. no longer managed by Hibernate) by closing the EntityManager or in a more fine-grained approach by calling the detach() method.</p>
<p>So it is very time consuming to debug when you face &#8220;Detached entity&#8221; exception being thrown by JPA/HIbernate. THere are few possible things you should look for.</p>
<blockquote><p>1. See if you trying to persist or merge an entity which has the same id as another entity, and which is already present in the PersistenceContext.</p>
<p>2. See if you you&#8217;ve specified that @Id is GENERATED by Hibernate. Do not set an ID before you save/persist it. Hibernate looks at the Entity you&#8217;ve passed in and assumes that because it has its PK populated that it is already in the database.<br />
save() and persist() do almost the same things with slightly different semantics . persist() is JPA compliant and save() is a carryover from the original Hibernate. Mainly, save() returns the PK and persist() does not. However, both will generate the PK before the actual SQL INSERT happens (if the PK is generated and not assigned).</p></blockquote>
<p>One workaround I did to solve this was to first find and then save the entity. See below example.</p>
<blockquote><p>@PersistenceContext(unitName = &#8220;JPAUnit&#8221;)<br />
private EntityManager em;</p>
<p>public void saveDetails(EntityManager em, User user){<br />
em.find(User.class, user.getId());<br />
em.persist(user);</p>
<p>}</p></blockquote>
<p>&#8211;<br />
Thanks<br />
R Vashi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rocksolutions.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rocksolutions.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rocksolutions.wordpress.com/991/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rocksolutions.wordpress.com&amp;blog=12571308&amp;post=991&amp;subd=rocksolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rocksolutions.wordpress.com/2011/09/03/javax-persistence-persistenceexception-org-hibernate-persistentobjectexception-detached-entity-passed-to-persist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cafe0f986ef35724efc78470c8a050a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rocksolutions</media:title>
		</media:content>
	</item>
	</channel>
</rss>
