<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>KnobsLeversButtons &#187; Metro</title>
	<atom:link href="http://blog.pulleman.com/category/metro/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pulleman.com</link>
	<description>Software thingabees. Little things</description>
	<lastBuildDate>Sun, 13 Nov 2011 08:42:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.pulleman.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>KnobsLeversButtons &#187; Metro</title>
		<link>http://blog.pulleman.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.pulleman.com/osd.xml" title="KnobsLeversButtons" />
	<atom:link rel='hub' href='http://blog.pulleman.com/?pushpress=hub'/>
		<item>
		<title>Bundling external library classes inside a jar</title>
		<link>http://blog.pulleman.com/2007/09/13/bundling-external-library-classes-inside-a-jar/</link>
		<comments>http://blog.pulleman.com/2007/09/13/bundling-external-library-classes-inside-a-jar/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 21:13:07 +0000</pubDate>
		<dc:creator>Ronald Pulleman</dc:creator>
				<category><![CDATA[ATG]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[Metro]]></category>

		<guid isPermaLink="false">http://blog.pulleman.com/2007/09/13/bundling-external-library-classes-inside-a-jar/</guid>
		<description><![CDATA[Some software suppliers are bundling external classes inside their propriety jars. A good, or should I say bad, example is ATG&#8230;.. JAXB conflict With GlassFish Metro&#8217;s wsimport.sh script I generated Java interfaces and other supporting classes from a wsdl file. In a small test project it all worked like a charm. Then I copied my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.pulleman.com&amp;blog=913562&amp;post=57&amp;subd=pulleman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some software suppliers are bundling external classes inside their propriety jars. A good, or should I say bad, example is ATG&#8230;..</p>
<h3>JAXB conflict</h3>
<p>With <a href="https://metro.dev.java.net/">GlassFish Metro&#8217;s </a><code>wsimport.sh</code> script I generated Java interfaces and other supporting classes from a wsdl file. In a small test project it all worked like a charm.</p>
<p>Then I copied my code to an ATG project which needed my code. My testcase suddenly failed with a <code>java.lang.NoSuchMethodError: javax.xml.bind.JAXBContext.newInstance(..</code><br />
Ouch.</p>
<p>It took me some time to understand the problem. The problem is that the ATG <code>das2007.1.jar</code> contains a lot of external libraries. For instance Xerces or Xalan. However they changed the namespace to for instance <code>atg.apache.xerces.</code>. So conflicts are less likely.</p>
<p>But it also contains <code>javax.xml.bind.JAXBContext</code>. Grr this is JAXB 1 and my JAX-WS Metro stuff needs JAXB 2. Of course I can change the class-path order and I can do this in Eclipse, so my tests will work.<br />
However ATG specification says that <code>ATG-Required</code> modules will be started up, in the order specified, before any modules started with <code>ATG-Class-Path</code>. So DAS will always be loaded before any custom jars according to the specification&#8230; I have not validated this yet, but I&#8217;m afraid that the specification is the way it works and thus my code will not work inside the Application container.</p>
<p>This will mean that this lovely <a href="https://jaxb.dev.java.net/guide/Running_JAXB_1_0_and_2_x_side_by_side.html">solution</a> will not work</p>
<h3>And Spring, and CGLib, and Mozilla packages, and Sun packages and IBM BSF, Apache Commons etc etc?</h3>
<p>IBM BSF? The Bean Scripting Framework got promoted to Jakarta in 2002 and for some time now it has an Apache namespace and not an IBM namespace. That is some old stuff in the das jar. This is taking &#8220;If it aint broke don&#8217;t fix it&#8221; to a new level.<br />
And does anybody else find it funny that an ATG jar, especially the one containing Nucleus, contains Spring classes. Ok it is just the Spring AOP classes, but still. Nucleus and Spring IOC are birds of a feather. These are just some of the examples of some of the embedded classes.</p>
<h3>Why bundle libraries?</h3>
<p>I sort of understand that you want to control the versions of external libraries you need, but bundling them in <em>stealth mode</em> is bad practice in my opinion. Especially if you are a framework like ATG. Frameworks don&#8217;t live in a vacuum, they need extra custom code and thus clashes are likely. I rather see the jars and documentation for which library versions your product is tested.</p>
<p>I&#8217;m not really fluent in Ruby but Ruby&#8217;s <code>require_gem</code> with the version argument sounds like a nice feature.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pulleman.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pulleman.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pulleman.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pulleman.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pulleman.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.pulleman.com&amp;blog=913562&amp;post=57&amp;subd=pulleman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.pulleman.com/2007/09/13/bundling-external-library-classes-inside-a-jar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/561387d0c0c3fc3d68c109499fa468e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ronald Pulleman</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache CXF and Glassfish Metro for consuming web services</title>
		<link>http://blog.pulleman.com/2007/09/06/apache-cxf-and-glassfish-metro-for-consuming-web-services/</link>
		<comments>http://blog.pulleman.com/2007/09/06/apache-cxf-and-glassfish-metro-for-consuming-web-services/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 20:59:10 +0000</pubDate>
		<dc:creator>Ronald Pulleman</dc:creator>
				<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[Metro]]></category>

		<guid isPermaLink="false">http://blog.pulleman.com/2007/09/06/apache-cxf-and-glassfish-metro-for-consuming-web-services/</guid>
		<description><![CDATA[For a project I need to call some web services for which there is a WSDL schema. I have briefly looked at some contenders and only took consuming of web services into account and not the producing of web services, I decided to go the JAX-WS route, since this appears to become a standard: JSR [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.pulleman.com&amp;blog=913562&amp;post=56&amp;subd=pulleman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a project I need to call some web services for which there is a WSDL schema. I have briefly looked at some contenders and only took consuming of web services into account and not the producing of web services,</p>
<p>I decided to go the <a href="http://java.sun.com/webservices/technologies/index.jsp">JAX-WS</a> route, since this appears to become a standard: <a href="http://jcp.org/en/jsr/detail?id=224">JSR 224</a>. Java 6 will have it as a <a href="http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/"> feature</a>.</p>
<p>The JAX-WS choice does mean that <a href="http://ws.apache.org/axis2/">Axis2</a> cannot be used. I don&#8217;t really mind since I&#8217;ve experienced some real pain there in previous projects. I&#8217;m not the only one. <a href="http://www.bileblog.org/?p=30">Hani sums it up nicely</a>.</p>
<h2>JAX-WS contenders</h2>
<p>A bit of googling looked like the contenders are:</p>
<ul>
<li>JBossWS</li>
<li>CXF</li>
<li>Metro</li>
</ul>
<p>Because it seemed I was the first one using the here unnamed web services, I first decided to play with Amazon web services, because documentation and examples for Amazon web services are widely available.<br />
This excellent <a href="http://www.jroller.com/gmazza/date/20070821">article</a> explains how to use AWS ECS with <a href="https://metro.dev.java.net/">Metro</a> and with <a href="http://incubator.apache.org/cxf/">CXF</a>.  I did not go for the ANT route and used <code>wsdl2java</code> and <code>wsimport.sh</code>. to generate the Java code.</p>
<h3>JBossWS</h3>
<p><a href="http://labs.jboss.com/jbossws/">JBossWS</a> seems a bit tied to JBoss 5 and because I need to work with JBoss 4.0.5, I ignored that option.</p>
<p>Since I will consume a webservice, I feel that JBossWS could still be viable. However the pain I had converting the CXF Geronimo stuff to JBoss stuff (more on that later), confirmed my suspicion that JBossWS would not be an easy route in my environment. This is not to say that when using JBoss 5, you cannot have total bliss with JBossWS.</p>
<h3>CXF</h3>
<p>CXF is still an Apache incubator project. It is a merge of XFire and Celtix. The <code>wsdl2java</code> script did run without problems. When you want to use the generated code you need the following jars, according to the documentation:</p>
<ul>
<li>cxf.jar</li>
<li>commons-logging.jar</li>
<li>geronimo-activation.jar (Or the Sun equivalent)</li>
<li>geronimo-annotation.jar (Or the Sun equivalent)</li>
<li>geronimo-javamail.jar (Or the Sun equivalent)</li>
<li>neethi.jar</li>
<li>jaxb-api.jarv</li>
<li>jaxb-impl.jar</li>
<li>stax-api.jar</li>
<li>XmlSchema.jar</li>
<li>wstx-asl.jar</li>
<li>xml-resolver.jar</li>
<li>jaxws-api.jar</li>
<li>saaj-api.jar</li>
<li>saaj-impl.jar</li>
</ul>
<p>I could call ECS without any problems, however the Geronimo jars were a thorn in my eye, I tried to replace them with a JBoss equivalent. I entered a world of pain. With <code>jboss.org.lang.Annotation</code> problems (update JBossWS) and then <code>javax.annotation.PostConstruct</code> problems.<br />
So I concluded that it was not possible to remove the Geronimo jars. Upgrading to the latest JBossWS implementation got me dependent on JBoss 5 it seemed, which is no option.<br />
So if you can live with Geronimo jars and 15 jars in total, give or take a few (removing 1 or 2 seems not to break anything) then you are good to go.</p>
<p>Although I ran into the same observation as Glen Mazza. <a href="https://issues.apache.org/jira/browse/CXF-927"> jaxws:enableWrapperStyle not working in CXF</a></p>
<h3>Metro</h3>
<p>I downloaded the standalone version instead of a complete Glassfish distribution.<br />
I had to alter the <code>wsimport.sh</code> script, because WSImport needs <a href="http://java.sun.com/products/javabeans/jaf/downloads/index.html">JAF</a>. I added the <code>activation.jar</code> from the JBoss distribution to the classpath in the <code>wsimport.sh</code> script. The generated code enabled me to call ECS without any problems.<br />
I needed the following jars:</p>
<ul>
<li>webservices-extra.jar</li>
<li>webservices-rt.jar</li>
<li>webservcies-api.jar</li>
</ul>
<p>Compared to CXF, Metro just seems more environment friendly.  Of course this could be complete rubbish, since those three jars can be completely bloated with everything but the kitchen sink.</p>
<p>For now I will use Metro and see how this will go.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/pulleman.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/pulleman.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pulleman.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pulleman.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pulleman.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.pulleman.com&amp;blog=913562&amp;post=56&amp;subd=pulleman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.pulleman.com/2007/09/06/apache-cxf-and-glassfish-metro-for-consuming-web-services/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/561387d0c0c3fc3d68c109499fa468e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ronald Pulleman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
