<?xml version="1.0" encoding="utf-8"?>
<!-- 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
-->
<?xml-stylesheet type="text/xsl" href="https://rollerweblogger.org/roller-ui/styles/rss.xsl" media="screen"?><rss version="2.0" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
  <title>Blogging Roller</title>
  <link>https://rollerweblogger.org/roller/</link>
    <atom:link rel="self" type="application/rss+xml" href="https://rollerweblogger.org/roller/feed/entries/rss?tags=hibernate" />
  <description>Dave Johnson on open web technologies, social software and software development</description>
  <language>en-us</language>
  <copyright>Copyright 2026</copyright>
  <lastBuildDate>Tue, 28 Apr 2026 07:02:22 +0000</lastBuildDate>
  <generator>Apache Roller 6.1.5</generator>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/roller_5_and_jboss_6</guid>
    <title>Roller 5 and JBoss 6</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/roller_5_and_jboss_6</link>
    <pubDate>Thu, 20 Jan 2011 18:00:15 +0000</pubDate>
    <category>Roller</category>
    <category>asf</category>
    <category>hibernate</category>
    <category>javaee</category>
    <category>jboss</category>
<atom:summary type="html">&lt;p&gt;&lt;img align=&quot;right&quot; src=&quot;http://rollerweblogger.org/roller/mediaresource/d94dc4cc-d79c-423a-a9bc-ee93853ee422&quot; alt=&quot;JBoss logo&quot;&gt; In my quest to make Roller work on Java EE 6, the next server that I tackled was JBoss 6. In this blog I&amp;#39;ll describe how I approached the problem what I learned along the way.&lt;/p&gt;

&lt;h4&gt;Tested with Hibernate JPA&lt;/h4&gt;

&lt;p&gt;Roller uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_Persistence_API&quot;&gt;JPA&lt;/a&gt; for database storage and specifically the &lt;a href=&quot;http://openjpa.apache.org/&quot;&gt;Apache OpenJPA&lt;/a&gt; implementation. I knew that JBoss uses the &lt;a href=&quot;http://www.hibernate.org&quot;&gt;Hibernate JPA&lt;/a&gt; implementation and I suspected that there would be JPA portability problems, so I decided to run Roller&amp;#39;s JUnit tests against Hibernate JPA. There were many test failures and fortunately, the failures were easy to fix.&lt;/p&gt;</atom:summary><description>&lt;p&gt;&lt;img align=&quot;right&quot; src=&quot;http://rollerweblogger.org/roller/mediaresource/d94dc4cc-d79c-423a-a9bc-ee93853ee422&quot; alt=&quot;JBoss logo&quot;&gt; In my quest to make Roller work on Java EE 6, the next server that I tackled was JBoss 6. In this blog I&amp;#39;ll describe how I approached the problem what I learned along the way.&lt;/p&gt;

&lt;h4&gt;Tested with Hibernate JPA&lt;/h4&gt;

&lt;p&gt;Roller uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_Persistence_API&quot;&gt;JPA&lt;/a&gt; for database storage and specifically the &lt;a href=&quot;http://openjpa.apache.org/&quot;&gt;Apache OpenJPA&lt;/a&gt; implementation. I knew that JBoss uses the &lt;a href=&quot;http://www.hibernate.org&quot;&gt;Hibernate JPA&lt;/a&gt; implementation and I suspected that there would be JPA portability problems, so I decided to run Roller&amp;#39;s JUnit tests against Hibernate JPA. There were many test failures and fortunately, the failures were easy to fix.&lt;/p&gt;

&lt;p&gt;Where OpenJPA is lenient, Hibernate JPA is strict about declaring transients fields as transient. So, wherever Hibernate complained, I added the appropriate transient declaration and soon all tests were passing. There were a lot of changes, but they were all trivially easy. Since I first &amp;quot;ported&amp;quot; Roller to ElipseLink JPA, its possible that some of the changes I made for EclipseLink helped with the port to Hibernate JPA.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/31c02555-27cd-4391-b951-38161b88e8c2&quot; alt=&quot;HIbernate logo&quot; align=&quot;right&quot;&gt;Those of you who are familiar with Roller&amp;#39;s history might remember that this is the second time I worked to &lt;a href=&quot;http://rollerweblogger.org/roller/entry/powered_by_struts_1_1&quot;&gt;make Roller work with Hibernate&lt;/a&gt;. Early versions of Roller ran on Hibernate until Roller 4, when we ripped it out because Apache policy does not allow LGPL. With Java EE 6, Roller can run on Hibernate and we don&amp;#39;t have to ship the Hibernate jars to do so.&lt;/p&gt;

&lt;h4&gt;Tried using the Java EE version of the Roller WAR&lt;/h4&gt;

&lt;p&gt;Since JBoss 6 is a Java EE 6 server, just like Glassfish, I figured I could use the same WAR that I created for Glassfish. That didn&amp;#39;t really work out, as you will see below. When I attempted to deploy the Roller WAR to JBoss I ran into two problems:&lt;/p&gt;

&lt;h4&gt;Problem 1: Xerces and JavaAssist&lt;/h4&gt;

&lt;p&gt;When I tried to deploy the Roller WAR to JBoss, I ran into class-cast exceptions that indicated that the version the the Xerces XML parser included with Roller conflicts with the one that is included in JBoss. I encountered a similar problem for the JavAssist jars, which are also part of Roller. This was quite surprising to me. Apparently, JBoss uses Xerces and JavAssist internally and for some reason the JBoss internals bleed through and interfere with applications; seems like a bug to me. So, we have to have a special Roller WAR for JBoss without the Xerces and JavaAssist jars in the Roller WAR.&lt;/p&gt;

&lt;h4&gt;Problem 2: JNDI Datasource Name&lt;/h4&gt;

&lt;p&gt;The next problem that I encountered was the datasource name. Roller uses the JNDI naming API to lookup its JDBC datasource. In all of the other app servers, we tell people to setup a datasource with the JNDI name &amp;#39;jdbc/rollerdb&amp;#39; but that name did not work for JBoss. For JBoss, I could only get names of names of the format &amp;quot;java:/name&amp;quot; to work. Unfortunately, with JPA the datasource name must be embedded in the &lt;code&gt;persistence.xml&lt;/code&gt; file which is embedded in a JAR file which is embedded in the Roller WAR file. It&amp;#39;s in there deep, so we have to produce a special Roller WAR for JBoss with a JBoss-friendly datasource name.&lt;/p&gt;

&lt;p&gt;*Please* correct me if I&amp;#39;m wrong. I would love to be wrong about either of these two problems.&lt;/p&gt;

&lt;h4&gt;Created special Roller WAR just for JBoss&lt;/h4&gt;

&lt;p&gt;Due to those two problems, I modified the Roller build process to create a special Roller WAR for JBoss without the OpenJPA, Xerces and JavAssist JARs and with the JBoss friendly JNDI name &lt;code&gt;java:/RollerDS&lt;/code&gt; inside all included &lt;code&gt;persistence.xml&lt;/code&gt; files.&lt;/p&gt;

&lt;h4&gt;Deployed, tested and updated the docs&lt;/h4&gt;

&lt;p&gt;Once I worked around those two problems, installing Roller on JBoss was easy. I did the whole thing via the JBoss web console, which was not familiar to me but was pretty easy to understand and use. I documented the whole process in the &lt;a href=&quot;http://people.apache.org/~snoopdave/apache-roller-5.0/roller-install-guide.pdf&quot;&gt;Roller 5 Install Guide (2MB PDF)&lt;/a&gt;, with screenshots.&lt;/p&gt;

&lt;p&gt;Next up: Roller 5 on WebSphere 8 (beta)&lt;/p&gt; 

&lt;p&gt;See also: &lt;a href=&quot;http://rollerweblogger.org/roller/entry/roller_5_and_java_ee&quot;&gt;Roller 5 and Java EE 6&lt;/a&gt; and &lt;a href=&quot;http://rollerweblogger.org/roller/entry/roller_5_and_glassfish_3&quot;&gt;Roller 5 on Glassfish 3&lt;/a&gt;.&lt;/p&gt; 
</description>  </item>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/powered_by_struts2_and_openjpa</guid>
    <title>Powered by Struts2 and OpenJPA</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/powered_by_struts2_and_openjpa</link>
    <pubDate>Mon, 18 Jun 2007 13:06:25 +0000</pubDate>
    <category>Roller</category>
    <category>foss</category>
    <category>hibernate</category>
    <category>java</category>
    <category>jpa</category>
    <category>roller</category>
<description>&lt;p&gt;I stayed up a little too late last night upgrading this site (&lt;a href=&quot;http://rollerweblogger.org&quot;&gt;rollerweblogger.org&lt;/a&gt;) to the latest &lt;a href=&quot;http://cwiki.apache.org/confluence/display/ROLLER/What%27s+New+in+Roller+4.0&quot;&gt;Roller 4.0&lt;/a&gt; code base, which includes the new Struts2 based Admin UI and a new OpenJPA based back-end. No more Hibernate for me. The upgrade was a bit of a rocky road, but the site seems to be working OK now.&lt;/p&gt;</description>  </item>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/jpa_jpa_jpa</guid>
    <title>JPA JPA JPA</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/jpa_jpa_jpa</link>
    <pubDate>Thu, 8 Mar 2007 14:33:59 +0000</pubDate>
    <category>Java</category>
    <category>hibernate</category>
    <category>java</category>
    <category>openjpa</category>
    <category>orm</category>
    <category>toplink</category>
<description>&lt;p&gt;That&amp;#39;s three JPAs. I&amp;#39;ve been fighting to get a new Roller back-end running, one that uses the &lt;a href=&quot;http://java.sun.com/javaee/overview/faq/persistence.jsp&quot;&gt;Java Persistence API&lt;/a&gt; (JPA) rather than the native Hibernate API that we use now. &lt;/p&gt;&lt;p&gt;Craig Russell and Mitesh Meswani wrote the new JPA back-end and tested it against &lt;a href=&quot;https://glassfish.dev.java.net/javaee5/persistence/&quot;&gt;Toplink/JPA&lt;/a&gt; (JPA #&lt;b&gt;1&lt;/b&gt;) and the Derby database. I&amp;#39;ve been refactoring it, updating it for Roller 4.0 and testing it against various other databases and JPA implementations with mixed results.&lt;/p&gt;&lt;p&gt;I tried to run it against MySQL, ran into a bunch of problems and fixed those. &lt;a href=&quot;http://www.mans-end.com/&quot;&gt;Allen&lt;/a&gt; switched out Toplink/JPA for &lt;a href=&quot;http://entitymanager.hibernate.org/&quot;&gt;Hibernate/JPA&lt;/a&gt; (JPA #&lt;b&gt;2&lt;/b&gt;), ran into problems and fixed those. I switched out Toplink for &lt;a href=&quot;http://incubator.apache.org/openjpa/&quot;&gt;Apache OpenJPA&lt;/a&gt;-incubating (JPA #&lt;b&gt;3&lt;/b&gt;), ran into problems and fixed those. So now we have a back-end implementation that runs against OpenJPA, but requires two small code changes to work against Toplink -- not exactly an ideal situation.&lt;br&gt; &lt;/p&gt;&lt;p&gt;I&amp;#39;m a JPA newbie for sure and still trying to figure this stuff out, but it does seem that switching JPA implementations is not as easy as it ought to be.&lt;/p&gt;&lt;p&gt;In other JPA news... &lt;/p&gt;&lt;p&gt;I didn&amp;#39;t realize that the open source version of Toplink that Oracle contributed to Glassfish, &lt;a href=&quot;https://glassfish.dev.java.net/javaee5/persistence/&quot;&gt;Toplink Essentials&lt;/a&gt;, is the pee-wee version of the full and still closed source Toplink product. That&amp;#39;s why I was somewhat surprised to hear that &lt;a href=&quot;http://www.infoworld.com/article/07/03/06/HNoracleeclipse_1.html?source=rss&amp;amp;url=http://www.infoworld.com/article/07/03/06/HNoracleeclipse_1.html&quot;&gt;Oracle is open sourcing and donating the full version of Toplink to the Eclipse foundation&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;Two observations about that news. First, this move appears to be a fork that will result in a &lt;a href=&quot;http://opensource.org/licenses/cddl1.php&quot;&gt;CDDL&lt;/a&gt; licensed version of Toplink Essentials in Glassfish and an &lt;a href=&quot;http://opensource.org/licenses/eclipse-1.0.php&quot;&gt;EPL&lt;/a&gt; version in Eclipse -- I hope I&amp;#39;m wrong about that. And second: apparently IBM will be soon be supporting two versions of JPA: OpenJPA via Geronimo and Toplink/JPA via Eclipse. &lt;br&gt; &lt;/p&gt;</description>  </item>
</channel>
</rss>