David R. HeffelfingerSoftware Development Noteshttp://ensode.net/roller/dheffelfinger/feed/entries/atom2017-07-16T19:53:29+00:00Apache Roller (incubating)http://ensode.net/roller/dheffelfinger/entry/glassfish_book_giveaway_winnersGlassFish Book Giveaway WinnersDavid R. Heffelfinger2010-09-10T04:00:00+00:002010-09-10T04:18:00+00:00
<p><p><a href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203" title="Java EE 6 with GlassFish 3 Application Server"><img vspace="0" hspace="0" border="0" align="baseline" src="http://ensode.net/images/0363_Java%20EE%206%20with%20GlassFish%203%20Application%20Server_cov.jpg.png" alt="Java EE 6 with GlassFish 3 Application Server" /></a></p><p>Over the last few weeks, we have been having a giveaway for my latest book, <a href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203">Java EE 6 with GlassFish Application Server</a>.</p><p>The giveaway is now over, and we have randomly selected three winners.</p><p> <img vspace="0" hspace="0" border="0" align="baseline" src="http://ensode.net/roller/dheffelfinger/resource/random.png" /></p><p>Without further ado, here are the winners:</p><ul><li><a href="http://ensode.net/roller/dheffelfinger/entry/win_a_free_copy_of#comment-1282117886190">nico</a></li><li><a href="http://ensode.net/roller/dheffelfinger/entry/win_a_free_copy_of#comment-1282166959210">Hannu</a></li><li><a href="http://ensode.net/roller/dheffelfinger/entry/win_a_free_copy_of#comment-1283014756892">Charles</a></li></ul><p>Congratulations to all the winners!</p><h3>Obtaining a copy of the book</h3><p>If you would like a copy of the book and you are not one of our lucky winners, I encourage you to purchase it directly from <a href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203">Packt Publishing</a>. </p><p>Thanks to everybody that participated and congratulations once again to our winners! <br /></p></p>
http://ensode.net/roller/dheffelfinger/entry/win_a_free_copy_ofWin a Free Copy of Java EE 6 with GlassFish 3 Application ServerDavid R. Heffelfinger2010-08-17T04:00:00+00:002010-09-07T22:39:03+00:00
<p><p><a title="Java EE 6 with GlassFish 3 Application Server" href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203"><img vspace="0" hspace="0" border="0" align="baseline" alt="Java EE 6 with GlassFish 3 Application Server" src="http://ensode.net/images/0363_Java%20EE%206%20with%20GlassFish%203%20Application%20Server_cov.jpg.png" /></a><br /></p><p></p>
<p> <style type="text/css"><br/>
<!--<br/>
@page { margin: 0.79in }<br/>
P { margin-bottom: 0.08in }<br/>
A:link { so-language: zxx }<br/>
--><br/>
</style></p>
<p></p><p>As some of you know, my latest book, <a href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203">Java EE 6 with GlassFish Application Server</a>, was recently published by Packt Publishing.<br/>
</p><p>Packt Publishing was kind enough to offer me three copies of the book to give away. </p><h3>About the Book</h3><p>The book covers all aspects of Java EE 6 development using GlassFish 3, some of the topics include: </p><ul><li>JavaServer Faces (JSF) 2.0</li><li>Java Persistence API (JPA) 2.0</li><li>Enterprise JavaBeans (EJB) 3.1</li><li>Contexts and Dependency Injection (CDI) 1.0</li><li>Java API for RESTful Web Services (JAX-RS) 1.1</li><li>Java API for XML Web Services (JAX-WS) 2.1</li><li>Servlet 3.0</li></ul><h3>How to Enter for a Chance to Win</h3><p>All you have to do is answer one (or both) of the following questions in a comment below:</p><ol><li>What would you like to learn from the book?</li><li>Why would you like to win a copy of the book?</li></ol><p>If you prefer a certain book format and you are a USA or Europe resident, please note that in your comment as well, and we'll do our best to accommodate you (paperbacks are only available for USA and Europe residents).</p><h3>Giveaway Details</h3><p>The duration of this giveaway is 20 days. The giveaway ends on <b>Monday, September 6<sup>th</sup>, 2010</b> after which comments will be disabled on this post. </p><p>Three winners will be randomly selected to win a copy of&nbsp; <a href="http://www.packtpub.com/java-ee-6-applications-with-glassfish-3-application-server/book/mid/1108108abowc?utm_source=ensode.net&amp;utm_medium=affiliate&amp;utm_content=authorsite&amp;utm_campaign=mdb_004203">Java EE with GlassFish 3 application Server</a>, authored by David Heffelfinger (yours truly) and published by Packt Publishing. Make sure you use a valid email address in the comments so that we can contact you if you win. Winners will be announced on Friday, <b>September 10<sup>th</sup>, 2010</b> and also contacted via email. Good luck!</p><p><b>Update</b>: The giveaway is now over. Thanks to all that participated. Winners will be announced this Friday, September 10th.<br /></p></p>
http://ensode.net/roller/dheffelfinger/entry/java_db_apache_derby_upgradedJava DB / Apache Derby UpgradedDavid R. Heffelfinger2009-02-21T14:27:27+00:002009-06-26T12:48:52+00:00
<p>Like I mentioned in <a href="http://www.ensode.net/roller/dheffelfinger/entry/installing_apache_roller_in_glassfish">My very first entry in this blog</a>, I am running <a href="http://roller.apache.org/">Apache Roller</a> to run this blog.</p>
<p>I'm using GlassFish and <a href="http://developers.sun.com/javadb/">Java DB</a>, which isn't much more than a rebranded version of <a href="http://db.apache.org/derby/">Apache Derby</a>.</p>
<p>The setup was working OK, but every now and then Roller would throw some weird errors, valid URLs would 404, and sometimes it would go completely &quot;out to lunch&quot;, generating error 500's.</p>
<p>I started looking through the GlassFish logs and noticed some entries similar to the following:</p>
<p><code><br/>
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0<br/>
at java.util.ArrayList.RangeCheck(ArrayList.java:547)<br/>
at java.util.ArrayList.get(ArrayList.java:322)<br/>
at org.apache.derby.client.net.NetCursor.findExtdtaData(Unknown Source)<br/>
at org.apache.derby.client.net.NetCursor.getClobColumn_(Unknown Source)<br/>
at org.apache.derby.client.am.Cursor.getString(Unknown Source)</p>
<p></code></p>
<p>I googled around and found out this issue is caused by a bug on JavaDB/Derby version 10.3.2.1 and earlier. I happened to be running 10.3.2.1. I just upgraded to version 10.3.3.0 of JavaDB/Derby. I expect the weird errors I've been seeing to go away now.</p>
http://ensode.net/roller/dheffelfinger/entry/project_websynergy_first_impressionsProject WebSynergy First ImpressionsDavid R. Heffelfinger2008-11-03T11:43:55+00:002008-11-03T11:45:11+00:00<p>
After blogging about my <a href="http://www.ensode.net/roller/dheffelfinger/entry/openportal_first_impressions">OpenPortal First Impressions</a>, I was contacted by <a href="http://blogs.sun.com/theaquarium/">Eduardo Pelegrí-Llopart</a>, he suggested I take a look at <a href="https://portal.dev.java.net/public/GetWebSynergy.html">Project WebSynergy</a>, a joint venture between Sun Microsystems and Liferay. Project WebSynergy includes code from Liferay and OpenPortal.
</p>
<p>
I downloaded it and took it for a spin, here is what I found:
</p>
<p>
Out of the box, it is much more aesthetically pleasing than OpenPortal
</p>
<img src="http://www.ensode.net/roller/dheffelfinger/resource/project_web_synergy_screenshot.png" alt="Project WebSynergy Screenshot"/>
<p>
Tabs can be created directly from the user interface.
</p>
<img src="http://www.ensode.net/roller/dheffelfinger/resource/project_synergy_add_page.png" alt="Project Synergy Add Page"/>
<p>
Similarly, hovering over a tab results in a little red icon showing up, clicking on it allows the user to delete a tab: <img src="http://www.ensode.net/roller/dheffelfinger/resource/project_synergy_delete_tab.png" alt="Project WebSynergy delete tab"/>
</p>
<p>
Of course a confirmation dialog asks the user to confirm the deletion of the tab.
</p>
<img src="http://www.ensode.net/roller/dheffelfinger/resource/project_websynergy_delete_tab_confirmation.png" alt="Project WebSynergy delete tab confirmation"/>
<p>
Project WebSynergy certainly seems to include a lot of built in functionality that may have to be manually coded when using OpenPortal. The advantages I found for OpenPortal was the tight integration it provided with GlassFish and NetBeans.
</p>
<p>
Although Project WebSynergy is not available from the GlassFish Update center, it can be downloaded bundled with GlassFish. That is what I did to try it out, I'm not sure how easy it would be to deploy it on an existing GlassFish installation.
</p>
<p>
As of NetBeans, the portlet plugins available in the NetBeans Plugin Manager do not integrate with Project WebSynergy, however, the NetBeans PortalPack 3.0 (milestone 2 is the latest available at the time of writing) does. Simply downloading the plugins from <a href="http://portalpack.netbeans.org/">the NetBeans Portal Pack page</a> and installing them on NetBeans (I tried on NB 6.5 RC2) provides the same integration that is provided with OpenPortal by the portlet plugins in the NetBeans Plugin Manager.
</p>
<p>
All in all my overall impression of Project WebSynergy is favorable, my one concern is that neither the NetBeans plugins nor Project WebSynergy itself are officially released, therefore they cannot be considered stable yet. In my admittedly simple tests they worked fine, but I can't be sure there aren't any issues waiting to be discovered if/when we start using it for real work.
</p>http://ensode.net/roller/dheffelfinger/entry/installing_apache_roller_in_glassfishInstalling Apache Roller in GlassFishDavid R. Heffelfinger2008-10-06T20:02:58+00:002009-06-26T11:50:40+00:00
<p>For a while i've had a a blog in <a href="http://jroller.com/heffel/">JRoller</a>. I've been wanting to move my blog to my own domain, but due to lack of time and other commitments I hadn't been able to do it. Well today I finally did it.<br/>
I figured a good first entry would be to talk about how to get Apache Roller going under GlassFish, which happens to be my Java EE server of choice, and the one that powers my site. GlassFish comes with the JavaDB RDBMS &quot;out of the box&quot;, which is what I'm using in this Roller installation.</p>
<p>After downloading Roller, the first thing we need to do is to create the database that Roller will use. In JavaDB, we can accomplish this with the <code>ij</code> utility.</p>
<p>In <code>ij</code>, we need to issue the following commands to create the database.</p>
<p><code><br/>
connect 'jdbc:derby://localhost:1527/roller;create=true';<br/>
</code></p>
<p>Then we need to add a user to the database:<br/>
<code><br/>
CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.admin','noneofyourbusiness');<br/>
</code><br/>
The above command creates a user with username of &quot;admin&quot; and password of &quot;noneofyourbusiness&quot;. The username and password can be modified as appropriate.</p>
<p>We then need to grant full access to our admin user:<br/>
<code><br/>
CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.fullAccessUsers','admin');<br/>
</code></p>
<p>We are done with the database creation.</p>
<p>Now we need to create a GlassFish connection pool and JDBC Resource for our new database, this can be accomplished easily with the <code>asadmin</code> tool:</p>
<p><code><br/>
asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property user=admin:password=noneofyourbusiness:databaseName=roller rollerConnectionPool<br/>
</code></p>
<p>The value of the databaseName property must match the name we gave our database in the first step.</p>
<p>To create the datasource/JDBC resource, we need to issue the following <code>asadmin</code> command:<br/>
<code><br/>
asadmin create-jdbc-resource --connectionpoolid rollerConnectionPool jdbc/rollerdb<br/>
</code></p>
<p>It is important to use the JNDI name of jdbc/rollerdb, otherwise the roller code won't be able to find the datasource.</p>
<p>After we have created the connection pool and datasource, we need to create a file called <code>roller-custom.properties<code> with the following content:</p>
<p><code><br/>
installation.type=auto<br/>
database.configurationType=jndi<br/>
database.jndi.name=jdbc/rollerdb<br/>
mail.configurationType=jndi<br/>
mail.jndi.name=mail/Session<br/>
</code></p>
<p>And copy it to the <code>lib/classes</code> folder of on the GlassFish domain we are using.</p>
<p>At this point we are ready to deploy Roller, just deploy it as usual and it should &quot;just work&quot;.</p>
<p>Good Luck.</code></code></p>