<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Web Services and Seam</title>
	<atom:link href="http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html</link>
	<description>Java, ATG, Seam, and related Technologies</description>
	<pubDate>Thu, 20 Nov 2008 22:25:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: hashem</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-1049</link>
		<dc:creator>hashem</dc:creator>
		<pubDate>Thu, 31 May 2007 11:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-1049</guid>
		<description>What about JWSDP besides seam and Jboss?!!!
I have just started WebService! I started by sun's JAX-RPC sample and I was able to call the service(in an standalone java application) after spending fairly acceptable time!
So far so good, but when I try to use the same method in my web application to call the service, I get an untraceable error!!! (NOClassDefError)

Now I want to see if it is possible to call my service using sun's jwsd inside JBOSS in my seam based application? if so, which libraries do I need to put and in where!!?</description>
		<content:encoded><![CDATA[<p>What about JWSDP besides seam and Jboss?!!!<br />
I have just started WebService! I started by sun&#8217;s JAX-RPC sample and I was able to call the service(in an standalone java application) after spending fairly acceptable time!<br />
So far so good, but when I try to use the same method in my web application to call the service, I get an untraceable error!!! (NOClassDefError)</p>
<p>Now I want to see if it is possible to call my service using sun&#8217;s jwsd inside JBOSS in my seam based application? if so, which libraries do I need to put and in where!!?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjan van Bentem</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-1021</link>
		<dc:creator>Arjan van Bentem</dc:creator>
		<pubDate>Tue, 22 May 2007 14:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-1021</guid>
		<description>Alright, I'll consider this to be my personal blog ;-)

First some other notes from Heiko Braun in the very same &lt;a href="http://tinyurl.com/yqbzrf" rel="nofollow"&gt;forum post&lt;/a&gt;, which are worth repeating here:
&lt;blockquote&gt;I will try to explain what changes between 1.2.0 and 1.2.1 are causing the problems you encounter.
For EJB3 deployments we need to create a web app for HTTP invocations (obviously)
EJB's don't contain web context information, so we derive it automagically.
Until 1.2.0 the context name was derived from the ear/jar name.
This changed with 1.2.1 to an algorithm that derives it from the bean class name
So what's happening when you deploy a EJB3 jar that contains multiple beans?

The default algorithm derives different context names for each bean in this deployment, which in turn we cannot use to setup the HTTP endpoint and thus throw an exception.

This also explains why the following did work:
&lt;code&gt;&#160; &#160; @WebContext(contextRoot="/beans")&lt;/code&gt;

Unfortunately this is left out in the specs and thus has been changed many times.

Until we a have a definite solution i suggest you refer to the @WebContext annotation, even though it's not the most elegant solution.&lt;/blockquote&gt;

And to use it: it's org.jboss.ws.annotation.WebContext as found in jbossws-core.jar.

This also invalidates some comment at the bug I mentioned, which made me write "&lt;i&gt;[..] might indicate that this only changes the URL in the generated WSDL, not the URL of the WSDL itself&lt;/i&gt;", which is NOT true. So, the following works just fine (in AS 4.2.0.GA, and if &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/resources/META-INF/standard-jaxws-endpoint-config.xml" rel="nofollow"&gt;META-INF/standard-jaxws-endpoint-config.xml&lt;/a&gt; is present):

&lt;blockquote&gt;&lt;code&gt;// Service Endpoint Interface
@WebService
public interface DeepThoughtSEI {
&#160;&#160;@WebMethod
&#160;&#160;public String answer(String question);
}&lt;/code&gt;&lt;/blockquote&gt;

and

&lt;blockquote&gt;&lt;code&gt;@Stateless
@WebContext(contextRoot = "/guide/to/the/galaxy")
@WebService(endpointInterface = "my.package.DeepThoughtSEI")
public class DeepThought implements DeepThoughtSEI {
&#160; public String answer(String question){
&#160; &#160; return "42";
&#160; }
&#160; 
&#160; public String methodNotExposed(){
&#160; &#160; return "not for public use";
&#160; }
}
&lt;/code&gt;&lt;/blockquote&gt;

This serves the WSDL at http://universe.tld/guide/to/the/galaxy/DeepThought?wsdl -- but I guess it's to be considered a workaround.

Note that when not specifying a value for &lt;i&gt;endpointInterface&lt;/i&gt; then ALL methods in the DeepThought implementation would be exposed, unless at least one method is explicitly annotated in that class -- even though the interface explicitly only declares a single method to be exposed. In other words: the @WebMethod annotations in the interface are only honored when &lt;i&gt;endpointInterface&lt;/i&gt; is used.

And for those who get to this page because of the "Multiple context root not supported" error: that might also be caused by some left-overs after refactoring. I changed the name of my service, leaving the old compiled classes in various exploded EAR folders, which were then still loaded by JBoss...

Peek at the &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay" rel="nofollow"&gt;SeamBay example&lt;/a&gt;!

Enjoy,
Arjan.
-- the preview or stylesheet needs something to post pre-formatted code!</description>
		<content:encoded><![CDATA[<p>Alright, I&#8217;ll consider this to be my personal blog <img src='http://www.digitalsanctuary.com/tech-blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>First some other notes from Heiko Braun in the very same <a href="http://tinyurl.com/yqbzrf" rel="nofollow">forum post</a>, which are worth repeating here:</p>
<blockquote><p>I will try to explain what changes between 1.2.0 and 1.2.1 are causing the problems you encounter.<br />
For EJB3 deployments we need to create a web app for HTTP invocations (obviously)<br />
EJB&#8217;s don&#8217;t contain web context information, so we derive it automagically.<br />
Until 1.2.0 the context name was derived from the ear/jar name.<br />
This changed with 1.2.1 to an algorithm that derives it from the bean class name<br />
So what&#8217;s happening when you deploy a EJB3 jar that contains multiple beans?</p>
<p>The default algorithm derives different context names for each bean in this deployment, which in turn we cannot use to setup the HTTP endpoint and thus throw an exception.</p>
<p>This also explains why the following did work:<br />
<code>&nbsp; &nbsp; @WebContext(contextRoot="/beans")</code></p>
<p>Unfortunately this is left out in the specs and thus has been changed many times.</p>
<p>Until we a have a definite solution i suggest you refer to the @WebContext annotation, even though it&#8217;s not the most elegant solution.</p></blockquote>
<p>And to use it: it&#8217;s org.jboss.ws.annotation.WebContext as found in jbossws-core.jar.</p>
<p>This also invalidates some comment at the bug I mentioned, which made me write &#8220;<i>[..] might indicate that this only changes the URL in the generated WSDL, not the URL of the WSDL itself</i>&#8220;, which is NOT true. So, the following works just fine (in AS 4.2.0.GA, and if <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/resources/META-INF/standard-jaxws-endpoint-config.xml" rel="nofollow">META-INF/standard-jaxws-endpoint-config.xml</a> is present):</p>
<blockquote><p><code>// Service Endpoint Interface<br />
@WebService<br />
public interface DeepThoughtSEI {<br />
&nbsp;&nbsp;@WebMethod<br />
&nbsp;&nbsp;public String answer(String question);<br />
}</code></p></blockquote>
<p>and</p>
<blockquote><p><code>@Stateless<br />
@WebContext(contextRoot = "/guide/to/the/galaxy")<br />
@WebService(endpointInterface = "my.package.DeepThoughtSEI")<br />
public class DeepThought implements DeepThoughtSEI {<br />
&nbsp; public String answer(String question){<br />
&nbsp; &nbsp; return "42";<br />
&nbsp; }<br />
&nbsp;<br />
&nbsp; public String methodNotExposed(){<br />
&nbsp; &nbsp; return "not for public use";<br />
&nbsp; }<br />
}<br />
</code></p></blockquote>
<p>This serves the WSDL at <a href="http://universe.tld/guide/to/the/galaxy/DeepThought?wsdl" rel="nofollow">http://universe.tld/guide/to/the/galaxy/DeepThought?wsdl</a> &#8212; but I guess it&#8217;s to be considered a workaround.</p>
<p>Note that when not specifying a value for <i>endpointInterface</i> then ALL methods in the DeepThought implementation would be exposed, unless at least one method is explicitly annotated in that class &#8212; even though the interface explicitly only declares a single method to be exposed. In other words: the @WebMethod annotations in the interface are only honored when <i>endpointInterface</i> is used.</p>
<p>And for those who get to this page because of the &#8220;Multiple context root not supported&#8221; error: that might also be caused by some left-overs after refactoring. I changed the name of my service, leaving the old compiled classes in various exploded EAR folders, which were then still loaded by JBoss&#8230;</p>
<p>Peek at the <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay" rel="nofollow">SeamBay example</a>!</p>
<p>Enjoy,<br />
Arjan.<br />
&#8211; the preview or stylesheet needs something to post pre-formatted code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjan van Bentem</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-1019</link>
		<dc:creator>Arjan van Bentem</dc:creator>
		<pubDate>Tue, 22 May 2007 10:45:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-1019</guid>
		<description>Ok, some more information... 

The META-INF/standard-jaxws-endpoint-config.xml file is the default filename as part of a JBoss proprietary annotation, @EndpointConfig. It has it's own &lt;a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Endpoint_Configuration" rel="nofollow"&gt;documentation page&lt;/a&gt; on the wiki, which took me some time to find but actually is linked in the "Appendix A" section of the &lt;a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide" rel="nofollow"&gt;JBoss JAX-WS User Guide&lt;/a&gt;. It doesn't help me much but might have been enhanced by the time someone reads this... 

The client side has its own default file, &lt;a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Client_Configuration" rel="nofollow"&gt;standard-jaxws-client-config.xml&lt;/a&gt;.

One might be able to change the URLs by using @WebContext, which is another JBoss proprietary annotation. However, some bug report (find JBWS-1622 or copy http://tinyurl.com/yv3da8 -- the preview gets confused by too many URLs or something?) might indicate that this only changes the URL in the generated WSDL, not the URL of the WSDL itself. It also strikes me as odd to define the context root in the Java code... I did not try this.

The @WebContext annotation might also be a (temporary) &lt;a href="http://tinyurl.com/yqbzrf" rel="nofollow"&gt;solution&lt;/a&gt; when deploying multiple web services, at which point one might encounter "Multiple context root not supported" errors. The solution states:
&lt;blockquote&gt;Just make sure all EJB's within a jar point to the same web context thriugh something like:
@WebContext(contextRoot="/myEJBServices") &lt;/blockquote&gt;

Well, that's it for today...!
Arjan.</description>
		<content:encoded><![CDATA[<p>Ok, some more information&#8230; </p>
<p>The META-INF/standard-jaxws-endpoint-config.xml file is the default filename as part of a JBoss proprietary annotation, @EndpointConfig. It has it&#8217;s own <a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Endpoint_Configuration" rel="nofollow">documentation page</a> on the wiki, which took me some time to find but actually is linked in the &#8220;Appendix A&#8221; section of the <a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide" rel="nofollow">JBoss JAX-WS User Guide</a>. It doesn&#8217;t help me much but might have been enhanced by the time someone reads this&#8230; </p>
<p>The client side has its own default file, <a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Client_Configuration" rel="nofollow">standard-jaxws-client-config.xml</a>.</p>
<p>One might be able to change the URLs by using @WebContext, which is another JBoss proprietary annotation. However, some bug report (find JBWS-1622 or copy <a href="http://tinyurl.com/yv3da8" rel="nofollow">http://tinyurl.com/yv3da8</a> &#8212; the preview gets confused by too many URLs or something?) might indicate that this only changes the URL in the generated WSDL, not the URL of the WSDL itself. It also strikes me as odd to define the context root in the Java code&#8230; I did not try this.</p>
<p>The @WebContext annotation might also be a (temporary) <a href="http://tinyurl.com/yqbzrf" rel="nofollow">solution</a> when deploying multiple web services, at which point one might encounter &#8220;Multiple context root not supported&#8221; errors. The solution states:</p>
<blockquote><p>Just make sure all EJB&#8217;s within a jar point to the same web context thriugh something like:<br />
@WebContext(contextRoot=&#8221;/myEJBServices&#8221;) </p></blockquote>
<p>Well, that&#8217;s it for today&#8230;!<br />
Arjan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devon</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-1016</link>
		<dc:creator>Devon</dc:creator>
		<pubDate>Mon, 21 May 2007 16:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-1016</guid>
		<description>Arjan,

very cool!  Thank you very much for following up on that.  I really need to checkout the newer stuff.  I tried moving my 10MinuteMail app over to the newer Seam running on 4.2.0 GA, but the server hangs while booting up.  Remove the ear and it's fine.  No error messages, just locks up.  I haven't had the time to dive too deeply into it and pull stacktraces and the like.

Wish me luck!

Regards,

Devon</description>
		<content:encoded><![CDATA[<p>Arjan,</p>
<p>very cool!  Thank you very much for following up on that.  I really need to checkout the newer stuff.  I tried moving my 10MinuteMail app over to the newer Seam running on 4.2.0 GA, but the server hangs while booting up.  Remove the ear and it&#8217;s fine.  No error messages, just locks up.  I haven&#8217;t had the time to dive too deeply into it and pull stacktraces and the like.</p>
<p>Wish me luck!</p>
<p>Regards,</p>
<p>Devon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjan van Bentem</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-1015</link>
		<dc:creator>Arjan van Bentem</dc:creator>
		<pubDate>Mon, 21 May 2007 13:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-1015</guid>
		<description>As for the odd URLs: when using JBoss AS 4.2.0.GA (instead of 4.2.0.RC1 which was current in April 2007) then one gets better URLs, which no longer hold the context name, but the class name instead. 

For example, for &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java" rel="nofollow"&gt;org.jboss.seam.example.seambay.AuctionService&lt;/a&gt; JBoss AS (or actually: jbossws-1.2.1.GA which is included in AS 4.2.0.GA) now generates 

  http://127.0.0.1:8080/AuctionServiceService/AuctionService?wsdl

So: neither the package name nor the context name are used, whereas the application itself could still be hosted at 

  http://127.0.0.1:8080/seam-bay/home.seam

I have not yet figured out if one can control the names JBoss chooses -- I'd rather not rely on JBoss AS choosing a different name if ever upgrading the application server. As a first start, to avoid the double word "Service" maybe one should no longer name the service endpoint classes XYZService...

Finally: please not that apparently I linked to an old version of the User Guide above; for jbossws-1.2.0 and higher the &lt;a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide" rel="nofollow"&gt;JBoss JAX-WS User Guide&lt;/a&gt; as found at the wiki should be used.

Arjan.</description>
		<content:encoded><![CDATA[<p>As for the odd URLs: when using JBoss AS 4.2.0.GA (instead of 4.2.0.RC1 which was current in April 2007) then one gets better URLs, which no longer hold the context name, but the class name instead. </p>
<p>For example, for <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java" rel="nofollow">org.jboss.seam.example.seambay.AuctionService</a> JBoss AS (or actually: jbossws-1.2.1.GA which is included in AS 4.2.0.GA) now generates </p>
<p>  <a href="http://127.0.0.1:8080/AuctionServiceService/AuctionService?wsdl" rel="nofollow">http://127.0.0.1:8080/AuctionServiceService/AuctionService?wsdl</a></p>
<p>So: neither the package name nor the context name are used, whereas the application itself could still be hosted at </p>
<p>  <a href="http://127.0.0.1:8080/seam-bay/home.seam" rel="nofollow">http://127.0.0.1:8080/seam-bay/home.seam</a></p>
<p>I have not yet figured out if one can control the names JBoss chooses &#8212; I&#8217;d rather not rely on JBoss AS choosing a different name if ever upgrading the application server. As a first start, to avoid the double word &#8220;Service&#8221; maybe one should no longer name the service endpoint classes XYZService&#8230;</p>
<p>Finally: please not that apparently I linked to an old version of the User Guide above; for jbossws-1.2.0 and higher the <a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide" rel="nofollow">JBoss JAX-WS User Guide</a> as found at the wiki should be used.</p>
<p>Arjan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devon</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-837</link>
		<dc:creator>Devon</dc:creator>
		<pubDate>Thu, 26 Apr 2007 17:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-837</guid>
		<description>I'll have to check out the Seam 1.3 builds.  I haven't had time to look at the CVS build in a while.  Thanks!  I'll check it out!

Devon</description>
		<content:encoded><![CDATA[<p>I&#8217;ll have to check out the Seam 1.3 builds.  I haven&#8217;t had time to look at the CVS build in a while.  Thanks!  I&#8217;ll check it out!</p>
<p>Devon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjan van Bentem</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/web-services-and-seam.html#comment-836</link>
		<dc:creator>Arjan van Bentem</dc:creator>
		<pubDate>Thu, 26 Apr 2007 15:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/15#comment-836</guid>
		<description>The new Seam 1.3 &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay" rel="nofollow"&gt;SeamBay&lt;/a&gt; example does it slightly different. Note that Seam 1.3 is currently only available from CVS, and web services is &lt;a href="http://tinyurl.com/2nqydb" rel="nofollow"&gt;work in progress&lt;/a&gt; (I had to use a &lt;a href="http://preview.tinyurl.com/2nqydb" rel="nofollow"&gt;TinyURL&lt;/a&gt; as the JBoss forum URL was not understood by the preview).

In CVS, &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java" rel="nofollow"&gt;AuctionService&lt;/a&gt; only uses @WebService and @WebMethod, and implements &lt;a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionServiceRemote.java" rel="nofollow"&gt;AuctionServiceRemote&lt;/a&gt; which uses @Remote. No further configuration in web.xml, but an additional configuration file META-INF/standard-jaxws-endpoint-config.xml which is included in the JAR file.

This gets one odd URI's such as /seam-bay-seam-bay/AuctionService (the web site being available at /seam-bay, this name is simply duplicated to get a unique URL). I don't know where this is defined; maybe one needs to change web.xml after all to get custom URLs.

See also the &lt;a href="http://labs.jboss.com/jbossws/user-guide/en/html_single/index.html" rel="nofollow"&gt;JBossWS User Guide&lt;/a&gt; and the &lt;a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Endpoint_Configuration" rel="nofollow"&gt;JAX-WS Endpoint Configuration&lt;/a&gt; wiki pages.</description>
		<content:encoded><![CDATA[<p>The new Seam 1.3 <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay" rel="nofollow">SeamBay</a> example does it slightly different. Note that Seam 1.3 is currently only available from CVS, and web services is <a href="http://tinyurl.com/2nqydb" rel="nofollow">work in progress</a> (I had to use a <a href="http://preview.tinyurl.com/2nqydb" rel="nofollow">TinyURL</a> as the JBoss forum URL was not understood by the preview).</p>
<p>In CVS, <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionService.java" rel="nofollow">AuctionService</a> only uses @WebService and @WebMethod, and implements <a href="http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionServiceRemote.java" rel="nofollow">AuctionServiceRemote</a> which uses @Remote. No further configuration in web.xml, but an additional configuration file META-INF/standard-jaxws-endpoint-config.xml which is included in the JAR file.</p>
<p>This gets one odd URI&#8217;s such as /seam-bay-seam-bay/AuctionService (the web site being available at /seam-bay, this name is simply duplicated to get a unique URL). I don&#8217;t know where this is defined; maybe one needs to change web.xml after all to get custom URLs.</p>
<p>See also the <a href="http://labs.jboss.com/jbossws/user-guide/en/html_single/index.html" rel="nofollow">JBossWS User Guide</a> and the <a href="http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_Endpoint_Configuration" rel="nofollow">JAX-WS Endpoint Configuration</a> wiki pages.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
