<?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>J2EE architectures</title>
	<atom:link href="http://molteni.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://molteni.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 12 Jan 2012 22:57:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='molteni.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>J2EE architectures</title>
		<link>http://molteni.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://molteni.wordpress.com/osd.xml" title="J2EE architectures" />
	<atom:link rel='hub' href='http://molteni.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Connect to HP Quality Center using Java</title>
		<link>http://molteni.wordpress.com/2011/10/20/connect-to-hp-quality-center-using-java/</link>
		<comments>http://molteni.wordpress.com/2011/10/20/connect-to-hp-quality-center-using-java/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 14:53:16 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[HP Quality Center]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=116</guid>
		<description><![CDATA[You can access HP Quality Center using java. To do this you have to use com4j to create the wrapper classes to the OTA library. here some variables that you will use: ex. how to connect to QC: ex. how to retrieve the bug inserted bewtween 2 dates:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=116&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can access HP Quality Center using java. To do this you have to use com4j to create the wrapper classes to the OTA library.</p>
<p>here some variables that you will use:<br />
<pre class="brush: java;">
 ITDConnection connection = ClassFactory.createTDConnection();
 IBugFactory bugFactory;
 ITDFilter2 filter;
 IList bugList;
</pre><br />
ex. how to connect to QC:<br />
<pre class="brush: java;">
 private void connectQC(){
    connection.initConnectionEx(&quot;http://youradress:84/qcbin&quot;);
    connection.connectProjectEx(&quot;YOUR_DOMAIN&quot;, &quot;YOUR_PROJECT&quot;, &quot;UserName&quot;, &quot;&quot;);

      bugFactory = (IBugFactory) connection.bugFactory().queryInterface(IBugFactory.class);
      // retrieve all the fields
      IList fields = bugFactory.fields();
      filter = bugFactory.filter().queryInterface(ITDFilter2.class);
    }
</pre><br />
ex. how to retrieve the bug inserted bewtween 2 dates:<br />
<pre class="brush: java;">
public List&lt;BugLsa&gt; getBugLsa(String dateBegin, String dateEnd){
         private ITDFilter2 filter;
         private IList bugList;
         filter.clear();
         String queryString = &quot;&gt;=&quot;+dateBegin+&quot; and &lt;= &quot; + dateEnd;
         System.out.append(&quot;query: &quot; + queryString);
         filter.filter(&quot;BG_DETECTION_DATE&quot;, queryString);
         IList bugList = filter.newList());
         ...
        return result;
   }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=116&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2011/10/20/connect-to-hp-quality-center-using-java/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>JSF 2 converters and Spring services</title>
		<link>http://molteni.wordpress.com/2010/09/29/jsf-2-converters-and-spring-services/</link>
		<comments>http://molteni.wordpress.com/2010/09/29/jsf-2-converters-and-spring-services/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 08:13:47 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[Javaserver Faces]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=112</guid>
		<description><![CDATA[Problem: I&#8217;ve a JavaServer Faces 2 converter (@FacesConverter) and I&#8217;ve to access a Spring service. The converter is managed by jsf and if I use @Service or a Spring bean I&#8217;ve a null pointer exception Solution: access the Spring service using FacesContextUtils. Ex: @Override public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s) { ... if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=112&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Problem:<br />
I&#8217;ve a JavaServer Faces 2 converter (@FacesConverter) and I&#8217;ve to access a Spring service. The converter is managed by jsf and if I use @Service or a Spring bean I&#8217;ve a null pointer exception</p>
<p>Solution:<br />
access the Spring service using FacesContextUtils. Ex:</p>
<p><code><br />
 @Override<br />
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s) {<br />
  ...<br />
      if (personneService == null)<br />
          personneService = (PersonneService) FacesContextUtils.getWebApplicationContext(facesContext).getBean("personneService");<br />
   ...<br />
   }<br />
</code> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=112&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2010/09/29/jsf-2-converters-and-spring-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>VMWare Fusion 3.0.1 vs Parallels 5, benchmark results</title>
		<link>http://molteni.wordpress.com/2009/12/12/vmware-fusion-3-0-1-vs-parallels-5-benchmark-results/</link>
		<comments>http://molteni.wordpress.com/2009/12/12/vmware-fusion-3-0-1-vs-parallels-5-benchmark-results/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 23:42:05 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=82</guid>
		<description><![CDATA[I’m evaluating VMWare Fusion and Parallels 5 on my Mac OS X. Unfortunately for my job I need to have a system compatible with Windows XP and Windows 7. The laptop I used as host for the test has the following characteristics: ￼ I tested the new version of VMWare Fusion 3.0.1 (first update after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=82&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’m evaluating VMWare Fusion and Parallels 5 on my Mac OS X. Unfortunately for my job I need to have a system compatible with Windows XP and Windows 7.</p>
<p>The laptop I used as host for the test has the following characteristics:<br />
￼<img src="http://molteni.files.wordpress.com/2009/12/macosx.jpg?w=510" alt="" /></p>
<p>I tested the new version of <strong>VMWare Fusion 3.0.1</strong> (first update after the release of Parallels 5) with a default configuration (1 processor, 1GB RAM) on a fresh install of Windows 7 Ultimate 64 bit.<br />
No tuning has been done.</p>
<p>The result of the <strong>PassMark</strong> benchmark for <strong>VMWare</strong> is <strong>498.1</strong>:<br />
￼￼<img src="http://molteni.files.wordpress.com/2009/12/vmware_results1.jpg?w=510" alt="" /></p>
<p>I did the same test using <strong>Parallels 5</strong> (default configuration, 1 Processor, 1GB RAM, 256 MB Video Card), the result is <strong>577.7</strong>:<br />
￼<img src="http://molteni.files.wordpress.com/2009/12/parallels_results.jpg?w=510" alt="" /><br />
￼</p>
<p>Parallels seems still leading the performance for <strong>3D Graphics</strong>, in the complex test of 3D graphics VMWare shows between 2 and 3 fps (frames per second)<br />
￼<img src="http://molteni.files.wordpress.com/2009/12/vmware_fps.jpg?w=510" alt="" /></p>
<p>Paralles is faster with more than 10 fps<br />
￼<img src="http://molteni.files.wordpress.com/2009/12/parallels_fps.jpg?w=510" alt="" /></p>
<p>In this small test Parallels is clearly the fastest for 3D graphics.</p>
<p>The 2 products are very good, easy to use and with many options.</p>
<p>In conclusion, if you want to play 3D Windows games &#8230; buy a PC!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=82&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/12/12/vmware-fusion-3-0-1-vs-parallels-5-benchmark-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>

		<media:content url="http://molteni.files.wordpress.com/2009/12/macosx.jpg" medium="image" />

		<media:content url="http://molteni.files.wordpress.com/2009/12/vmware_results1.jpg" medium="image" />

		<media:content url="http://molteni.files.wordpress.com/2009/12/parallels_results.jpg" medium="image" />

		<media:content url="http://molteni.files.wordpress.com/2009/12/vmware_fps.jpg" medium="image" />

		<media:content url="http://molteni.files.wordpress.com/2009/12/parallels_fps.jpg" medium="image" />
	</item>
		<item>
		<title>Tutorial: use Java to develop Facebook applications</title>
		<link>http://molteni.wordpress.com/2009/04/27/tutorial-use-java-to-develop-facebook-applications-example/</link>
		<comments>http://molteni.wordpress.com/2009/04/27/tutorial-use-java-to-develop-facebook-applications-example/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:27:08 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=73</guid>
		<description><![CDATA[Create a FB application is funny and easy with Java. There are some open source libraries that can help you to achieve your goal. You find these libraires here : http://wiki.developers.facebook.com/index.php/Java I used the facebook-java-api to create this tutorial. It’s a good library but unfortunately it miss documentation (in the traditional OSS old style ) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=73&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Create a FB application is funny and easy with Java. There are some open source libraries that can help you to achieve your goal. You find these libraires here :<br />
<a href="http://wiki.developers.facebook.com/index.php/Java">http://wiki.developers.facebook.com/index.php/Java</a><br />
I used the facebook-java-api to create this tutorial. It’s a good library but unfortunately it miss documentation (in the traditional OSS old style <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )<br />
<a href="http://code.google.com/p/facebook-java-api/">http://code.google.com/p/facebook-java-api/</a><br />
I used SpringMVC as framework, it’s very easy to pass values to web pages with Spring.<br />
I created 2 pages , one for the login (index.htm) and a second page (results.htm) that shows the results :<br />
Code of the first page :<br />
<pre class="brush: java;">
IFacebookRestClient fbClient = new FacebookJsonRestClient(API_KEY, SECRET_CODE)

FacebookWebappHelper fh = new FacebookWebappHelper(request, response, API_KEY, SECRET_CODE, fbClient);
        fh.requireLogin(&quot;&quot;);
        
        if (!fh.isLogin())
            return null;
</pre><br />
The goal of this page is to login the user if is still not logged in. Is in your application configuration on Facebook that you can decide where to send the user after the succesful login.</p>
<p>The second page contains this code :<br />
<pre class="brush: java;">
protected ModelAndView handleRequestInternal(
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
  String token = ServletRequestUtils.getStringParameter(request, &quot;auth_token&quot;);
  IFacebookRestClient fbClient = new FacebookJsonRestClient(API_KEY, SECRET_CODE);
  fbClient.auth_getSession(token);

  // get your Facebook id
  Long id = fbClient.users_getLoggedInUser();
  
  // query Facebook database, ask for all friends single and give me their uid and their complete name
  JSONArray sqlResult = (JSONArray) fbClient.fql_query(&quot;SELECT uid, name FROM user WHERE  relationship_status='single' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = &quot; + id.toString() + &quot;)&quot;);

  // write the result in a List
List users = new ArrayList();
        for (int i = 0; i &lt; sqlResults.length(); i++) {
            User usr = new User();
            usr.setUid(Long.valueOf(sqlResults.getJSONObject(i).getString(&quot;uid&quot;)));
            usr.setName(sqlResults.getJSONObject(i).getString(&quot;name&quot;));
            users.add(usr);
        }

// send the result to the webpage
ModelAndView mav = new ModelAndView();
mav.addObject(&quot;users&quot;, users);
return mav;
}
}
</pre></p>
<p>This code fragment return the list of my friends single and I put this friends in an ArrayList of User (class included in facebook-java-api).<br />
Show the results in a jsp page is very easy :</p>
<p><pre class="brush: xml;">
&lt;table border=&quot;1&quot;&gt;
              &lt;tr&gt;&lt;td&gt;First name&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;/tr&gt;      
              &lt;tr&gt;&lt;td&gt;${user.uid}&lt;/td&gt; &lt;td&gt;${user.name}&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=73&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/04/27/tutorial-use-java-to-develop-facebook-applications-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Groovy has Spring bean in a JSF web application</title>
		<link>http://molteni.wordpress.com/2009/04/01/use-groovy-in-a-spring-jsf-web-application/</link>
		<comments>http://molteni.wordpress.com/2009/04/01/use-groovy-in-a-spring-jsf-web-application/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 07:25:43 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Javaserver Faces]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=55</guid>
		<description><![CDATA[It&#8217;s easy and powerful use Groovy classes in your Java web application using the Spring Framework. Here you can find a tutorial. In my last project I had to scan a complex xml file and copy the information to a database. A Java class (using org.wc3.dom.* and DocumentBuilder) did the work but the hundreds lines [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=55&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s easy and powerful use Groovy classes in your Java web application using the Spring Framework. Here you can find a tutorial.</p>
<p>In my last project I had to scan a complex xml file and copy the information to a database. A Java class (using org.wc3.dom.* and DocumentBuilder) did the work but the hundreds lines of code were complex and not easy to maintain.</p>
<p>Ex.</p>
<p><pre class="brush: java;">
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder        docBuilder        = docBuilderFactory.newDocumentBuilder();
doc = docBuilder.parse(fileName);
doc.getDocumentElement().normalize();
NodeList listOfEntries = doc.getElementsByTagName(&quot;entry&quot;);
for (int s = 0; s &lt; listOfEntries.getLength(); s++) {
  Node firstEntityNode = listOfEntries.item(s);
  if (firstEntityNode.getNodeType() == Node.ELEMENT_NODE) {
  ListEntry entry              = new ListEntry();
  Element   firstEntityElement = (Element) firstEntityNode;
  NodeList  uidList            = firstEntityElement.getElementsByTagName(&quot;uid&quot;);
  ...
</pre></p>
<p>For this reason I decided to integrate groovy in the Spring-JSF application, Groovy has the XMLSlurper class that allows to easily access an XML file like if it is a collection of classes.</p>
<p>You can see <a href="http://www.theregister.co.uk/2008/01/11/groovy_xml_part_two/" target="_blank">here</a> a tutorial for SMLSlurper.</p>
<p>In my application the role of the first Groovy class were the following:</p>
<ul>
<li>accept 2 parameters from a traditional java class (xml file address and an integer parameter)</li>
<li>process the xml file</li>
<li>use 2 existing Java classes</li>
<li>return an ArrayList of custom objects with the values found in the list</li>
</ul>
<p><strong>Tasks:</strong></p>
<p><strong>1. add the groovy jar to the libraries of your application</strong></p>
<p><strong>2. create a traditional Java Interface</strong></p>
<p><pre class="brush: java;">
package ch.genidea.checknames.importer;
import java.util.List;

import ch.genidea.checknames.model.ListEntry;
import ch.genidea.checknames.model.SourceList;

public interface Parser {
    List parse();
    void setFilename(String filename);
    void setSourceList(SourceList sourceList);
}
</pre></p>
<p>I had to declare the setters for the 2 variables to import in the groovy class.</p>
<p><strong>3. create the groovy class in the classpath</strong>. If you are using maven add it to the src/main/resources directory.</p>
<p>Ex.</p>
<p><pre class="brush: java;">
package ch.genidea.checknames.importer

import java.util.List;
import ch.genidea.checknames.model.ListEntry;
import ch.genidea.checknames.model.SourceList;

public class ParserImpl implements ch.genidea.checknames.importer.Parser{
    String filename
    List &lt;ListEntry&gt; result
    SourceList sourceList

    public List&lt;ListEntry&gt; parse(){
        def pers=new XmlSlurper().parse(new File(filename))

        List &lt;ListEntry&gt; result = new ArrayList&lt;ListEntry&gt;()
        def allEntry = pers.Entry

        allEntry.each{
                 result.add(addEntry(it))
                 it.akaList.aka.each{
                 result.add(addEntry(it))
                 }
        }
        return result
    }
    ListEntry addEntry(def it)
    {
            ListEntry entity = new ListEntry()
             entity.uid = (it.uid.text() as Integer)
             entity.sourceList=sourceList
             entity.familyName = it.lastName.text()
             entity.firstName = it.firstName.text()
             return entity
    }

    void setFilename(String filename)
    {
        this.filename = filename
    }
    void setSourceList(SourceList sourceList)
    {
        this.sourceList = sourceList
    }

}

</pre></p>
<p>In few lines the class did the same work of hundreds of lines of code of the previous implementation <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In this groovy class we use ListEntry and SourceList that are traditional java classes and we return a List&lt;ListEntry&gt; object</p>
<p><strong>4. Declare the bean in Spring</strong></p>
<p><pre class="brush: xml;">

&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
xmlns:lang=&quot;http://www.springframework.org/schema/lang&quot;
 ...
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd&quot;
...
&gt;
&lt;lang:groovy id=&quot;parser&quot; script-source=&quot;classpath:ch/genidea/checknames/importer/ParserImpl.groovy&quot; /&gt;

&lt;bean name = &quot;listImportService&quot; class=&quot;ch.genidea.checknames.lists.service.ListImportServiceImpl&quot;&gt;
&lt;property name=&quot;parser&quot; ref=&quot;parser&quot;&gt;&lt;/property&gt;
&lt;/bean&gt;

 </pre></p>
<p><strong>5. use the groovy class in your sourcecode <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p><pre class="brush: java;">
parser.setFilename(fileSource);
parser.setSourceList(sl);
List&lt;ListEntry&gt; list = parser.parse();
</pre></p>
<p>The only drawbacks I had are:</pre>
<ul>
<li>with Eclipse is not easy to debug groovy, but I used the groovyconsole to test rapidly the changes</li>
<li>4MB added using the groovy-all.jar</li>
</ul>
<p>Small issues compared to the great benefits of having less and more readable codeeasy a</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=55&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/04/01/use-groovy-in-a-spring-jsf-web-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>Test your webservices</title>
		<link>http://molteni.wordpress.com/2009/03/31/test-your-webservices/</link>
		<comments>http://molteni.wordpress.com/2009/03/31/test-your-webservices/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 22:49:20 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=53</guid>
		<description><![CDATA[During my last project I had to test the answer of some webservices (SOAP) of the application. I found SoapUI that allows to send request easily and fast. The tool is free but there is a more complete commercial version. No need to create extra code to test the results<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=53&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>During my last project I had to test the answer of some webservices (SOAP) of the application. I found <a href="http://www.soapui.org/">SoapUI</a> that allows to send request easily and fast. The tool is free but there is a more complete commercial version.</p>
<p>No need to create extra code to test the results <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/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=53&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/03/31/test-your-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>JSF and Spring Security (Acegi) using facelets</title>
		<link>http://molteni.wordpress.com/2009/03/26/jsf-and-spring-security-acegi-using-facelets/</link>
		<comments>http://molteni.wordpress.com/2009/03/26/jsf-and-spring-security-acegi-using-facelets/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 12:18:17 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Javaserver Faces]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=49</guid>
		<description><![CDATA[Two tips for the people who is fighting with these technologies: 1. Implement the login page: here you have a great tutorial that explains how to implement a login page in JSF using Spring Security in only few lines of code. 2. Somebody is implementing the tags for jsf. You can try his library : [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=49&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Two tips for the people who is fighting with these technologies:</p>
<p>1. Implement the login page: <a href="http://ocpsoft.com/java/acegi-spring-security-jsf-login-page/">here</a> you have a great tutorial that explains how to implement a login page in JSF using Spring Security in only few lines of code. </p>
<p>2. Somebody is implementing the tags for jsf. You can try his library : <a href="http://faces.eti.br/2008/11/09/bodyguard-facelets-el-functions-for-spring-security/">BodyGuard</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=49&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/03/26/jsf-and-spring-security-acegi-using-facelets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring MVC 3.0</title>
		<link>http://molteni.wordpress.com/2009/03/11/spring-mvc-30/</link>
		<comments>http://molteni.wordpress.com/2009/03/11/spring-mvc-30/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 08:37:22 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=42</guid>
		<description><![CDATA[I found two interesting presentations of Spring MVC 3 (part of Spring Framework, still in RC phase) Slides and a second presentation in pdf The big improvement is the full support of REST and logical URI parameters. Spring EL is now available and there is no more dependency with other EL libraries (JBoss and OSGI).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=42&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found two interesting presentations of Spring MVC 3 (part of Spring Framework, still in RC phase)<br />
<a href="http://www.slideshare.net/kensipe/spring-mvc-code-mash09-presentation">Slides</a><br />
 and a second presentation in <a href="www.devnexus.com/presentations/WhatsNewInSpring3.pdf">pdf</a><br />
<br />
The big improvement is the full support of REST and logical URI parameters. Spring EL is now available and there is no more dependency with other EL libraries (JBoss and OSGI).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=42&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/03/11/spring-mvc-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>JPA: lazy loading for lazy developers, the performance issue</title>
		<link>http://molteni.wordpress.com/2009/03/09/jpa-performance-inser/</link>
		<comments>http://molteni.wordpress.com/2009/03/09/jpa-performance-inser/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 16:17:01 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=38</guid>
		<description><![CDATA[I found and interesting article about loading and reading data with JPA. There are performance issues when you want to insert 1&#8217;000 or 10&#8217;000 records in the database. Before ORM life was complicated &#8230; 25 lines of code to insert a line in the database, not it&#8217;s easier: entityManager.persist(object)! The frameworks (Hibernate, Toplink &#8230;) do [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=38&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found and <a href="http://terrazadearavaca.blogspot.com/2008/12/jpa-implementations-comparison.html">interesting article</a> about loading and reading data with JPA. There are performance issues when you want to insert 1&#8217;000 or 10&#8217;000 records in the database.<br />
Before ORM life was complicated &#8230; 25 lines of code to insert a line in the database, not it&#8217;s easier: entityManager.persist(object)!<br />
The frameworks (Hibernate, Toplink &#8230;) do all the work and they do very well the work. The problem with JPA is that we cannot flush the session like in hibernate and send 50 or 100 records in a block to the DB. JPA send and retrieve each object in a transaction. Inserting 10&#8217;000 records takes minutes &#8230; 1&#8217;000&#8217;000 hours.<br />
The solution is to use direcly JDBC, ETL product or frameworks (Spring Batch, &#8230;).<br />
JPA is something great but it cannot manage everything <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  no party for the lazy developers &#8230; yet!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=38&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/03/09/jpa-performance-inser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
		<item>
		<title>Give to your client a dedicated J2EE server in ASP mode</title>
		<link>http://molteni.wordpress.com/2009/03/09/give-to-your-client-a-dedicated-j2ee-server-in-asp-mode/</link>
		<comments>http://molteni.wordpress.com/2009/03/09/give-to-your-client-a-dedicated-j2ee-server-in-asp-mode/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 14:58:54 +0000</pubDate>
		<dc:creator>molteni</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://molteni.wordpress.com/?p=33</guid>
		<description><![CDATA[In my last project we had to sell ASP solutions to client. The software works on our servers and the clients have to connect remotely. The projet has been launced by a small non-IT company, mantain a Server Park for them is not possible. For this reason we opted for dedicated server managed by exernal [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=33&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last project we had to sell ASP solutions to client. The software works on our servers and the clients have to connect remotely.<br />
The projet has been launced by a small non-IT company, mantain a Server Park for them is not possible. For this reason we opted for dedicated server managed by exernal service provider.</p>
<p>The problem of this solution is that one server is very expensive and the approach to create multiple instances of Tomcat, mysql, &#8230; is a big risk in case of problem of one instance and it&#8217;s complicated in the configuration phase.</p>
<p>The solution adopted is to install VMWare Server (you can do the same with Virtuozzo, XEN, &#8230;) and install an Ubuntu VM for each client. Ubuntu has a server edition conceived for the VMs (<a href="http://www.ubuntu.com/products/whatisubuntu/serveredition/jeos">Ubuntu JEOS</a>). It needs only 128MB ram and 200 MB HD. We used Tomcat 6 (thanks Spring!!!) for this product (max 200MB for instance). 512 MB dedicated for each VM is largely sufficient.</p>
<p>Each client has a different ip port to connect to the appication. Configuring the nat.conf of VMWare on the server we can easily redirect the client request to his &#8216;dedicated server&#8217;. On a typical server with 4GB of ram we can install 8 VMs reducing the costs for us and the client.</p>
<p>A big advantage is the possibility to create locally the VM and transfer it to the &#8216;production&#8217; when it&#8217;s ready copying the files. The maintenance is easier because when we have to upgrade the version we can redirect the port to a different VM with the updated product. This last options is not implemented yet because we preferred to maintain the DB server in the VM with tomcat. In the future (after benchmarks) it could be interesting to install a &#8216;service&#8217; VM with the DB and access it directly from the VMs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/molteni.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/molteni.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/molteni.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=molteni.wordpress.com&amp;blog=1290306&amp;post=33&amp;subd=molteni&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://molteni.wordpress.com/2009/03/09/give-to-your-client-a-dedicated-j2ee-server-in-asp-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e899bd90e87966872ba067033d4de4a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">molteni</media:title>
		</media:content>
	</item>
	</channel>
</rss>
