<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>glassfish &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/glassfish/</link>
	<description>Feed of posts on WordPress.com tagged "glassfish"</description>
	<pubDate>Sun, 12 Oct 2008 08:11:00 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[SUN GlassFish - O application server open que faltava!]]></title>
<link>http://tibr.wordpress.com/?p=85</link>
<pubDate>Fri, 10 Oct 2008 15:48:40 +0000</pubDate>
<dc:creator>frankbastos</dc:creator>
<guid>http://tibr.it.wordpress.com/2008/10/10/sun-glassfish-o-application-server-open-que-faltava/</guid>
<description><![CDATA[
Finalmente a alternativa que faltava chegou a nossos ambientes. O glassfish, servidor de aplicaçõ]]></description>
<content:encoded><![CDATA[<p><a href="http://tibr.wordpress.com/files/2008/10/open_projectglassfish_rtnav.gif"><img class="aligncenter size-full wp-image-83" title="open_projectglassfish_rtnav" src="http://tibr.wordpress.com/files/2008/10/open_projectglassfish_rtnav.gif" alt="" width="170" height="82" /></a><a href="http://tibr.wordpress.com/files/2008/10/l2_dukeforglassfishv2.gif"><img class="alignright size-full wp-image-84" title="l2_dukeforglassfishv2" src="http://tibr.wordpress.com/files/2008/10/l2_dukeforglassfishv2.gif" alt="" width="100" height="88" /></a></p>
<p style="text-align:justify;">Finalmente a alternativa que faltava chegou a nossos ambientes. O glassfish, servidor de aplicações da sun inspirado no famoso pacote SunOne tomou a frente dos produtos open source e salvou a vida de nós desenvolvedores.</p>
<p style="text-align:justify;">Com recursos interessantes, alto poder de processamento e grande facilidade de configuração, instalação e uso, promete ser o melhor dos produtos deste genero este ano.</p>
<p style="text-align:left;">Confira em.: http://java.sun.com/javaee/community/glassfish/</p>
<p>Disponível para quase todas as plataformas incluindo MAC.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[goodbye 'struts-spring-hibernate' and welcome 'jsf-ejb-jpa']]></title>
<link>http://nohnit.wordpress.com/2008/10/08/goodbye-struts-spring-hibernate-and-welcome-jsf-ejb-jpa/</link>
<pubDate>Wed, 08 Oct 2008 20:01:15 +0000</pubDate>
<dc:creator>echo</dc:creator>
<guid>http://nohnit.it.wordpress.com/2008/10/08/goodbye-struts-spring-hibernate-and-welcome-jsf-ejb-jpa/</guid>
<description><![CDATA[Walaupun kebanyakan sekarang orang menggunakan Struts1/2 untuk presentation layer, dan Spring untuk ]]></description>
<content:encoded><![CDATA[<p><img style="border-width:0;" height="128" alt="prefs" src="http://nohnit.files.wordpress.com/2008/10/prefs.png" width="128" align="left" border="0">Walaupun kebanyakan sekarang orang menggunakan Struts1/2 untuk presentation layer, dan <a title="Situs Spring" href="http://www.springframework.org/" target="_blank">Spring</a> untuk busines layer, dan <a title="Situs Hibernate" href="http://www.hibernate.org/" target="_blank">Hibernate</a> untuk persistence layer, tapi sekarang saya mau migrasi ke <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> untuk presentation layer, dan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> untuk busines layer, dan JPA untuk persistence..</p>
<p>"<em>mengapa?"</em></p>
<p>tentunya saya punya alasan tersendiri :D</p>
<p>tapi alasan saya belum tentu bagus untuk anda, dan alasan anda belum tentu bagus juga untuk saya :D</p>
<p><!--more-->
<p>walaupun saya sudah migrasi dari <a href="http://struts.apache.org/" target="_blank">Struts1</a> ke <a href="http://struts.apache.org/2.x/" target="_blank">Struts2</a> trus akhirnya ke <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> sudah lama, tapi pura-puranya saya baru migrasi sekarang :D , hehehe.</p>
<h2>JSF</h2>
<p>saya pindah dari <a href="http://struts.apache.org/" target="_blank">struts1</a>--&#62;<a href="http://struts.apache.org/2.x/" target="_blank">struts2</a> dan akhirnya ke <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> karena ketika pertama kali saya belajar JSF disitu saya melihat ada kesamaan antara konsep <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> dan Swing. yaitu berbasis komponen. sehingga hal ini membuat pembuatan halaman web sangat mudah karena berbasiskan komponen, artinya kita membuat halaman web seperti mendesain form dalam aplikasi desktop :D</p>
<p>dan selain itu <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> juga mendukung <a href="http://en.wikipedia.org/wiki/Dependency_Injection_" target="_blank">Dependency Injection </a>yang mencakup scope untuk aplikasi website seperti request, session dan application :D , sehingga ini bisa digunakan sebagai pengganti DI-nya milik Spring :D</p>
<h2>EJB</h2>
<p>namun untuk total migrasi dari Spring ke <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> secara total mungkin baru sekarang ini, walaupun pertamanya saya belajar <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> lalu <a title="Situs Spring" href="http://www.springframework.org/" target="_blank">Spring</a> dan sekarang saya balik lagi ke <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> :D</p>
<p>sebenarnya banyak orang enggan menggunakan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> karena dulu ketika <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> masih versi 2.x, <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> dikatakan sebagai nighmare (mimpi buruk) bagi pengembang, entah saya juga kurang tahu karena saya mempelajari EJB sejak versi 3, dan menurut cerita penggunaan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> 2.x sangat komplex dan memakan resource yang boros. :D</p>
<p>dan untungnya, pihak pengembang tidak putus asa dengan kegagalan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> 2.x, sehingga sekarang saya bisa menikmati kemudahan dan kehebatan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> 3.0 (yang katanya sebentar lagi mau keluar <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> 3.1) :D</p>
<p>Sebenarnya, kemampuan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> tidak terlalu dapat dibanggakan dengan <a title="Situs Spring" href="http://www.springframework.org/" target="_blank">Spring</a> Framework yang udah begitu banyak, namun disini saya menitik beratkan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> dan Spring sebagai busines layer, bukan yang lainnya. </p>
<p>satu hal yang menjadi daya tarik <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> adalah kemampuan Injectionnya yang hanya dengan menggunakan annotation @EJB, tanpa melakukan konfigurasi seperti di <a title="Situs Spring" href="http://www.springframework.org/" target="_blank">Spring</a>. hal ini memudahkan kita untuk memanggil komponen <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> secara langsung tanpa harus menginjeknya lewat metode setter atau lewat konstruktor seperti yang dilakukan Spring.</p>
<p>Namun harus di perhatikan jika <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> hanya dapat berjalan pada server yang mendukung JEE, sehingga jika kita menggunakan server seperti <a title="Situs Apache Tomcat" href="http://jakarta.apache.org/tomcat" target="_blank">Tomcat</a> dan <a title="Situs Glassfish" href="https://glassfish.dev.java.net/" target="_blank">GlassFish</a> v.3, maka <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> tak akan berjalan karena server-server tersebut hanya digunakan untuk WebServer, so untuk menjalankan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> kita perlu menggunakan server seperti <a title="Situs JBoss" href="http://www.jboss.org/" target="_blank">JBoss</a> ato <a title="Situs Glassfish" href="https://glassfish.dev.java.net/" target="_blank">GlassFish</a> v.2</p>
<h2>JPA</h2>
<p>jpa sebenarnya merupakan spesifikasi yang tergabung dalam EJB yang dinamakan EJB-Entity. namun JPA tidak selalu harus berjalan bersama EJB, karena JPA juga dapat berjalan dalam aplikasi desktop ato web sama seperti Hibernate ato TopLink.</p>
<p>Sebenarnya JPA bukanlah sebuah framework untuk persistence, tapi merupakan spesifikasi seperti JDBC, sehingga untuk menjalankan JPA kita memerlukan implementasinya seperti menggunakan <a href="http://www.oracle.com/technology/products/ias/toplink/index.html" target="_blank">TopLink</a>, <a title="Situs Hibernate" href="http://www.hibernate.org/" target="_blank">Hibernate</a>, <a href="http://www.eclipse.org/eclipselink/" target="_blank">EclipseLink</a>, <a href="http://openjpa.apache.org/" target="_blank">OpenJPA</a>, KODO dan yang lainnya.</p>
<p>sehingga JPA bisa dikatakan sebagai JDBC tingkat tinggi :D (ngarang), karena emang penggunaannya sangat mudah dari pada JDBC dan hampir mirip seperti <a title="Situs Hibernate" href="http://www.hibernate.org/" target="_blank">Hibernate</a>.</p>
<p>hanya saja karena JPA merupakan spesifikasi yang bisa diimplementasi oleh berbagai framework, sehingga bisa dibilang JPA kurang komplete jika dibandingkan dengan Hibernate, terutama dalam hal Query.</p>
<p>namun alasan kenapa saya memilih JPA karena hal pertama adalah JPA merupakan kesatuan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>, sehingga penggunaannya sangat mudah dengan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>, dan selain itu dengan bantuan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> proses transaksi untuk JPA jadi mudah karena kita tak perlu memikirkan "TRANSACTION" untuk proses-proses persistence yang kita lakukan karena semuanya di handle langsung oleh <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>.</p>
<p>Dan yang paling bermanfaat adalah JPA dapat diinjek hanya dengan menggunakan annotation @PersistenceContext atau @PersistenceUnit, sehingga penggunaannya semakin mudah, dan hal ini tanpa bantuan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> ato <a title="Situs Spring" href="http://www.springframework.org/" target="_blank">Spring</a>, sehingga andai kita tak menggunakan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>, kita tetap bisa melakukan injeksi ke JPA</p>
<h2>Facelets + SEAM</h2>
<p><a href="https://facelets.dev.java.net/" target="_blank">Facelets</a> dan <a href="http://www.seamframework.org/" target="_blank">SEAM</a> merupakan framework yang patut digunakan jika kita menggunakan <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a>+<a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>+JPA, karena : </p>
<p>dengan <a href="https://facelets.dev.java.net/" target="_blank">facelets</a> kita dapat dengan mudah menkoneksikan antara JSP dan JSF yang kadang ditemukan berbagai kendala seperti dalam "<em>ExpressionLanguage</em>" misalnya. dan selain itu dengan <a href="https://facelets.dev.java.net/" target="_blank">facelets</a>, pembuatan halaman web dapat berbasiskan template, sehingga mempermudah pembuatan halaman web ketika kita memerlukan halaman yang banyak namun memiliki kesamaan layout.</p>
<p>dengan <a href="http://www.seamframework.org/" target="_blank">SEAM</a>, kita dapat dengan mudah mengintregasikan antara <a href="http://java.sun.com/javaee/javaserverfaces/" target="_blank">JSF</a> dan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>, dan selain itu <a href="http://www.seamframework.org/" target="_blank">SEAM</a> mendukung facelets dan <a href="http://www.seamframework.org/" target="_blank">SEAM</a> juga memiliki kemampuan yang banyak seperti kemampuan untuk menampilkan Chart, kemampuan membangun RSS, integrasi untuk Email, dan lainnya. Dan semua itu berbasiskan JSF dan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a>, sehingga <a href="http://www.seamframework.org/" target="_blank">SEAM</a> akan membuat pengguna JSF dan <a href="http://java.sun.com/products/ejb/" target="_blank">EJB</a> lebih termanjakan, hahahaha :D</p>
<p>&#160;</p>
<p><strong><em>tapi tidak selamanya pendapat saya sesuai dengan keinginan anda bukan?</em></strong></p>
<p><strong><em>itu tergantung selera :D</em></strong></p>
<p><strong><em>see you!!!</em></strong></p>
<hr>
<blockquote>
<p><a href="http://java.sun.com/products/ejb/" target="_blank">http://java.sun.com/products/ejb/</a></p>
<p><a href="https://facelets.dev.java.net/" target="_blank">https://facelets.dev.java.net/</a></p>
<p><a href="http://www.seamframework.org/" target="_blank">http://www.seamframework.org/</a></p>
<p><a title="Situs Hibernate" href="http://www.hibernate.org/" target="_blank">http://www.hibernate.org/</a></p>
<p><a title="Situs Spring" href="http://www.springframework.org/" target="_blank">http://www.springframework.org/</a></p>
<p><a href="http://struts.apache.org/" target="_blank">http://struts.apache.org/</a></p>
<p><a href="http://struts.apache.org/2.x/" target="_blank">http://struts.apache.org/2.x/</a></p>
</blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Student Reviews Contest]]></title>
<link>http://sunkth.wordpress.com/?p=167</link>
<pubDate>Mon, 06 Oct 2008 09:17:16 +0000</pubDate>
<dc:creator>sunkth</dc:creator>
<guid>http://sunkth.it.wordpress.com/2008/10/06/student-reviews-contest-2/</guid>
<description><![CDATA[MySQL 5.1 Community Edition and GlassFish Application Server v2 Update Release 2 (UR2) application s]]></description>
<content:encoded><![CDATA[<p><a href="http://sunkth.files.wordpress.com/2008/10/kth_contest.jpg"><img class="alignleft size-thumbnail wp-image-168" title="kth_contest" src="http://sunkth.wordpress.com/files/2008/10/kth_contest.jpg?w=128" alt="" width="128" height="96" /></a><a href="http://dev.mysql.com/downloads/mysql/5.1.html">MySQL 5.1 Community Edition </a>and <a href="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">GlassFish Application Server v2 Update Release 2 (UR2)</a> application server are now available to download. We're pretty excited about these products, but we want to know how you, the student developers, can develop useful applications using the new features of these products.<br />
Use MySQL database and GlassFish application server to develop a web application and write a review for...<br />
* A chance to win a grand prize of $500 in Visa debit card, and<br />
* Five chances to win a prize of $250 in Visa debit card</p>
<p><strong>Simply:</strong><br />
1. Download MySQL 5.1 Community Edition and GlassFish v2 Update Release 2 (UR2).<br />
2. Develop a cool web application using the combination.<br />
3. Create a project of your application at java.net.<br />
4. Write a review of these products and post it in your blog.<br />
5. Submit your java.net project's URL and your review's URL.<br />
6. Do it before October 22, 2008.</p>
<p><strong>How to Enter</strong></p>
<p><strong>To participate, do the following:</strong><br />
1. Develop an innovative web application that uses MySQL 5.1 Community Edition database and GlassFish v2 UR2 application server. You can develop in any of the following languages: Java, PHP, Python, or Ruby. You must submit complete source code of the application, user documentation, developer/administrator documentation including application installation instructions, and appropriate executables. You must make all these deliverables available as a project at <a href="http://www.java.net/request_project.csp">java.net</a>. Provide your project's URL in the Submission Form below.</p>
<p>2. Write reviews of MySQL 5.1 Community Edition database and GlassFish v2 UR2 application server based on your experiences as you developed the web application. You must post the review in a blog or on a web page, and you must provide the corresponding URL in the Submission Form below.</p>
<p>The developed application and the reviews must be new material that you have written and not copied from something that you or others have already developed or published.</p>
<p>Finally, complete the submission form, and if you have any questions, <a href="https://www2.sun.de/dct/forms/reg_us_2908_490_0.jsp">submit a contact request</a>.</p>
<p><strong>Deadline</strong><br />
Contest starts: September 2, 2008<br />
Submission deadline: October 22, 2008<br />
Judging period: October 23 - November 20, 2008</p>
<p>Winners announced: November 21, 2008</p>
<p>For more information please look at <a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp">here</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Glassfish Virtual Server]]></title>
<link>http://hobione.wordpress.com/?p=159</link>
<pubDate>Thu, 02 Oct 2008 22:06:27 +0000</pubDate>
<dc:creator>hobione</dc:creator>
<guid>http://hobione.it.wordpress.com/2008/10/02/glassfish-virtual-server/</guid>
<description><![CDATA[Scenario: We are running Glassfish on our production server as the default mode.  Here is a screen ]]></description>
<content:encoded><![CDATA[<p><strong><span style="color:#ff99cc;">Scenario</span></strong>: We are running Glassfish on our production server as the default mode.  Here is a screen shot for the default serve.</p>
[caption id="attachment_154" align="alignnone" width="300" caption="Glassfish default server"]<a href="http://hobione.files.wordpress.com/2008/10/defaultsetup1.jpg"><img class="size-medium wp-image-154" title="defaultsetup1" src="http://hobione.wordpress.com/files/2008/10/defaultsetup1.jpg?w=300" alt="Glassfish default server" width="300" height="158" /></a>[/caption]
<p>The ip for the server, 172.25.133.69 which alias to http://nas.amc.xxx.gov and Default Web Module is "Root" app.</p>
<p><strong><span style="color:#ff0000;">Dilemma</span></strong>: We wanted to set up a virtual server for a new URL, http://idms.amc.xxx.gov and register the Default Web Module to " iDMSCommingsoon" app.</p>
<p>How the world can we do that?  We are not running any Appache on top of Glassfish,  is Glassfish smart enough to figure it out which application to respond based on URL, etc.  The answer is YES. It is so easy to set that up by using Glassfish admin tool.</p>
<p><strong><span style="color:#008000;">Solutions</span></strong>:  Here are few choices I had, were recommended by Sun's Technician:<br />
"I'm sure you know this, but it bears mention now. A combo of IP+Port number can have only one process/program binding to it... thus if you have 1 IP address, any port there, can be "used/bound to" only once. This is true for all Web or App Servers or any Server for that matter.</p>
<p>The SJAS/Glassfish, works around this limitation by using the concept of Listeners and Virtual Servers.<br />
A Listener can be instructed to listen/respond to different domains (web domains, not App Server domains) such as www.aaa.com and www.bbb.com<br />
You can then have and configure your Virtual Servers to use those listeners.</p>
<p>Couple of scenarios you could approach.<br />
-If you have available more IP addresses, you can create another listener, assign it to use Port 80 and create your Virtual Servers to use it.<br />
Or<br />
-If you have only one IP available, you can modify existing listener to also respond to new site (idms.faa.gov) and configure the new Virtual Server to use<br />
the same listener.</p>
<p>Either way, DNS will need to be modified accordingly, whether you point 1 domain (HTTP domain, not App Server domain) to that IP or have 2 or more domains pointing to that IP (absolutely possible).</p>
<p>More about it can be seen here:<br />
http://docs.sun.com/app/docs/doc/819-3671/ablsw?a=view"</p>
<p><strong><span style="color:#800080;">This is how we have tackled this issue initially</span></strong>:<br />
1. We have aliased http://idms.amc.xxx.gov to the same ip 172.25.133.69 as the other URL has been using for years.<br />
2. We have changed few things on setting as follows.</p>
[caption id="attachment_156" align="alignnone" width="300" caption="Virtual Server Setup"]<a href="http://hobione.files.wordpress.com/2008/10/vh3.jpg"><img class="size-medium wp-image-156" title="vh3" src="http://hobione.wordpress.com/files/2008/10/vh3.jpg?w=300" alt="Virtual Server Setup" width="300" height="170" /></a>[/caption]
<p>You may notice that idms Virtual Server is using the same Listeners for other server, so they are sharing listeners.</p>
<p>3. Here is the same old way to deploy a .war but only thing I have changed is server name.</p>
[caption id="attachment_157" align="alignnone" width="300" caption="Deploy app on a Virtual Serve"]<a href="http://hobione.files.wordpress.com/2008/10/vh2.jpg"><img class="size-medium wp-image-157" title="Deploy app on a Virtual Serve" src="http://hobione.wordpress.com/files/2008/10/vh2.jpg?w=300" alt="Deploy app on a Virtual Serve" width="300" height="182" /></a>[/caption]
<p>What a surprise, it worked!<br />
Here is my lame drawing to show the big picture.<br />
<a href="http://hobione.files.wordpress.com/2008/10/vhdrawing1.jpg"><img class="alignnone size-medium wp-image-174" title="Illustrated above how to set up a virtual host in the Sun Java System Application Server" src="http://hobione.wordpress.com/files/2008/10/vhdrawing1.jpg?w=300" alt="" width="300" height="165" /></a></p>
<p><span style="color:#00ff00;"><strong>Concern</strong></span>: I have a concern about performance.   Since both URLs are using same ip and listeners, what are chances for the bottleneck when both URLs starting get many hits simultaneously.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Problems with Webservices in Netbeans and how to solve them]]></title>
<link>http://netbeansboy.wordpress.com/?p=152</link>
<pubDate>Wed, 01 Oct 2008 15:30:29 +0000</pubDate>
<dc:creator>pncblessed</dc:creator>
<guid>http://netbeansboy.com/2008/10/01/problems-with-webservices-in-netbeans-and-how-to-solve-them/</guid>
<description><![CDATA[Ok, rather than give a tutorial on web services - because there are some around, I thought I would s]]></description>
<content:encoded><![CDATA[<p>Ok, rather than give a tutorial on web services - because there are some around, I thought I would solve one of the mysterious problems that can occur when you are creating these services.</p>
<p>Netbeans is AMAZING at creating web services, the tools are incredibly rich.</p>
<p>But this error dogged me. I had one or two web services that worked and others that didn't. To set up my service I had set up some inner classes</p>
<pre>public static class dtaData {
private String Name;
private String date;
private String sid;
}</pre>
<p>then created a web services that returned a LIST of those objects:-</p>
<pre>    @WebMethod(operationName = "Data")
    public List Data() {
        List result=new ArrayList();
       for (int i=0;i&#60;20;++i) {
        dtaData DataObject=new dtaData ();
       DataObject.sid=""+i;
       result.add(Result);
     }

        
        return result;
    }
  </pre>
<p>And it falls over with this error when you test the webserver. HOWEVER The problem is caused because there is no web service DIRECTLY returning the dtaData class. The solution is to create a web service that returns null but has dtaData as the returning Object.</p>
<p>e.g.</p>
<pre>    @WebMethod(operationName = "testData")
    public dtaData testData() {
           return null;

    }
   </pre>
<p>These errors are given when the problem occurs:-</p>
<p><strong>On the glassfish server</strong></p>
<pre>Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException: class PHJ.Agenda$ICDB_Agenda_data nor any of its super class is known to this context.]
        at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:322)
        at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
        at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
        at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)</pre>
<p><strong>On the web service test return:</strong><br />
<hr />
<h3>Exceptions details : java.lang.reflect.InvocationTargetException</h3>
<hr />javax.servlet.ServletException: java.lang.reflect.InvocationTargetException at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:345) at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:121) at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:165) at javax.servlet.http.HttpServlet.service(HttpServlet.java:738) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.Ap</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Magic Build Tool Needed!!!]]></title>
<link>http://innovationstartups.wordpress.com/?p=224</link>
<pubDate>Tue, 30 Sep 2008 13:55:58 +0000</pubDate>
<dc:creator>innovationstartups</dc:creator>
<guid>http://innovationstartups.it.wordpress.com/2008/09/30/magic-build-tool-needed/</guid>
<description><![CDATA[Greetings my fellow Innovators!
Ok, lets start with WebSynergy, the very cool thing out there by the]]></description>
<content:encoded><![CDATA[<p>Greetings my fellow Innovators!</p>
<p>Ok, lets start with WebSynergy, the very cool thing out there by the colloberation of Sun, Liferay!</p>
<p>Now, our dream development package includes liferay portal + Glassfish server with lots of capabilities i.e. SAW, openESB + Netbeans IDE (I still prefer Eclipse!)+ PortalPack + Groovy DSL/Grails support + Spring + hibernate + MySQL</p>
<p>Ok, if you want to use all these into your company's project, wouldn't it be smart to think of a GEnIUS Build tool to automate getting these sources into one updated package for you to use in development or for production!!</p>
<p>I think that would be incrediably cool to have such tool inhouse while you are developing, I think this calls for a new jcp proposal!</p>
<p>what do you think?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Participate in MySQL and GlassFish Review contest and win $500]]></title>
<link>http://letmeknow.wordpress.com/?p=1070</link>
<pubDate>Sat, 27 Sep 2008 00:30:16 +0000</pubDate>
<dc:creator>Mohamed Sanaulla</dc:creator>
<guid>http://letmeknow.it.wordpress.com/2008/09/27/participate-in-mysql-and-glassfish-review-contest-and-win-500/</guid>
<description><![CDATA[Event: MySQL and GlassFish Student Review contest (Website)
Organized By: Sun Microsystems
Key Dates]]></description>
<content:encoded><![CDATA[<p><strong>Event: </strong>MySQL and GlassFish Student Review contest (<a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp" target="_blank">Website</a>)<img src="http://www.sun.com/images/e8/e8_student-reviews-contest.jpg" alt="" align="right" /></p>
<p><strong>Organized By: </strong>Sun Microsystems</p>
<p><strong>Key Dates:</strong><br />
Deadline for Submissions: October 22, 2008</p>
<p><strong>For Whom:</strong><br />
Participant must be enrolled as a student pursuing a degree in an educational institute<br />
<!--more--></p>
<p>Sun Microsystems has yet again announced the Student Review Contest. This time one has to use MySQL and GlassFish and develop a web application and then write a review on MySQL and GlassFish.</p>
<p>Download <a href="http://dev.mysql.com/downloads/mysql/5.1.html" target="_blank">MySQL 5.1 Community Edition</a> and <a href="https://glassfish.dev.java.net/downloads/v2ur2-b04.html" target="_blank">GlassFish v2 UR2</a> application server. Check them out for yourself by developing a web application. After you have a chance to use both the products, write reviews to tell the world what you think. A panel of judges will review all submissions and select the winners.</p>
<p>The contest will have <strong>two groups</strong>: one for students who are not <a href="http://developers.sun.com/students/campus_ambassadors.jsp">Sun Campus Ambassadors</a>, and another  comprising Sun Campus Ambassadors. For <span style="text-decoration:underline;">each</span> group, there will be a grand prize of $500 in Visa debit card, and five second prizes of  $250 each in Visa debit card.</p>
<p><strong>How to participate:</strong><br />
1. Develop an web application using MySQL and GlassFIsh and then host it on java.net<br />
2. Write a review on MySQL and GlassFish in your blog.</p>
<p>Use the <a href="https://www2.sun.de/dct/forms/reg_us_2005_407_0.jsp" target="_blank">Entry Submission</a> link and submit the entries.</p>
<p>More details can be found <a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp">here</a> and in the Student reviews <a href="http://blogs.sun.com/students/" target="_blank">Blog</a>.</p>
<p><em><br />
Subscribe to Geek RSS Feed <a title="Geek" href="http://feeds.feedburner.com/LetMeKnowGeek" target="_blank"><span style="color:#105cb6;">here</span></a>.</em><br />
<em> Subscribe to Let Me Know RSS Feed <a title="Let Me Know" href="http://feeds.feedburner.com/letmeknowlmk" target="_blank"><span style="color:#105cb6;">here</span></a>.</em></p>
<p><!-- AddThis Button BEGIN --><br />
<a title="Bookmark and Share" href="http://www.addthis.com/bookmark.php" target="_blank"><img src="http://s9.addthis.com/button1-share.gif" border="0" alt="Bookmark and Share" width="125" height="16" /></a><br />
<!-- AddThis Button END --></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Configuring a Glassfish/Sunapp CLUSTER Server on Windows]]></title>
<link>http://netbeansboy.wordpress.com/?p=132</link>
<pubDate>Wed, 24 Sep 2008 11:21:57 +0000</pubDate>
<dc:creator>pncblessed</dc:creator>
<guid>http://netbeansboy.com/2008/09/24/configuring-a-glassfishsunapp-server-on-windows/</guid>
<description><![CDATA[Ok, I know, in an ideal world we&#8217;d do this on Solaris but I have customers with a pile of wind]]></description>
<content:encoded><![CDATA[<p>Ok, I know, in an ideal world we'd do this on Solaris but I have customers with a pile of windows boxes so we have to work with what they have.</p>
<p><strong>Server 1 - The "Controller" (machine 1, 192.168.100.10)</strong></p>
<p>1. Install the SUN Application server make sure you select</p>
<p>- Do not require username/password<br />
- Create a windows service (otherwise it wont stay running)<br />
- Do not start the server from the INSTALLATION PROGRAM, use control panel, administration tools, services and start the service from there.</p>
<p>2. Login to the GUI <a href="http://localhost:4848">http://localhost:4848</a></p>
<p>3. Select ADD CLUSTER SUPPORT - you will have to restart the server. Do NOT do this through the windows instead restart the service - Start, Control Panel, Admin Tools, Services, find SUN APPLICATION SERVER and RESTART</p>
<p>4. Login to the GUI <a href="http://localhost:4848/">http://localhost:4848</a> - Click on CREATE NEW CLUSTER</p>
<p>Enter the name and click OK now the cluster has been created (in this case i'll use cluster1)</p>
<p>5. Create the first NODE. (this has to be done at the dos prompt)</p>
<p>Start, RUN, CMD, OK</p>
<p><strong>cd \Sun\appserver\bin&#60;ENTER&#62;</strong></p>
<p><strong>asadmin&#60;ENTER&#62;</strong></p>
<p>You will get a asadmin&#62; prompt.</p>
<p>on each machine in the cluster you have to create and start a node agent</p>
<p><strong>create-node-agent --host localhost --port 4848 nodeagent1</strong></p>
<p>create an instance for this node agent</p>
<p><strong>create-instance --host localhost --port 4848 --nodeagent nodeagent1 --cluster cluster1 instance1</strong></p>
<p>now start the node agent</p>
<p><strong>start-node-agent --syncinstances=true nodeagent1<br />
</strong>(just hit enter on the master password)</p>
<p>at this point you have created and set up the first cluster machine which will control the cluster - so all your cluster admin will be done from this machine.</p>
<p>Exit asadmin</p>
<p><strong>exit </strong></p>
<p>then exit the command box</p>
<p><strong>exit</strong></p>
<p><strong>Setting up Cluster Server clients (machine 2, 192.168.100.11)</strong></p>
<p>1. Install the SUN Application server make sure you select</p>
<p>- Do not require username/password<br />
- Create a windows service (otherwise it wont stay running)<br />
- Do not start the server from the INSTALLATION PROGRAM, use control panel, administration tools, services and start the service from there.</p>
<p>2. Login to the GUI <a href="http://localhost:4848/">http://localhost:4848</a></p>
<p>3. Select ADD CLUSTER SUPPORT - you will have to restart the server. Do NOT do this through the windows instead restart the service - Start, Control Panel, Admin Tools, Services, find SUN APPLICATION SERVER and RESTART</p>
<p>4. Create a node agent, start, run cmd ok</p>
<p>Start, RUN, CMD, OK</p>
<p><strong>cd \Sun\appserver\bin&#60;ENTER&#62;</strong></p>
<p><strong>asadmin&#60;ENTER&#62;</strong></p>
<p>You will get a asadmin&#62; prompt.</p>
<p>on each machine in the cluster you have to create and start a node agent</p>
<p><strong>create-node-agent --host 192.168.100.10 --port 4848 nodeagent2</strong></p>
<p>create an instance for this node agent</p>
<p><strong>create-instance --host 192.168.100.10 --port 4848 --nodeagent nodeagent2 --cluster cluster1 instance2</strong></p>
<p>now start the node agent</p>
<p><strong>start-node-agent --syncinstances=true nodeagent2<br />
</strong>(just hit enter on the master password)</p>
<p>at this point you have created and set up a cluster "client"</p>
<p>Exit asadmin</p>
<p><strong>exit </strong></p>
<p>then exit the command box</p>
<p><strong>exit</strong></p>
<p>Now you have your two cluster machines working.</p>
<p><strong>Deploying a Netbeans Project to the Cluster</strong></p>
<p>1. Make sure it's running locally<br />
2. Change the database settings in netbeans to point to the LIVE database if it is different and make sure it runs still<br />
3. Deploy the app to the main server in the cluster<br />
4. Login to the GUI and go through the JDBC connectors and enable them for the cluster<br />
5. Test the application in SINGLE USER mode (normally port 8080) and make sure it all works.<br />
6. Go into APPLICATIONS, MANAGE TARGETS for your app and deploy it to the cluster</p>
<p>I will be putting up a tutorial on load balancing as well shortly.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[GlassFish's ORB outgoing TLS connection issue]]></title>
<link>http://developmentonsolaris.wordpress.com/?p=9</link>
<pubDate>Sat, 20 Sep 2008 14:59:46 +0000</pubDate>
<dc:creator>kgardas</dc:creator>
<guid>http://developmentonsolaris.it.wordpress.com/2008/09/20/glassfishs-orb-outgoing-tls-connection-issue/</guid>
<description><![CDATA[One of these days I needed to make OpenPMF&#8217;s JACC adapter to connect to OpenPMF Policy Reposit]]></description>
<content:encoded><![CDATA[<p>One of these days I needed to make <a href="http://www.objectsecurity.com/en-products-openpmf.html">OpenPMF's</a> JACC adapter to connect to OpenPMF Policy Repository using TLS-based connection. Since Policy Repository (PRd) is one of the central pieces of the OpenPMF runtime holding all the policies representations, it's quite important to secure access to it. It's basically done by enforcing access control on the policies and using TLS-based connections with mutual authentication so we knows exactly who is calling what. The problem is that while testing latest GlassFish 2.1 with secured PRd it kind of refused to work. When digging deeper it looks like GlassFish's ORB does not like PRd's IOR. Whatever I did it still connected using clear text IIOP protocol instead of using IIOP over TLS. Since I spent quite a lot of time debugging this issue with no result at all, I've given up on using GlassFish's ORB for the task and used <a href="http://jacorb.org">JacORB</a> instead. This proofed to be good combination: GlassFish's ORB for all the tasks except serving of the OpenPMF's Policy Enforcement Point and policy loading from the PRd. Here JacORB is used. The trick is well known and code might looks like:<br />
<code><br />
        Properties p = new Properties();<br />
        p.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");<br />
        p.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");<br />
        // let's modify system properties as required by JacORB<br />
        String home = System.getProperty("com.sun.aas.installRoot");<br />
        System.setProperty("jacorb.home", home);<br />
        String keystore = System.getProperty("javax.net.ssl.keyStore");<br />
        System.setProperty("jacorb.security.keystore", keystore);<br />
        System.setProperty("jacorb.security.keystore_password", "changeit");<br />
        orb = ORB.init(args, p);<br />
</code><br />
You will also need to create etc directory inside GlassFish's home directory and put jacorb.properties file inside. What you configure depends on your needs, I usually use something like:<br />
<code><br />
jacorb.security.support_ssl=on<br />
jacorb.security.ssl.client.supported_options=60<br />
jacorb.security.ssl.client.required_options=0<br />
jacorb.ssl.socket_factory=org.jacorb.security.ssl.sun_jsse.SSLSocketFactory<br />
jacorb.ssl.server_socket_factory=org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory<br />
jacorb.security.jsse.trustees_from_ks=on<br />
</code><br />
Also do not forget to place all the required JacORB jars into the lib directory and change processLuncher.xml accordingly!</p>
<p>PS: the issue is also discussed in this thread on the GlassFish forum <a href="http://forums.java.net/jive/thread.jspa?messageID=300522&#38;#300522">here.</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[JBoss versus GlassFish]]></title>
<link>http://sangmane.wordpress.com/?p=88</link>
<pubDate>Thu, 11 Sep 2008 13:08:41 +0000</pubDate>
<dc:creator>sangmane</dc:creator>
<guid>http://sangmane.it.wordpress.com/2008/09/11/jboss-versus-glassfish/</guid>
<description><![CDATA[The glassfish project serves a couple different purposes.
It is a Java EE 5 implementation, like JBo]]></description>
<content:encoded><![CDATA[<p>The glassfish project serves a couple different purposes.</p>
<p>It is a Java EE 5 implementation, like JBoss.</p>
<p>It is the reference implementation of Java EE 5.</p>
<p>While those two sentences look very similar, there are huge differences between them.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Learning Web Service 3]]></title>
<link>http://takechan.wordpress.com/?p=207</link>
<pubDate>Mon, 08 Sep 2008 20:37:52 +0000</pubDate>
<dc:creator>Take chan</dc:creator>
<guid>http://takechan.it.wordpress.com/2008/09/08/learning-web-service-3/</guid>
<description><![CDATA[I just leave my current problem and decided to generate web service code from myarch’s wsdl file w]]></description>
<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">I just leave my current problem and decided to generate web service code from myarch’s wsdl file with NetBean IDE. It generated it without problems. I verified it good, too. Now, when I try to deploy it with glassfish server, I got an exception error. Deploy build says successful, but glassfish server’s output show the failure of deployment. Considering my skill<span>  </span>and knowledge, there is no way to solve this exception. I decided to move back to the Metro’s basic example and try to make myarch’s example run. Let’s what will happen.</span><span style="font-family:&#34;" lang="JA">　</span><span style="font-family:Times New Roman;">One thing I noticed at verify was that it said this web service uses JAX-RPC although wsdl uses document/literal style. It is strange.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:&#34;" lang="JA">前回のブログの問題はおいといて、</span><span style="font-family:Times New Roman;">NetBean IDE</span><span style="font-family:&#34;" lang="JA">を使って、</span><span style="font-family:Times New Roman;">Myarch</span><span style="font-family:&#34;" lang="JA">の</span><span style="font-family:Times New Roman;">WSDL</span><span style="font-family:&#34;" lang="JA">から、</span><span style="font-family:Times New Roman;">Web Service</span><span style="font-family:&#34;" lang="JA">のコードを作成することにする。問題なくうまく作成された。ヴェリファイもうまくいく。</span><span style="font-family:Times New Roman;">Glassfish</span><span style="font-family:&#34;" lang="JA">サーバーにディプロイしようとすると、エラーが起こる。</span><span style="font-family:Times New Roman;">NetBean IDE</span><span style="font-family:&#34;" lang="JA">のディプロイ</span><span style="font-family:Times New Roman;">Build</span><span style="font-family:&#34;" lang="JA">では、成功というが、</span><span style="font-family:Times New Roman;">Glassfish</span><span style="font-family:&#34;" lang="JA">サーバーの、</span><span style="font-family:Times New Roman;">Output </span><span style="font-family:&#34;" lang="JA">には、</span><span style="font-family:Times New Roman;">Exception</span><span style="font-family:&#34;" lang="JA">エラーが見える。この問題を解くには、自分の技能は、足りないので、メトロのベーシックサンプルにもどって</span><span style="font-family:Times New Roman;">Myarch</span><span style="font-family:&#34;" lang="JA">の例を動かしてみよう。どうなるか？もうひとつ気になることは、ヴェリファイの時、</span><span style="font-family:Times New Roman;">Web</span><span style="font-family:&#34;" lang="JA">　</span><span style="font-family:Times New Roman;">Service</span><span style="font-family:&#34;" lang="JA">は、</span><span style="font-family:Times New Roman;">JAX-RPC</span><span style="font-family:&#34;" lang="JA">を使用というではないか。</span><span style="font-family:Times New Roman;">WSDL </span><span style="font-family:&#34;" lang="JA">では、</span><span style="font-family:Times New Roman;">Document/Literal</span><span style="font-family:&#34;" lang="JA">スタイルを使っているのに。</span></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[HUGE CASH PRIZES!]]></title>
<link>http://brianin3d.wordpress.com/?p=116</link>
<pubDate>Mon, 08 Sep 2008 14:55:17 +0000</pubDate>
<dc:creator>brianin3d</dc:creator>
<guid>http://brianin3d.it.wordpress.com/2008/09/08/huge-cash-prizes/</guid>
<description><![CDATA[Ok, maybe not, but I did win a little cash price for a &#8220;GAP&#8220;.. I know, I know&#8230; I d]]></description>
<content:encoded><![CDATA[<p>Ok, maybe not, but I did win a little cash price for a "<a href="http://wikis.sun.com/display/GAP/GAP+around+the+World">GAP</a>".. I know, I know... I didn't name the contest, I just submitted a winning entry.</p>
<pre>
Congratulations! Sun Microsystems is pleased to inform you that you have been selected as a
potential winner in the GlassFish Community Innovation Award Program. If your entry is verified,
as explained below, and you are confirmed to be an eligible entrant, you will be entitled to receive
a cash prize in the amount of $313.00 less applicable withholdings.
</pre>
<p>I know! "potential winner" Gee + Fancy!</p>
<p>It's still pretty cool, to get payed for something I was going to anyways</p>
<p>The bug I found in Glassfish was pretty obscure: <a href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=4759">WebSecurityManager.checkPermission NPE with custom JACC impl</a>, and pretty boring even though it may sound exciting since it was in tehe security infrastructure, I can't think of any possible way it could be exploited even if it wasn't already patched.</p>
<p>Still... I'm pretty happy about it. Not only have I gotten a ton of use out of Sun's really superior application server Glassfish. Now they are even paying me to use it!</p>
<p>Top that JBOSS! Send me $$$!!! You too WebSphere! Where is my $$$???</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[MySQL database and GlassFish application server: Student Review contest]]></title>
<link>http://sunclubatnitk.wordpress.com/?p=53</link>
<pubDate>Wed, 03 Sep 2008 05:38:16 +0000</pubDate>
<dc:creator>Mohamed Sanaulla</dc:creator>
<guid>http://sunclubatnitk.it.wordpress.com/2008/09/03/mysql-database-and-glassfish-application-server-student-review-contest/</guid>
<description><![CDATA[Sun Students Views and Review is back again with yet another contest for the students. This time the]]></description>
<content:encoded><![CDATA[<p>Sun Students Views and Review is back again with yet another contest for the students. This time th<img src="http://www.sun.com/images/e8/e8_student-reviews-contest.jpg" alt="Student Reveiw Contest" align="right" />e Moolah is huge and so also the Contest. This reivew contest is about MySQL and Glassfish application server.</p>
<p><strong>How to participate?</strong></p>
<ul>
<li>Download <a href="http://dev.mysql.com/downloads/mysql/5.1.html" target="_blank">MySQL </a>and <a href="https://glassfish.dev.java.net/downloads/v2ur2-b04.html" target="_blank">Glassfish</a>.</li>
<li>Use the to create a Web Application ( Using any Programming Language- Java ,PHP, Ruby or Python)</li>
<li>Submit complete source code of the application, user documentation, developer/administrator documentation including application installation instructions, and appropriate executables as a project at java.net</li>
<li>Write reviews of MySQL 5.1 Community Edition database and GlassFish v2 UR2 application server based on your experiences as you developed the web application.</li>
</ul>
<p><!--more--><strong>What to submit for the event?</strong></p>
<ul>
<li>Submit the Link to the java.net project</li>
<li>Submit the Blog link of the review written.</li>
</ul>
<p>Use the Submission form for both of them.</p>
<p>The contest is held in<strong> two categories</strong></p>
<ul>
<li><strong>Categrory 1:</strong> For all Sun Campus Ambassadors</li>
<li><strong>Category 2: </strong>For all Non Sun Campus Ambassadors</li>
</ul>
<p><strong>Prizes: </strong></p>
<p>Separate prizes for each category</p>
<ul>
<li>Grand prize of $500 in Visa debit card.</li>
<li>Five chances to win a prize of $250 in Visa debit card.</li>
</ul>
<p><strong>Deadline for Submitting the Contest entries: October 22, 2008</strong></p>
<p>So get started now to gift u'r self a Visa Debit Card.</p>
<p><strong>Visit the Official Contest page <a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp" target="_blank">here</a>.</strong></p>
<p><strong>Visit the blog post on Student Veiws and Reviews <a href="http://blogs.sun.com/students/date/20080902" target="_blank">here</a>.</strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Participate in MySQL-GlassFish Student Contest and Win $500]]></title>
<link>http://sunkth.wordpress.com/?p=126</link>
<pubDate>Tue, 02 Sep 2008 21:44:16 +0000</pubDate>
<dc:creator>sunkth</dc:creator>
<guid>http://sunkth.it.wordpress.com/2008/09/02/participate-in-mysql-glassfish-student-contest-and-win-500/</guid>
<description><![CDATA[


We just announced a new student contest&#8230;
Use MySQL database and GlassFish application serve]]></description>
<content:encoded><![CDATA[<table style="text-align:justify;height:131px;" border="0" cellspacing="8" cellpadding="0" width="683">
<tbody>
<tr>
<td style="vertical-align:top;text-align:justify;">We just announced a new student contest...</p>
<p>Use MySQL database and GlassFish application server to develop a web application and write a review for...</p>
<ul style="color:#0000ff;">
<li>A chance to win a grand prize of <span style="font-weight:bold;color:#ff0000;">$500</span> in Visa debit card, and</li>
<li><span style="font-weight:bold;">Five</span> chances to win a prize of <span style="font-weight:bold;color:#ff0000;">$250</span> in Visa debit card</li>
</ul>
</td>
<td style="vertical-align:top;"><a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp"><img style="border:0 solid;width:170px;height:112px;" src="http://www.sun.com/images/e8/e8_student-reviews-contest.jpg" alt="Sun Student Contest" /></a></td>
</tr>
</tbody>
</table>
<p>Simply:<br />
1. Download <a href="http://dev.mysql.com/downloads/mysql/5.1.html">MySQL 5.1 Community Edition</a> and <a href="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">GlassFish v2 Update Release 2 (UR2)</a>.<br />
2. Develop a cool web application using the combination.<br />
3. Create a project of your application at <a href="http://www.java.net/request_project.csp">java.net</a>.<br />
4. Write a review of these products and post it in your blog.<br />
5. Submit your java.net project's URL and your review's URL.<br />
6. Do it before <span style="text-decoration:underline;">October 22, 2008</span>.</p>
<p>The <a href="http://www.sun.com/student_reviews">Sun Student Reviews</a> site has all the details, so does the <a href="http://www.sun.com/products-n-solutions/reviews/studentzone/contest.jsp">contest page</a>.</p>
<p>And here is a <a href="http://blogs.sun.com/students/resource/MySQL_GF_Contest_Flier.pdf">nice flier</a> for you.</p>
<p>Good luck and have fun!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Glassfish and XML Serialization]]></title>
<link>http://erionpc.wordpress.com/?p=16</link>
<pubDate>Tue, 02 Sep 2008 14:13:22 +0000</pubDate>
<dc:creator>erionpc</dc:creator>
<guid>http://erionpc.it.wordpress.com/2008/09/02/glassfish-and-xml-serialization/</guid>
<description><![CDATA[Having worked with the .NET frameworks in Visual Studio, whenever I implemented an ASPNET web servic]]></description>
<content:encoded><![CDATA[<p style="text-align:justify;">Having worked with the .NET frameworks in Visual Studio, whenever I implemented an ASPNET web service I was used to return generalized collections of my business objects which were declared in nested layers and I never had any problems because the returned values would always be xml-serializations of my classes. However, having to work with GlassFish now I found that serialization isn't that immediate. After days of looking for documentation on this issue, I discovered that Glassfish doesn't serialize your objects unless they respect the <a title="java-beans structure" href="http://en.wikipedia.org/wiki/JavaBeans" target="_blank">java-beans structure</a> (private fields and public getters and setters) and (obviously) they need to implement the java.io.serializable interface. I also found that nested classes can't be serialized (but maybe I'm wrong).</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Silverlight and JAX-WS Web Services?]]></title>
<link>http://erionpc.wordpress.com/?p=8</link>
<pubDate>Tue, 02 Sep 2008 13:16:48 +0000</pubDate>
<dc:creator>erionpc</dc:creator>
<guid>http://erionpc.it.wordpress.com/2008/09/02/silverlight-and-jax-ws-web-services/</guid>
<description><![CDATA[This is a tough one,
for the last two days I&#8217;ve been trying to make a Silverlight client consu]]></description>
<content:encoded><![CDATA[<p style="text-align:justify;">This is a tough one,</p>
<p style="text-align:justify;">for the last two days I've been trying to make a Silverlight client consume a Glassfish JAX-WS Web Service, but without any success till a few hours ago. I tried the procedure indicated at "<a title="Calla Java EE Web service from Silverlight Client" href="http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-java-ee-web-service-from-silverlight-client.aspx" target="_blank">Call a Java EE Web service from Silverlight Client</a>" on the MSDN blogs (the only one I could find) but it didn't work. That blog post says that the solution is copying an xml file called clientaccesspolicy.xml in the docroot folder of the GlassFish domain where the web service resides. I found that when you add a GlassFish WS web reference to a Silverlight project, Visual Studio (I use the Professional 2008 version) creates a configuration file that gives compilation problems, unless you manually change the "customBinding" to "basicHttpBinding" and manually add the endpoint. When I ran the Silverlight client it launched a CommunicationException due to a "cross-domain configuration error". I had already copied the clientaccesspolicy.xml file on the docroot folder of my GlassFish domain as indicated on the msdn blog.</p>
<p style="text-align:justify;">Then, after some hours, I had the idea of <strong>creating an ASPNET Web Service which acts as a wrapper for my GlassFish WS</strong>, but I found out that neither that would work and it would launch the same exception! I started to have strong suspicions that this was a Silverlight bug. I completely erased the existing project which didn't work and created a new one, adding the web references normally (not manually). In this way it finally worked!</p>
<p style="text-align:justify;">Just out of curiosity I tried adding another web reference to the Silverlight project to my original GlassFish WS, having to change the configuration file manually as before. It not only didn't work, but it also caused the other (.NET) web service to stop working, even after I had removed it completely and had restored the configuration file to the original state. It's so ridiculous! Silverlight is good looking, but still not serious enough for interoperability.</p>
<p style="text-align:justify;">Cheers.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SSH config file to the rescue]]></title>
<link>http://dobesland.wordpress.com/?p=56</link>
<pubDate>Sun, 31 Aug 2008 22:50:09 +0000</pubDate>
<dc:creator>dobes</dc:creator>
<guid>http://dobesland.it.wordpress.com/2008/08/31/ssh-config-file-to-the-rescue/</guid>
<description><![CDATA[I&#8217;ve recently switched my hosting from single self-managed dedicated server at 1and1 to a mana]]></description>
<content:encoded><![CDATA[<p>I've recently switched my hosting from single self-managed <a title="Great prices on dedicated servers" href="http://www.1and1.com/?k_id=13285037" target="_blank">dedicated server at 1and1</a> to a managed virtual private data center on "the cloud" with ENKI consulting.  The benefits of the <a title="3tera AppLogic" href="http://3tera.com/" target="_blank">grid computing technology</a> they are using are numerous, including improved security, automatic redundant failover, and great mangement and monitoring tools.</p>
<p>As part the improved security, each component of the system (webserver, database) runs in its own virtual machine, and only has the bare minimum access to files and other services that it needs.  When setting these up, I have to ssh to each component individually.  Access is provided to the seperate components by having a different ssh port on one externally available IP address.</p>
<p>Typing in "ssh -p 7543 dobes@543.32.54.32" with varying port numbers, usernames, and IP addresses can be a pain.  Today I found out that you can specify aliases in your ssh configuration that set up connection options, hostnames, and IP addresses.</p>
<p>Simply edit ~/.ssh/config and put sections like:</p>
<p>Host glassfish-live</p>
<p>HostName 543.32.54.32</p>
<p>Port 7543</p>
<p>User dobes</p>
<p>Compression on</p>
<p>IndentityFile  ~/.ssh/id_rsa_live</p>
<p>Each time ssh finds "Host" it treats the settings that follow as specific to that host, and "HostName" tells it the "real" host to connect to.  These aliases are a great shortcut and I was so pleased to discover them I couldn't wait to share them.</p>
<p>Hope you make good use of this one ...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Java Enterprise, mulai dari mana ? (part 2 - Netbeans &amp; Glassfish)]]></title>
<link>http://suhearie.wordpress.com/?p=189</link>
<pubDate>Tue, 26 Aug 2008 08:33:03 +0000</pubDate>
<dc:creator>suhearie</dc:creator>
<guid>http://suhearie.it.wordpress.com/2008/08/26/java-enterprise-mulai-dari-mana-part-2-netbeans-glassfish/</guid>
<description><![CDATA[Artikel ini merupakan tutorial yang berisi aplikasi kalkulator sederhana dengan menggunakan arsitekt]]></description>
<content:encoded><![CDATA[<p style="text-align:justify;">Artikel ini merupakan tutorial yang berisi aplikasi kalkulator sederhana dengan menggunakan arsitektur Java EE. Jika Anda belum tahu tentang apa itu Java EE, silahkan baca <a href="http://suhearie.wordpress.com/2008/08/26/java-enterprise-mulai-dari-mana/">artikel ini terlebih dahulu</a>. Kali ini kita akan menggunakan Netbeans 6.1 sebagai IDE dan Glasshfish v2 sebagai application servernya.</p>
<p><strong>1. Download &#38; install</strong></p>
<p style="text-align:justify;">Kedua software tersebut bisa didownload sekaligus di http://download.netbeans.org/netbeans/6.1/final/. Install netbeans dan glassfish di komputer Anda dengan mengikuti wizard.</p>
<p><strong>2. Setup Project</strong></p>
<p style="text-align:justify;">Start Netbeans, pilih menu File -&#62; New Project.<br />
Pada dialog New Project, pilih categori Enterprise -&#62; Enterprise Application, klik Next.</p>
<p style="text-align:justify;"><a href="http://suhearie.files.wordpress.com/2008/08/setupproject11.jpg"><img class="alignnone size-full wp-image-234" src="http://suhearie.wordpress.com/files/2008/08/setupproject11.jpg" alt="" width="601" height="279" /></a></p>
<p style="text-align:justify;">
<p style="text-align:justify;">Masukkan nama project TestEnterpriseProject.</p>
<p style="text-align:justify;"><a href="http://suhearie.files.wordpress.com/2008/08/setupproject21.jpg"><img class="alignnone size-full wp-image-235" src="http://suhearie.wordpress.com/files/2008/08/setupproject21.jpg" alt="" width="598" height="255" /></a></p>
<p style="text-align:justify;">
<p style="text-align:justify;">Pilih Server Glassfish V2, Java EE Version 5, dan pastikan Anda mengaktifkan pilihan Create EJB Module dan Create Web Application Module, kemudian klik Finish.</p>
<p style="text-align:justify;"><a href="http://suhearie.files.wordpress.com/2008/08/setupproject32.jpg"><img class="alignnone size-full wp-image-236" src="http://suhearie.wordpress.com/files/2008/08/setupproject32.jpg" alt="" width="597" height="267" /></a></p>
<p style="text-align:justify;">Maka Netbeans akan mengcreate project TestEnterpriseProject sebagai project utama, project TestEnterpriseProject-ejb sebagai sub-project untuk modul EJB, dan TestEnterpriseProject-war sebagai sub-project untuk modul web.</p>
<p style="text-align:justify;"><!--more--></p>
<p style="text-align:justify;">Struktur project seperti tampak pada gambar berikut:</p>
<p style="text-align:justify;"><a href="http://suhearie.wordpress.com/files/2008/08/setupproject.jpg"><img class="alignnone size-full wp-image-190" src="http://suhearie.wordpress.com/files/2008/08/setupproject.jpg" alt="" width="235" height="360" /></a></p>
<p><strong>3. EJB module</strong></p>
<p>Ada 3 macam EJB dalam spesifikasi EJB versi 3.0 (EJB3) :</p>
<p style="text-align:justify;"><strong>a. Session Bean</strong><br />
Session bean adalah EJB yang digunakan untuk mengeksekusi proses. Isi dari Session Bean ini biassanya berupa kata kerja (transfer, pay, calculate, updateData, dll). Stateless Session Bean (SLSB) adalah Session Bean yang tidak menyimpan state (keadaan) pada setiap kali eksekusi. Berbeda dengan Statefull Session Bean (SFSB) yang dapat menyimpan state. State ini dapat kita gunakan misalnya untuk menyimpan informasi user atau barang-barang yang sudah dibeli (pada kasus online shop).</p>
<p style="text-align:justify;"><strong>b. Entity Bean</strong><br />
Entity Bean adalah EJB yang digunakan untuk mempermudah manipulasi database. Konsepnya adalah Object - Relational Mapping (ORM) yang berarti memetakan object dengan data di dalam database. Entity Bean sebenarnya adalah spesifikasi "bawaan" dari versi EJB sebelumnya yaitu EJB 2.1. Dalam EJB3, ada API lain yang lebih sederhana yaitu Java Persistence API (JPA). Sekarang orang lebih banyak menggunakan JPA dibandingkan Entity Bean.</p>
<p style="text-align:justify;"><strong>c. Message Driven Bean</strong><br />
Message Driven Bean (MDB) adalah EJB yang digunakan untuk keperluan messaging menggunakan Java Messaging Service (JMS).</p>
<p style="text-align:justify;">Kali ini kita akan menggunakan Stateless Session Bean. Session Bean karena kita akan melakukan pertihutang matematik, Stateless karena kita tidak perlu menyimpan informasi apapun.</p>
<p style="text-align:justify;">Klik kanan di sub-project EJB, pilih New -&#62; Session Bean. Masukkan properties berikut:<br />
EJB Name: CalculatorSession<br />
Package: suhearie.blog.enterprise.ejb<br />
Session Type: Stateless<br />
Create Interface: Local</p>
<p style="text-align:justify;"><a href="http://suhearie.files.wordpress.com/2008/08/calculatorsession1.jpg"><img class="alignnone size-full wp-image-238" src="http://suhearie.wordpress.com/files/2008/08/calculatorsession1.jpg" alt="" width="512" height="316" /></a></p>
<p style="text-align:justify;">Netbeans secara otomatis akan meng-create class CalculatorSessionBean sebagai bean class dan CalculatorSessionLocal sebagai interface. Untuk membuat Session Bean, kita membutuhkan sebuah interface dan sebuah class. Interface digunakan untuk menentukan method apa yang bisa dipanggil oleh client, sedangkan bean class merupakan implementasi dari method tersebut.</p>
<p style="text-align:justify;"><strong>Business Logic Interface - Local</strong><br />
Interface CalculatorSessionLocal diberi annotation @Local, artinya interface ini bisa diakses oleh client yang "local" atau berada dalam JVM yang sama dengan EJB server. Client yang kita gunakan adalah web component (JSP dan Servlet) yang berjalan di application server yang sama, sehingga kita cukup menggunakan Local interface. Di interface ini, kita hanya mendefinisikan satu method saja yaitu calculate yang menerima parameter-parameter berupa OPERATION, operand1 dan operand2.</p>
<p>[sourcecode language='java']<br />
package suhearie.blog.enterprise.ejb;</p>
<p>import javax.ejb.Local;</p>
<p>/**<br />
 *<br />
 * @author sarianto<br />
 */<br />
@Local<br />
public interface CalculatorSessionLocal {</p>
<p>    public enum OPERATION {ADD, SUBSTRACT, MULTIPLY, DIVIDE};</p>
<p>    public int calculate(OPERATION operation, int oper1, int oper2);</p>
<p>}<br />
[/sourcecode]</p>
<p style="text-align:justify;"><strong>Bean Class - Business Logic Implementation</strong><br />
Class CalculatorSessionBean adalah implementasi dari interface CalculatorSessionLocal. Kita menandainya dengan annotation @Stateless yang berarti kita mendefinisikannya sebagai Stateless Session Bean. Pada implementasi method calculate, kita melakukan perhitungan matematika yang sebenarnya.</p>
<p>[sourcecode language='java']<br />
package suhearie.blog.enterprise.ejb;</p>
<p>import javax.ejb.Stateless;</p>
<p>/**<br />
 *<br />
 * @author sarianto<br />
 */<br />
@Stateless<br />
public class CalculatorSessionBean implements CalculatorSessionLocal {</p>
<p>    public int calculate(OPERATION operation, int oper1, int oper2) {<br />
        switch(operation) {<br />
            case ADD:<br />
                return oper1+oper2;<br />
            case SUBSTRACT:<br />
                return oper1-oper2;<br />
            case MULTIPLY:<br />
                return oper1*oper2;<br />
            case DIVIDE:<br />
                return oper1/oper2;<br />
            default:<br />
                throw new UnsupportedOperationException("Not supported yet.");<br />
        }<br />
    }<br />
}<br />
[/sourcecode]</p>
<p><strong>4. Web Module</strong></p>
<p style="text-align:justify;">Kita akan menggunakan web sebagai user inteerface. Komponen yang akan digunakan adalah Servlet dan JSP.</p>
<p style="text-align:justify;"><strong>a. Servlet</strong><br />
Servlet adalah komponen web yang berupa java class yang mengextends javax.servlet.http.HttpServlet. Class ini biasanya digunakan untuk menangani http request, melakukan processing, kemudian memberikan hasil processing tersebut ke halaman JSP untuk ditampilkan di browser. Konsep ini disebut Model-View-Controller (MVC).</p>
<p style="text-align:justify;"><strong>b. Java Server Page (JSP)</strong><br />
JSP mirip dengan PHP atau ASP yang merupakan halaman HTML yang dapat disisipi dengan kode java (scriplet). Tujuannya untuk memudahkan developer dalam merancang user interface.</p>
<p style="text-align:justify;"><strong>File index.jsp</strong>, kita gunakan untuk membuat form html yang akan mensubmit parameter-parameter yang digunakan untuk melakukan perhitungan. Netbeans sudah menyediakan file index.jsp ini di dalam folder TestEnterpriseProject-war -&#62; Web Pages. Edit file tersebut sehingga menjadi seperti berikut. Form html disubmit ke servlet (CalculatorServlet), yang sesaat lagi akan kita buat.</p>
<p>[sourcecode language='html']<br />
<html><br />
    <head><br />
        <title>Java EE Calculator</title><br />
    </head><br />
    <body></p>
<h2>Welcome to Java EE Calculator Test Project !</h2>
<form action='<%=request.getContextPath()%>/CalculatorServlet' method='POST'><br />
            Operation:</p>
<select name="operation">
                <option selected value="ADD">ADD</option><br />
                <option value="SUBSTRACT">SUBSTRACT</option><br />
                <option value="MULTIPLY">MULTIPLY</option><br />
                <option value="DIVIDE">DIVIDE</option><br />
            </select>
<p>            Operand 1:<br />
<input type="text" name="oper1" value="0" />
<p>            Operand 2:<br />
<input type="text" name="oper2" value="0" />
<input type="submit" value="Calculate" name="Calculate" />
        </form>
<p>    </body><br />
</html><br />
[/sourcecode]</p>
<p style="text-align:justify;"><strong>Create servlet</strong>, dengan cara klik kanan di module TestEnterpriseProject-war, pilih New -&#62; Servlet. Isikan class name CalculatorServlet, dan package suhearie.blog.enterprise.servlet. Klik next, pastikan option untuk memasukkan informasi servlet ini ke file deployment descriptor diaktifkan, kemudian klik finish.</p>
<p style="text-align:justify;"><a href="http://suhearie.files.wordpress.com/2008/08/calculatorservlet1.jpg"><img class="alignnone size-full wp-image-239" src="http://suhearie.wordpress.com/files/2008/08/calculatorservlet1.jpg" alt="" width="516" height="254" /></a></p>
<p style="text-align:justify;">Modifikasi servlet tersebut menjadi seperti berikut.<br />
Di class ini kita memiliki satu class variable bertipe CalculatorSessionLocal dan memberinya annotation @EJB yang berarti application server akan meng-inject object tersebut secara otomatis ke dalam servlet kita. Konsep ini disebut dengan dependency injection. Selanjutnya, kita mengambil parameter-parameter yang dikirim melalui http request, kemudian menggunakan session bean untuk melakukan perhitungan berdasarkan parameter-parameter tersebut. Hasil perhitungan kita masukkan sebagai attribut di object request. Untuk menampilkannya, kita akan memforward request menuju ke halaman JSP CalculatorPage.jsp (kita buat sesaat lagi) menggunakan RequestDispatcher.</p>
<p>[sourcecode language='java']<br />
package suhearie.blog.enterprise.servlet;</p>
<p>import java.io.*;</p>
<p>import javax.ejb.EJB;<br />
import javax.servlet.*;<br />
import javax.servlet.http.*;<br />
import suhearie.blog.enterprise.ejb.CalculatorSessionLocal;</p>
<p>/**<br />
 *<br />
 * @author sarianto<br />
 */<br />
public class CalculatorServlet extends HttpServlet {</p>
<p>    /**<br />
    * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.<br />
    * @param request servlet request<br />
    * @param response servlet response<br />
    */<br />
    @EJB<br />
    CalculatorSessionLocal calculatorSession;<br />
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)<br />
    throws ServletException, IOException {<br />
        String operation = request.getParameter("operation");<br />
        int oper1 = Integer.parseInt(request.getParameter("oper1"));<br />
        int oper2 = Integer.parseInt(request.getParameter("oper2"));</p>
<p>        int result = calculatorSession.calculate(CalculatorSessionLocal.OPERATION.valueOf(operation), oper1, oper2);<br />
        request.setAttribute("result", result);<br />
        request.getRequestDispatcher("/CalculatorPage.jsp").forward(request, response);<br />
    } </p>
<p>    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."><br />
    /**<br />
    * Handles the HTTP <code>GET</code> method.<br />
    * @param request servlet request<br />
    * @param response servlet response<br />
    */<br />
    protected void doGet(HttpServletRequest request, HttpServletResponse response)<br />
    throws ServletException, IOException {<br />
        processRequest(request, response);<br />
    } </p>
<p>    /**<br />
    * Handles the HTTP <code>POST</code> method.<br />
    * @param request servlet request<br />
    * @param response servlet response<br />
    */<br />
    protected void doPost(HttpServletRequest request, HttpServletResponse response)<br />
    throws ServletException, IOException {<br />
        processRequest(request, response);<br />
    }<br />
}<br />
[/sourcecode]</p>
<p><strong>File CalculatorPage.jsp</strong>, kita gunakan untuk menampilkan hasil perhitungan.</p>
<p>[sourcecode language='html']<br />
<html><br />
    <head><br />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br />
        <title>Java EE Calculator</title><br />
    </head><br />
    <body></p>
<h2>Java EE Calculator Result:</h2>
<p>Operation: <%=request.getParameter("operation")%><br />
        Operand 1: <%=request.getParameter("oper1")%><br />
        Operand 2: <%=request.getParameter("oper2")%><br />
        Result:<B> <%=  request.getAttribute("result")%></B><br />
        <a href='<%=request.getContextPath()%>/'>BACK</a><br />
    </body><br />
</html><br />
[/sourcecode]</p>
<p style="text-align:justify;">Setelah selesai semua, pindah ke tab Services, buka tree Servers, klik kanan di Glassfish, pilih Start untuk menjalankan Glassfish application server. Setelah glassfish berjalan, kembali ke tab Projects, klik kanan di TestEnterpriseProject, pilih Undeploy and Deploy. Setelah proses undeploy dan deploy selesai, buka web browser anda dan masukkan alamat <strong>http://localhost:8080/TestEnterpriseProject-war</strong>, dan Anda akan melihat halaman seperti berikut:</p>
<p><img class="alignnone size-full wp-image-197" src="http://suhearie.wordpress.com/files/2008/08/index.jpg" alt="" width="504" height="303" /></p>
<p>Masukkan parameter, kemudian klik tombol Calculate, maka hasilnya akan ditampilkan:</p>
<p><img class="alignnone size-full wp-image-198" src="http://suhearie.wordpress.com/files/2008/08/result.jpg" alt="" width="557" height="331" /></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Netbeans 6.1, Glassfish v2 e Maven 2]]></title>
<link>http://renatoonsnails.wordpress.com/?p=39</link>
<pubDate>Fri, 22 Aug 2008 22:59:50 +0000</pubDate>
<dc:creator>renatoonsnails</dc:creator>
<guid>http://renatoonsnails.it.wordpress.com/2008/08/22/netbeans-61-glassfish-v2-e-maven-2/</guid>
<description><![CDATA[Aqui tenho 2 aplicações web que utilizam uma base comum, e queria que o Spring inicializasse somen]]></description>
<content:encoded><![CDATA[<p>Aqui tenho 2 aplicações web que utilizam uma base comum, e queria que o Spring inicializasse somente uma vez. Como o Spring que gerencia a utilização do Hibernate eu criaria somente um sessionFactory e também unificaria o cache. Procurando na net descobri um <a href="http://blog.springsource.com/main/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/">artigo</a> onde ensinava a fazer isso, mas eu precisaria empacotar minha aplicação como um ear. Como o Tomcat que eu utilizava atualmente não suporta ears, depois de testar rapidamente JBoss, Geronimo e Glassfish acabei optando pelo <a href="https://glassfish.dev.java.net/">Glassfish</a>. Não foi nenhuma pesquisa muito profunda, o Glassfish foi o que eu consegui fazer funcionar mais rapidamente minha aplicação e eu gostei da interface de administração.</p>
<p>Na configuração do Glassfish eu precisei criar o Realm de Segurança (e um <em>sun-web.xml</em> que vai no war para mapear os <em>roles</em>), os DataSources para conexão com o MySQL e configurar o JMS. A vantagem que ele já tem um servidor JMS integrado e quando eu utilizava o Tomcat dependia do ActiveMQ rodando em separado, mais uma razão para eu mudar para um servidor de aplicação.</p>
<p>Daí parti para integrar o Glassfish com o Eclipse, mas o plugin do Glassfish não estava funcionando. Resolvi testar o <a href="http://www.netbeans.org/">Netbeans</a> que tem uma ótima integração com o Glassfish (é tudo da Sun :) ). Só precisei instalar os plugins do <a href="http://maven.apache.org/">Maven</a> (dentro dele tem uma opção de instalar plugins) e importar meus projetos foi extremamente fácil.</p>
<p>Agora para fazer o deploy do meu projeto Maven no Glassfish eu não consegui de um jeito bom, estou fazendo pela linha de comando mesmo usando o comando <em>asadmin</em> (criei um shell script pra isso). O Glassfish eu rodo por dentro do Netbeans, perto de onde tem a estrutura do projeto tem uma aba Serviços. Ali tem Servidores e dentro o Glassfish, só clicar com o botão direito e mandar rodar ou parar.</p>
<p>Meu ear ficou com 2 wars dentro e com todos os jars comuns aos dois wars. Cada war tem somente os jars específicos utilizados somente neles. Depois de alguns problemas com classloaders consegui fazer a minha aplicação funcionar. Tive que colocar a opção <em>class-loader delegate="false"</em> nos meus arquivos<em> sun-web.xml</em> e tomar cuidado para que cada dependência que fosse procurada ou estivesse no mesmo classloader ou no classloader pai. Para saber mais sobre a "hierarquia" de classloaders é só dar uma olhada na documentação do Glassfish.</p>
<p>Fica aqui o relato que talvez ajude alguém, não entrei em muitos detalhes para não ficar muito extenso. Me surpreendi com a qualidade do Glassfish e do Netbeans que não via fazia muito tempo. E pensar que eu odiava servidor da Sun (iPlanet argh!!).</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[GWT to lighttpd/apache to glassfish 502 proxy or 500 internal errors fix]]></title>
<link>http://dobesland.wordpress.com/?p=54</link>
<pubDate>Fri, 22 Aug 2008 17:07:35 +0000</pubDate>
<dc:creator>dobes</dc:creator>
<guid>http://dobesland.it.wordpress.com/2008/08/22/gwt-to-lighttpdapache-to-glassfish-502-proxy-or-500-internal-errors-fix/</guid>
<description><![CDATA[I&#8217;ve been dealing with this for a while now trying to figure out why, when using my online acc]]></description>
<content:encoded><![CDATA[<p>I've been dealing with this for a while now trying to figure out why, when using my <a title="Online accounting software for small business" href="http://www.clarityaccounting.com">online accounting software</a>, users sporadically get a StatusCodeException when sending requests to the server.  I finally this week figured out what was going on; glassfish was dropping the connection or sending bad responses occasionally because it doesn't behave in the was that the mod_proxy modules of these webservers expect it to.</p>
<p>Originally I was running lighttpd and I was thinking this might be a bug in lighttpd, so I eventually switched to apache.  Once I was running apache I got a much more verbose error - instead of just a plan 500 or 502 status code I got a message.  I googled that error message plus glassfish and found the solution.</p>
<p>I thought I'd share it here so that future searchers who are using lighttpd or apache will have more places to find the answer.</p>
<p>To fix the issue, add:</p>
<p>SetEnv force-proxy-request-1.0 1</p>
<p>SetEnv proxy-nokeepalive 1</p>
<p>To your apache httpd.conf.  I don't know what the equivalent fix for lighttpd is, if there is any.</p>
<p>From this fix, it appears that glassfish is misbehaving in some way in relation to being behind a proxy, but I don't what way that is and I'm just glad I fixed this mysterious problem!</p>
<p>If any of you readers have more information about this issue, please comment!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SOA com Java EE, Parte I]]></title>
<link>http://sumatrablog.wordpress.com/?p=25</link>
<pubDate>Thu, 14 Aug 2008 19:48:06 +0000</pubDate>
<dc:creator>mmilanez</dc:creator>
<guid>http://sumatrablog.it.wordpress.com/2008/08/14/soa-com-java-ee-parte-i/</guid>
<description><![CDATA[No mais recente projeto java que rola por aqui de que tanto falo, as integrações com sistemas exte]]></description>
<content:encoded><![CDATA[<p>No mais recente projeto java que rola por aqui de que tanto falo, as integrações com sistemas externos serão muito mais do que meras interações esporádicas, são parte essencial da captação de quase todos os dados que existirão no produto.</p>
<p>Sei que a maior parte do tão falado SOA não passam de um hype, sendo que tudo que existe hoje neste sentido parece muito mais com uma coleção de design patterns catalogados especificamente para organizar as aplicações de modo a minimizar os impactos de integrações com sistemas Back-End, mas de qualquer maneira, as possibilidades de utilizar-se deste paradigma em Java são bastante interessantes, e é a respeito desta experiência que tivémos na última semana é que irei tentar reportar.</p>
<p>Como já falei, o projeto em questão receberá quase que 100% de suas informações a partir de dados provenientes de sistemas Back-End do cliente, utilizando-se maneiras e protocolos diversos. Dado o cenário, observamos a necessidade de separar os processos de integração do sistema de sua semântica, de seu objetivo. Neste sentido, as perspectivas ofertados pelo paradigma SOA parecem surgir com certa precisão para alcançar esta meta. Como em Java sempre existe a liberdade de escolha, que nos permite alcançar o mesmo objetivo utilizando-se diversos frameworks e produtos, existem diversas alternativas para implementar aplicações que utilizam o paradigma SOA. O importante nesta situação é optar por alternativas que seguem alguma API ou especificação JSR. isto lhe trará seguranças em diversos aspectos, principalmente ao vender (ou tentar vender) seu produto.</p>
<p>As APIs em Java que trarão o paradigma SOA à sua aplicação, fazem parte da <a title="JBI" href="http://jcp.org/en/jsr/detail?id=208">JSR 208 - JBI (Java Business Integration)</a>. As características completas da especificação podem ser encontradas <a href="http://java.sun.com/integration/">aqui</a>, mas em essência diria que API foi construída no modelo de Web Services, integrando os <strong>consumidores</strong> e <strong>provedores</strong> de informações através de componentes plugáveis, chamados de <strong>S</strong>ervice <strong>U</strong>nits (<strong>SU</strong>). Estes componentes plugáveis são divididos em duas categorias (se é que posso dizer assim):</p>
<ul>
<li><strong>Binding Components</strong> <strong>(BC)</strong>: São os componentes que representam os meios de acesso ou consumo da informação necessária, ou do seu próprio processo. Dentre os BCs existentes, teríamos por exemplo: SOAP, HTTP, FILE, Message Queue, CICS e etc, implementando portanto, como consumir ou disponibilizar determinada informação.</li>
<li><strong>Service Engines (SE)</strong>:  São componentes que fazem parte do seu processo de integração e realizam tarefas específicas. Poderíamos ter por exemplo, service engines que executam tranformações de strings XML, acessam bases de dados, objetos EJB ou outros web services.</li>
</ul>
<p>Os processos de integração que utilizam BCs e SEs em ambiente JBI são realizados de diversas formas, dentre elas processos <a href="http://en.wikipedia.org/wiki/Business_Process_Execution_Language"><strong>BPEL</strong></a>, onde podemos harmonizar todas as condições nas quais as interações entre nossos componentes devem acontecer, em qual tempo e em qual ordem. A composição dos diversos <strong>SU</strong>s, dá origem a uma aplicação composta, chamada de <strong>S</strong>ervice <strong>A</strong>ssembly (SA).</p>
<p>O interessante nisto tudo é ressaltar que o JBI define as formas (dentre muitas outras coisas) nas quais os componentes BC e SE devem ser construídos, quais interfaces devem implementar e quais arquivos xml devem ser providos.Isto facilita e muito a adição de novos <strong>S</strong>ervice <strong>U</strong>nits, tornando a adição de novas tecnologias como <a href="http://en.wikipedia.org/wiki/Complex_Event_Processing">CEP</a> por exemplo, muito facilitada. Um viva aos padrões!!!</p>
<p>Durante a avaliação dos JBI Servers gratuitos que implementem JBI e que possuísem fonte aberto, os produtos que comparei por um tempo foram esses (não tive muito tempo, mas acho que o que pude ver foi bastante satisfatório):</p>
<p><a title="ServiceMix" href="http://servicemix.apache.org/">Apache ServiceMix</a> - Esta é a implementação JBI da Apache Software Foundation. Apesar de parecer bastante simples ao fazer download, minha impressão a respeito do ServiceMix é que ele não serve muito bem para iniciantes. Faz-se necessário um conhecimento bastante grande a respeito de suas especificações, das estruturas de diretórios necessárias, dos arquivos xml de configuração e por aí vai... Não consegui encontrar nenhum plugin para o eclipse que realmente tenham valido a pena, ou que me poupassem ao menos metado do trabalho necessário para publicar uma aplicação "Hello World". Um problema grande (e bota grande nisso) é o fato de os tutorias publicados no site da Apache <strong>conterem diversos </strong>(e absurdos) <strong>erros</strong>, o que dificulta e muito seu aprendizado. Uma das coisas bacanas é a disponibilização de diversos builds Maven para empacotamento dos deploys.</p>
<p><a href="http://mule.mulesource.org/">Mule</a> - Apesar de bastante utilizado e comentado, não implementa especificação nenhuma, portanto não pude olhar este cara muito a fundo. Segundo os artigos e tutorias que li, é bastante rápido, fáicl de gerenciar e de se usar. Como não segue nenhuma especificação, cuidado se escolhê-lo, você pode morrer abraçado a ele.</p>
<p><a title="Open ESB" href="https://open-esb.dev.java.net/">Open ESB</a> - É de longe o mais fácil de se utilizar e um dos mais completos em termos de Binding Components disponíveis após download. Antigo See Beyond, hoje é a base da distribuição <a href="http://www.sun.com/software/javaenterprisesystem/javacaps/index.jsp">Java CAPS</a> da SUN.  Seu uso através do editor CASA <a href="http://www.netbeans.org/">NetBeans</a> é muito intuitivo e apresenta resultados muito de maneira muito rápida. Além do que, os <a href="http://www.netbeans.org/kb/trails/soa.html">tutorias disponíveis</a> no site da comunidade NetBeans estão muito bem escritos e realmente funcionam. Possui integração facilitada com servidores GlassFish e JBOSS, o que o torna uma excelente opção tanto para aprendizado como para ambiente produtivo.</p>
<p>É isot, neste post procurei descrever de maneira um pouco abstrata talvez, como a plataforma Java soluciona os paradigmas SOA através de suas especificações e APIs, além de apresentar algumas opções de ESBs disponpiveis. Nos próximos POSTS, colocarei alguns exemplos interessantes de aplicações que não consegui encontrar na internet e tivemos que descobrir na marra. Também vou escrever a respeito de CEP, que parece ser algo bastante promissor daqui pra frente!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[GlassFish integration with NetBeans, Eclipse and JDeveloper]]></title>
<link>http://nikojava.wordpress.com/?p=140</link>
<pubDate>Sat, 09 Aug 2008 20:53:25 +0000</pubDate>
<dc:creator>Nikos</dc:creator>
<guid>http://nikojava.it.wordpress.com/2008/08/09/glassfish-integration/</guid>
<description><![CDATA[This is how GlassFish integrates with NetBeans 6.1, Eclipse 3.4 (Ganymede) and JDeveloper 11g.
NetBe]]></description>
<content:encoded><![CDATA[<p>This is how GlassFish integrates with <a href="http://www.netbeans.org/">NetBeans 6.1</a>, <a href="http://www.eclipse.org/">Eclipse 3.4 (Ganymede)</a> and <a href="http://www.oracle.com/technology/products/jdev">JDeveloper 11g</a>.</p>
<h2><a name="glassfish-integrates-netbeans"></a>NetBeans</h2>
<p>NetBeans 6.1 provides out-of-the box integration as it is bundled with GlassFish.</p>
<p>Just keep the default setting "GlassFish V2 UR2" enabled during installation process.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass9.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass9.png" alt="" width="450" height="337" class="alignnone size-full wp-image-141" /></a></p>
<p>In this way GlassFish is automatically installed, configured and ready-to-use: simply press "Run" on any web project!</p>
<p>However, if you would like to declare another installation of GlassFish go to Tools &#8594; Servers &#8594; Add Server...</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass10.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass10.png" alt="" width="450" height="313" class="alignnone size-full wp-image-142" /></a></p>
<p>Select the proper version, specify the name and click "Next.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass11.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass11.png" alt="" width="450" height="312" class="alignnone size-full wp-image-143" /></a></p>
<p>Provide the installation path of GlassFish through the "Browse" button and click "Next" to configure the password or "Finish" to complete.</p>
<p>That's it!</p>
<p>Let's create a simple web application to test it. Go to File &#8594; New Project... &#8594; Web &#8594; Web Application &#8594; Next &#8594; Specify the Project Name &#8594; Finish</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass12.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass12.png" alt="" width="348" height="203" class="alignnone size-full wp-image-144" /></a></p>
<p>The project should appear on the Projects tab. Edit the code of index.jsp and change &#60;h2&#62;Hello World!&#60;/h2&#62; to &#60;h2&#62;Hello World <b>from GlassFish</b>!&#60;/h2&#62;</p>
<p>Now simply right-click on the project and select "Run"!</p>
<h2><a name="glassfish-integrates-eclipse"></a>Eclipse</h2>
<p>If you are behind a proxy make sure you have properly configured the network settings for HTTPs also. Window &#8594; Preferences &#8594; General &#8594; Network Connections and make sure the option "Use this proxy server for SSL" is checked &#8594; Apply &#8594; OK &#8594; restart Eclipse.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass1.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass1.png" alt="" width="450" height="170" class="alignnone size-full wp-image-145" /></a></p>
<p>Open the Servers view: Window &#8594; Show View &#8594; Other... &#8594; Server &#8594; Servers</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass2.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass2.png" alt="" width="358" height="323" class="alignnone size-full wp-image-146" /></a></p>
<p>On the Servers tab right-click &#8594; New &#8594; Server</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass3.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass3.png" alt="" width="205" height="152" class="alignnone size-full wp-image-147" /></a></p>
<p>Click on the "Download additional server adapters" link.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass4.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass4.png" alt="" width="450" height="239" class="alignnone size-full wp-image-148" /></a></p>
<p>Click on the GlassFish Java EE Server option and press "Next".</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass5.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass5.png" alt="" width="450" height="485" class="alignnone size-full wp-image-149" /></a></p>
<p>Afte reading and accepting the CDDL licence press "Finish" and OK at the prompt message. After a while Eclipse will restart.</p>
<p>Now go the Servers tab right-click &#8594; New &#8594; Server and select "GlassFish".</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass6.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass6.png" alt="" width="450" height="299" class="alignnone size-full wp-image-150" /></a></p>
<p><i>Note: The plugin for brand new GlassFish v3 Technology Preview 2 is already available!</i></p>
<p>Select the version of GlassFish you have <a href="http://nikojava.wordpress.com/2008/08/05/glassfish-for-the-developer/">installed</a> and press "Next".</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass7.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass7.png" alt="" width="450" height="255" class="alignnone size-full wp-image-151" /></a></p>
<p>Provide the installation directory of GlassFish and click "Next".</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass8.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass8.png" alt="" width="450" height="318" class="alignnone size-full wp-image-152" /></a></p>
<p>That's it!</p>
<h2><a name="glassfish-integrates-jdeveloper"></a>JDeveloper</h2>
<p>JDeveloper has a really handy feature: <b>deploy-on-demand</b>.</p>
<p>Let's assume we want to deploy a web application. In the Application Navigator right-click on the project &#8594; New... &#8594; General &#8594; Deployment Profiles</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass13.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass13.png" alt="" width="450" height="321" class="alignnone size-full wp-image-153" /></a></p>
<p>Select war and click "Next".</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass14.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass14.png" alt="" width="450" height="161" class="alignnone size-full wp-image-154" /></a></p>
<p>After specifying the name, for example "wicket", provide the hot-deploy directory of GlassFish through the "Browse" button.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass15.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass15.png" alt="" width="450" height="321" class="alignnone size-full wp-image-155" /></a></p>
<p>That's it!</p>
<p>To deploy the application simply right-click on the project &#8594; Deploy &#8594; wicket &#8594; to WAR file.</p>
<p><a href="http://nikojava.files.wordpress.com/2008/08/glass16.png"><img src="http://nikojava.wordpress.com/files/2008/08/glass16.png" alt="" width="450" height="363" class="alignnone size-full wp-image-156" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Integrando Apache com Glassfish]]></title>
<link>http://renatoonsnails.wordpress.com/?p=43</link>
<pubDate>Fri, 26 Sep 2008 01:50:34 +0000</pubDate>
<dc:creator>renatoonsnails</dc:creator>
<guid>http://renatoonsnails.it.wordpress.com/2008/09/25/integrando-apache-com-glassfish/</guid>
<description><![CDATA[Após fazer a migração das minhas aplicações do Tomcat para o Glassfish ainda faltou fazer com q]]></description>
<content:encoded><![CDATA[<p>Após fazer a migração das minhas aplicações do Tomcat para o Glassfish ainda faltou fazer com que o Apache (httpd) redirecionasse requisições para o Glassfish. Isto é útil quando temos aplicações (em PHP, por exemplo) que rodam no Apache e ainda queremos usar a porta http default 80 para aplicações desenvolvidas em Java rodando no Glassfish.</p>
<p>Para habilitar no Glassfish (versão v2) a integração com o Apache, temos que copiar os jars commons-modeler, commons-logging e tomcat-ajp de uma instalação existente do Tomcat (importante: não pode ser a última versão do Tomcat que não funciona, eu usei a 5.5.17) para o diretório $GLASSFISH_HOME/lib. No meu caso comecei a ter problemas com o log4j e tive que tirá-lo do pacote da minha aplicação e colocá-lo no diretório lib também para o servidor inicializar sem erro. Só que minha aplicação parou de mostrar os logs do log4j, isso ainda é um problema que tenho que contornar.</p>
<p>Após ter copiado os jars, ainda temos que definir uma propriedade na inicialização do Glassfish que definirá a porta utilizada pelo mod_jk do Apache para se comunicar com o Glassfish:</p>
<p><code>-Dcom.sun.enterprise.web.connector.enableJK=8009</code></p>
<p>Isso pode ser feito pela interface de administração (por exemplo, http://localhost:4848) ou usando o comando:</p>
<p><code>$GLASSFISH_HOME/bin/asadmin create-jvm-options -Dcom.sun.enterprise.web.connector.enableJK=8009</code></p>
<p>Não vou explicar a parte do Apache que utilizaria o mod_jk, é só procurar no Google como faz a integração Tomcat com Apache que é igual.</p>
<p>Se alguém quiser mais detalhes, ver em essa página em inglês: <a href="http://weblogs.java.net/blog/jfarcand/archive/2006/03/running_glassfi_1.html">Running GlassFish with Apache httpd</a></p>
]]></content:encoded>
</item>

</channel>
</rss>
