<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>justin-shepard.net &#187; jboss</title>
	<atom:link href="http://justin-shepard.net/tag/jboss/feed/" rel="self" type="application/rss+xml" />
	<link>http://justin-shepard.net</link>
	<description>Thoughts on software, hardware and whatever shiny gadget catches my eye.</description>
	<lastBuildDate>Tue, 04 Nov 2008 14:17:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>From JBoss to Glassfish: Part II</title>
		<link>http://justin-shepard.net/2008/08/27/from-jboss-to-glassfish-part-ii/</link>
		<comments>http://justin-shepard.net/2008/08/27/from-jboss-to-glassfish-part-ii/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 19:43:59 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://justin-shepard.net/2008/08/27/from-jboss-to-glassfish-part-ii/</guid>
		<description><![CDATA[Welcome to the second post in a three part series about my experience migrating from the JBoss application server to the Glassfish application server. This post details the migration of our EJB-based services, and the trials and tribulations that occurred along the way. I will say that I ran into an interesting problem when writing [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to the second post in a three part series about my experience migrating from the JBoss application server to the Glassfish application server. This post details the migration of our EJB-based services, and the trials and tribulations that occurred along the way. I will say that I ran into an interesting problem when writing this post, mostly stemming from the fact that I couldn&#8217;t remember what all I had done (SVN history gave me some of that), but various things that I did have been lost to the ether (like the results I had using the verifier tool). In the future, I should keep notes when I&#8217;m doing something like this. Anyway, on with the post.</p>
<p>I&#8217;ll say up front that I haven&#8217;t spent a lot of time working with EJBs. Most of what I&#8217;d done prior to this was modifying existing EJBs. The creation and deployment of EJBs was handled by other developers (all of whom had moved on by the time this project began). So I had some learning to do.</p>
<p>Our EJB modules pre-date 3.0 with its annotations, which meant lots of XML wrangling for me. The first thing that came up was that the ejb-jar.xml files were missing local EJB reference definitions. I don&#8217;t know if JBoss is more permissive than Glassfish or what, but the JNDI lookup in Glassfish failed without the ejb-local-ref elements. I didn&#8217;t discover the verifier tool until later on in the migration, so all the missing local references were found by deploying the EJB apps and uncovering them as I tested the system.</p>
<p>A related problem was also that the string constants used to reference the EJBs were often incorrect. I found this especially odd because we were using XDoclet to dynamically generate the EJB interfaces at compile time, and you think it would have gotten it correct. At any rate, I removed the compile-time generation, checked the interfaces into SVN and went on my way (they don&#8217;t really change enough to require compile-time generation).</p>
<p>The other big problem was doing the JNDI lookups for the EJBs. Fortunately, perhaps 80% of our JNDI lookups were handled by a single utility class, and it was easy enough to clean up that single class. The remaining JNDI lookups were scattered throughout the client and server code. And in pretty much every case, the initial context factory was passed to the InitialContext as a constant string (referencing the JBoss context factory, naturally) instead of letting that value be found in the environment. While I don&#8217;t expect us to change app servers all that often, letting the environment define as much as it can is certainly better than having lookups fail because they&#8217;re statically looking for the wrong classes.</p>
<p>Ultimately, I&#8217;d say most of our problems stemmed from an assumption that the app server would never change, or relying on vendor-specific behaviors (no doubt fed by the previous assumption). There are still a few places where we&#8217;re doing questionable things (several EJBs read configuration information from files, for example) but I have plans to take care of those.</p>
]]></content:encoded>
			<wfw:commentRss>http://justin-shepard.net/2008/08/27/from-jboss-to-glassfish-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From JBoss to Glassfish: Part I</title>
		<link>http://justin-shepard.net/2008/07/07/from-jboss-to-glassfish-part-i/</link>
		<comments>http://justin-shepard.net/2008/07/07/from-jboss-to-glassfish-part-i/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 14:48:33 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://justin-shepard.net/2008/07/07/from-jboss-to-glassfish-part-i/</guid>
		<description><![CDATA[This is the first in a multi-part post about my experiences migrating from JBoss to Glassfish. First, a bit of background. We&#8217;ve recently started swapping our backend over to a service-oriented architecture based on RESTful services. All of our recent development has been involved in the creation of new RESTful services, but we still have [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first in a multi-part post about my experiences migrating from JBoss to Glassfish.</p>
<p>First, a bit of background. We&#8217;ve recently started swapping our backend over to a service-oriented architecture based on <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful services</a>. All of our recent development has been involved in the creation of new RESTful services, but we still have a lot of legacy code that happens to take the form of EJBs and RPC-based web services. Faced with the need to either upgrade JBoss or switch to Glassfish, we chose the latter (which will probably make a fine post in the future). This meant we had to make changes to all three service types to get them all working in the new app server.</p>
<p>I&#8217;m going to start with the RESTful service migration, mostly because they were far and away the easiest part of the migration. So easy, in fact, that there were only two major issues I ran into.</p>
<p>The first came about because we were prepending numbers on the names of our web application archives. This was done for ordering reasons, and in JBoss, the number was ignored for determining things like context root. Glassfish, on the other hand, uses the entire war name. So while the services were working, and deploying correctly, you needed to have the correct number in the URL when accessing the service. Rather than change all the services to include numbers in the URL, I went looking for another solution. Thanks to the <a href="http://forums.java.net/jive/index.jspa">java.net forums</a> (which I found to be an excellent resource throughout the project) I discovered that you could set the context root in the sun-web.xml file of the web app (which then sprung into existence for all our services).</p>
<p>A fairly obvious solution, to be sure, but less so when you&#8217;re learning. <img src='http://justin-shepard.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The second was finding a deployment solution for our JDBC resources (this, of course, covered more than just the RESTful services, as the EJBs also used them, but this was the first area I hit the problem in). Adding and configuring resources via the Glassfish admin console is very easy, and I had no trouble setting up the resources, but navigating a web console isn&#8217;t the most friendly method for a more automated install process. The java.net forums once again proved their worth, leading me to the solution. In this case, the solution is the <a href="http://docs.sun.com/app/docs/doc/820-4497/add-resources-1?l=ru&amp;a=view">add-resources command</a> that is part of the command line administration tool.</p>
<p>This solution was doubly nice because we already had XML files for defining our resources in JBoss, and the formats were similar enough that creating the new files was mostly a matter of XML wrangling. This solution also nicely covered other resources, such as the few queues and topics we use for communication.</p>
<p>With those two things taken care of the RESTful services happily took up residence in Glassfish. And with the RESTful services out of the way, it was time to tackle the EJBs.</p>
]]></content:encoded>
			<wfw:commentRss>http://justin-shepard.net/2008/07/07/from-jboss-to-glassfish-part-i/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
