<?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>Legolas in Minas Tirith &#187; java</title>
	<atom:link href="http://www.javalinux.it/wordpress/categories/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javalinux.it/wordpress</link>
	<description>Alessio &#38; Stefano ideas</description>
	<lastBuildDate>Wed, 14 Sep 2011 14:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Chasing reason for a deadlock in JDK</title>
		<link>http://www.javalinux.it/wordpress/2011/07/11/chasing-reason-for-a-deadlock-in-jdk/</link>
		<comments>http://www.javalinux.it/wordpress/2011/07/11/chasing-reason-for-a-deadlock-in-jdk/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 11:04:20 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=505</guid>
		<description><![CDATA[Last week I spent a couple of days on a strange deadlock issue revealed during JBossWS testsuite runs on my Husdon QA environment. This kind of issues usually pops up through a test / section of the software that simply hangs without no evident reason. You don&#8217;t get continuous integration results for a day or [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I spent a couple of days on a strange deadlock issue revealed during JBossWS testsuite runs on my Husdon QA environment.</p>
<p>This kind of issues usually pops up through a test / section of the software that simply hangs without no evident reason. You don&#8217;t get continuous integration results for a day or such, then wonder what&#8217;s happening, go and check Hudson and start thinking and asking yourself what might have gone bad. In my case it was really &#8220;asking yourself&#8221; as of course this happened exactly when I was back from a vacation week and my colleagues that were working on the project were not online <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   (to be honest at the end it turned out not to be their fault at all)</p>
<p>OK, so you start by getting a thread dump to confirm you&#8217;re seeing a deadlock; that&#8217;s a simple &#8220;kill -3 pid&#8221; when running on Linux. Here is mine:</p>
<pre>[junit] Found one Java-level deadlock:
[junit] =============================
[junit] "pool-1-thread-1":
[junit]   waiting to lock monitor 0x000000005d2c60c0 (object 0x00002aaadfb10fd8,
                                          a sun.net.www.protocol.file.Handler),
[junit]   which is held by "main"
[junit] "main":
[junit]   waiting to lock monitor 0x000000005cb02a58 (object 0x00002aaadfb10e38,
                                          a sun.misc.Launcher$AppClassLoader),
[junit]   which is held by "pool-1-thread-1"
[junit]
[junit] Java stack information for the threads listed above:
[junit] ===================================================
[junit] "pool-1-thread-1":
[junit] 	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
[junit] 	- waiting to lock &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
[junit] 	at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:439)
[junit] 	at sun.net.www.protocol.file.Handler.hostsEqual(Handler.java:117)
[junit] 	at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:396)
[junit] 	at java.net.URLStreamHandler.equals(URLStreamHandler.java:316)
[junit] 	at java.net.URL.equals(URL.java:842)
[junit] 	at java.security.CodeSource.equals(CodeSource.java:135)
[junit] 	at java.util.HashMap.get(HashMap.java:305)
[junit] 	at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:233)
[junit] 	- locked &lt;0x00002aaadfb11120&gt; (a java.util.HashMap)
[junit] 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[junit] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[junit] 	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[junit] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[junit] 	at java.security.AccessController.doPrivileged(Native Method)
[junit] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[junit] 	- locked &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
[junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[junit] 	- locked &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
[junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[junit] 	at org.xnio.nio.AbstractNioChannelThread.cancelKey(AbstractNioChannelThread.java:298)
[junit] 	at org.xnio.nio.NioHandle.cancelKey(NioHandle.java:56)
[junit] 	at org.xnio.nio.AbstractNioStreamChannel.cancelWriteKey(AbstractNioStreamChannel.java:241)
[junit] 	at org.xnio.nio.NioTcpChannel.shutdownWrites(NioTcpChannel.java:164)
[junit] 	at org.xnio.channels.TranslatingSuspendableChannel.shutdownWrites(TranslatingSuspendableChannel.java:358)
[junit] 	at org.xnio.channels.FramedMessageChannel.shutdownWrites(FramedMessageChannel.java:255)
[junit] 	- locked &lt;0x00002aaadfb11978&gt; (a org.xnio.ByteBufferSlicePool$PooledByteBuffer)
[junit] 	at org.jboss.remoting3.remote.RemoteConnection$RemoteWriteListener.send(RemoteConnection.java:267)
[junit] 	- locked &lt;0x00002aaadfb119a0&gt; (a org.jboss.remoting3.remote.RemoteConnection)
[junit] 	at org.jboss.remoting3.remote.RemoteConnection.sendCloseRequest(RemoteConnection.java:164)
[junit] 	at org.jboss.remoting3.remote.RemoteConnection.handleOutboundCloseRequest(RemoteConnection.java:149)
[junit] 	at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAction(RemoteConnectionHandler.java:173)
[junit] 	at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:354)
[junit] 	at org.jboss.remoting3.ConnectionImpl.closeAction(ConnectionImpl.java:48)
[junit] 	at org.jboss.remoting3.spi.AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:149)
[junit] 	at org.xnio.IoUtils.safeClose(IoUtils.java:134)
[junit] 	at org.jboss.as.protocol.ProtocolChannelClient.close(ProtocolChannelClient.java:176)
[junit] 	at org.xnio.IoUtils.safeClose(IoUtils.java:134)
[junit] 	at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.requestDone(ManagementClientChannelStrategy.java:138)
[junit] 	at org.jboss.as.protocol.mgmt.ManagementRequest$DelegatingResponseHandler.readResponse(ManagementRequest.java:178)
[junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel$ResponseReceiver.handleResponse(ManagementChannel.java:375)
[junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel$ResponseReceiver.access$400(ManagementChannel.java:357)
[junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel.doHandle(ManagementChannel.java:120)
[junit] 	at org.jboss.as.protocol.ProtocolChannel.handleMessage(ProtocolChannel.java:158)
[junit] 	at org.jboss.remoting3.remote.RemoteConnectionChannel$4.run(RemoteConnectionChannel.java:224)
[junit] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[junit] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[junit] 	at java.lang.Thread.run(Thread.java:619)
[junit] "main":
[junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
[junit] 	- waiting to lock &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
[junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[junit] 	at java.net.URL.getURLStreamHandler(URL.java:1144)
[junit] 	at java.net.URL.&lt;init&gt;(URL.java:393)
[junit] 	at java.net.URL.&lt;init&gt;(URL.java:283)
[junit] 	at java.net.URL.&lt;init&gt;(URL.java:306)
[junit] 	at sun.net.www.protocol.file.Handler.openConnection(Handler.java:74)
[junit] 	- locked &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
[junit] 	at sun.net.www.protocol.file.Handler.openConnection(Handler.java:55)
[junit] 	- locked &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
[junit] 	at java.net.URL.openConnection(URL.java:945)
[junit] 	at sun.net.www.protocol.jar.JarURLConnection.&lt;init&gt;(JarURLConnection.java:66)
[junit] 	at sun.net.www.protocol.jar.Handler.openConnection(Handler.java:24)
[junit] 	at java.net.URL.openConnection(URL.java:945)
[junit] 	at org.apache.cxf.common.logging.JDKBugHacks.doHacks(JDKBugHacks.java:67)
[junit] 	at org.apache.cxf.common.logging.LogUtils.&lt;clinit&gt;(LogUtils.java:66)
[junit] 	at org.apache.cxf.jaxws.spi.ProviderImpl.&lt;clinit&gt;(ProviderImpl.java:61)
[junit] 	at java.lang.Class.forName0(Native Method)
[junit] 	at java.lang.Class.forName(Class.java:247)
[junit] 	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
[junit] 	at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
[junit] 	at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
[junit] 	at javax.xml.ws.spi.Provider.provider(Provider.java:106)
[junit] 	at javax.xml.ws.Service.&lt;init&gt;(Service.java:57)
[junit] 	at javax.xml.ws.Service.create(Service.java:687)
[junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionEJB3Helper.getProxy(ExceptionEJB3Helper.java:48)
[junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionHelper.testRuntimeException(ExceptionHelper.java:81)
[junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionTestCase.testRuntimeException(ExceptionTestCase.java:45)
[junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] 	at java.lang.reflect.Method.invoke(Method.java:597)
[junit] 	at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] 	at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] 	at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] 	at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] 	at junit.framework.TestResult.run(TestResult.java:109)
[junit] 	at junit.framework.TestCase.run(TestCase.java:118)
[junit] 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] 	at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
[junit] 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
[junit] 	at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] 	at junit.extensions.TestSetup.run(TestSetup.java:23)
[junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
[junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
[junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
[junit]
[junit] Found 1 deadlock.
</pre>
<p>Confirmed, it was really a deadlock. Not a straightforward one to solve, at least to me, given the blocking part were a bit deep into the JDK (1.6) sources.</p>
<p>A bit of background on what&#8217;s been developed here and which are the game &#8220;players&#8221;: <a href="http://www.jboss.org/jbossws">JBossWS</a> provides and integration layer for running <a href="http://cxf.apache.org/">Apache CXF</a> on top of JBoss Application Server. The testcase being executed above (in thread &#8220;main&#8221;) is a simple standard JAX-WS client application that creates a<em> java.xml.ws.Service</em> instance for consuming an endpoint that&#8217;s deployed on JBoss AS. The &#8220;pool-1-thread-1&#8243; thread should instead be spawned by the remote deployment request that&#8217;s issued by the testsuite to deploy a WS endpoint jar archive on JBoss AS before actually running the client test.</p>
<p>The problem was not easily and consistently reproducible locally, so I used a debugger to force the &#8220;evil&#8221; timing that causes the deadlock: you set a breakpoint on the code executed by both threads above, before each of them goes through one of the &#8220;- locked &lt;&#8230;&gt;&#8221; points. Then have each of them acquire the first lock and you&#8217;re done, sure deadlock when each thread later wants the other lock.</p>
<p>So, carefully analysing the problem I understood what was really happening. The deadlock above is between the system classloader and <em>sun.net.www.protocol.file.Handler</em>, due to their <strong>synchronized</strong> <em>Classloader::loadClass()</em> and <em>Handler::openConnection()/Handler::getHostAddress()</em> methods. During initialization, Apache CXF performs some hacks, including disabling url caching; to achieve that, it opens a new connection as <a href="http://download.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setDefaultUseCaches%28boolean%29">JDK does not have a static method for setting that</a>, despite the <a href="http://www.docjar.com/html/api/java/net/URLConnection.java.html">flag being actually static</a>. The process of opening a connection goes through the Handler&#8217;s synchronized openConnection() method and in there ends up needing the system classloader for loading a class. Unfortunately, the lock on the system classloader might be taken by another thread invoking the synchronized loadClass() on it and also needing to use the CodeSource for locating the class to be loaded. That eventually ends up in needing the <em>URLStreamHandler</em> / <em>Handler</em> for comparing URL instances.</p>
<p><em>URLStreamHandler</em>? For those not having experience here, Java comes with a <a href="http://java.sun.com/developer/onlineTraining/protocolhandlers/">configurable architecture</a> for resolving URLs. Simplifying things a lot, the URLStreamHandler is created using the specified URLStreamHandlerFactory, which can be configured setting the java.protocol.handler.pkgs system property. Why is this relevant here? Basically because JBoss needs and uses this mechanism for installing his own handler to <a href="http://java.dzone.com/news/jboss-virtual-file-system">deal with <em>vfs</em> URLs</a>. Looking at the code for the configured factory, the returned handler is basically a singleton. Hence the deadlock, regardless of the <em>vfs-aware</em> handler not being needed here.</p>
<p>How to solve the issue? While it might be arguable whether having singleton protocol handler is a good choice or not, I couldn&#8217;t change that quickly and easily, as it was &#8220;out of my area of action&#8221;. I ended up <a href="https://issues.apache.org/jira/browse/CXF-3634">changing the Apache CXF code</a> after having had a chat with Dan Kulp (CXF project lead): instead of actually opening a connection to get an handle to a URLConnection instance for the sake of disabling URL caching, we now simply create a concrete extension of the abstract URLConnection that is only used for setting the static member through its <em>setDefaultUseCaches()</em> non-static method.</p>
<p>The fix is effective for the specific issue I had and in general for reducing the chances of running into deadlock because of Apache CXF. However, few considerations / caveats are still valid:</p>
<ul>
<li>be careful when designing and providing your own protocol handlers, as that can have really unexpected side effects</li>
<li>opening a connection can be time consuming even before URLConnection::connect() due to all the locking that&#8217;s required in there; obviously another reason for checking twice if you really need opening a connection before actually doing that</li>
<li>is JDK really well designed here? (non-static URLConnection.setDefaultUseCaches(..))</li>
</ul>
<p>It&#8217;s been a nice debugging in any case <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 22px; width: 1px; height: 1px; overflow: hidden;">
<pre>[junit] Found one Java-level deadlock:
    [junit] =============================
    [junit] "pool-1-thread-1":
    [junit]   waiting to lock monitor 0x000000005d2c60c0 (object 0x00002aaadfb10fd8, a sun.net.www.protocol.file.Handler),
    [junit]   which is held by "main"
    [junit] "main":
    [junit]   waiting to lock monitor 0x000000005cb02a58 (object 0x00002aaadfb10e38, a sun.misc.Launcher$AppClassLoader),
    [junit]   which is held by "pool-1-thread-1"
    [junit]
    [junit] Java stack information for the threads listed above:
    [junit] ===================================================
    [junit] "pool-1-thread-1":
    [junit] 	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
    [junit] 	- waiting to lock &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
    [junit] 	at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:439)
    [junit] 	at sun.net.www.protocol.file.Handler.hostsEqual(Handler.java:117)
    [junit] 	at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:396)
    [junit] 	at java.net.URLStreamHandler.equals(URLStreamHandler.java:316)
    [junit] 	at java.net.URL.equals(URL.java:842)
    [junit] 	at java.security.CodeSource.equals(CodeSource.java:135)
    [junit] 	at java.util.HashMap.get(HashMap.java:305)
    [junit] 	at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:233)
    [junit] 	- locked &lt;0x00002aaadfb11120&gt; (a java.util.HashMap)
    [junit] 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    [junit] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    [junit] 	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    [junit] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    [junit] 	at java.security.AccessController.doPrivileged(Native Method)
    [junit] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    [junit] 	- locked &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
    [junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [junit] 	- locked &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    [junit] 	at org.xnio.nio.AbstractNioChannelThread.cancelKey(AbstractNioChannelThread.java:298)
    [junit] 	at org.xnio.nio.NioHandle.cancelKey(NioHandle.java:56)
    [junit] 	at org.xnio.nio.AbstractNioStreamChannel.cancelWriteKey(AbstractNioStreamChannel.java:241)
    [junit] 	at org.xnio.nio.NioTcpChannel.shutdownWrites(NioTcpChannel.java:164)
    [junit] 	at org.xnio.channels.TranslatingSuspendableChannel.shutdownWrites(TranslatingSuspendableChannel.java:358)
    [junit] 	at org.xnio.channels.FramedMessageChannel.shutdownWrites(FramedMessageChannel.java:255)
    [junit] 	- locked &lt;0x00002aaadfb11978&gt; (a org.xnio.ByteBufferSlicePool$PooledByteBuffer)
    [junit] 	at org.jboss.remoting3.remote.RemoteConnection$RemoteWriteListener.send(RemoteConnection.java:267)
    [junit] 	- locked &lt;0x00002aaadfb119a0&gt; (a org.jboss.remoting3.remote.RemoteConnection)
    [junit] 	at org.jboss.remoting3.remote.RemoteConnection.sendCloseRequest(RemoteConnection.java:164)
    [junit] 	at org.jboss.remoting3.remote.RemoteConnection.handleOutboundCloseRequest(RemoteConnection.java:149)
    [junit] 	at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAction(RemoteConnectionHandler.java:173)
    [junit] 	at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:354)
    [junit] 	at org.jboss.remoting3.ConnectionImpl.closeAction(ConnectionImpl.java:48)
    [junit] 	at org.jboss.remoting3.spi.AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:149)
    [junit] 	at org.xnio.IoUtils.safeClose(IoUtils.java:134)
    [junit] 	at org.jboss.as.protocol.ProtocolChannelClient.close(ProtocolChannelClient.java:176)
    [junit] 	at org.xnio.IoUtils.safeClose(IoUtils.java:134)
    [junit] 	at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.requestDone(ManagementClientChannelStrategy.java:138)
    [junit] 	at org.jboss.as.protocol.mgmt.ManagementRequest$DelegatingResponseHandler.readResponse(ManagementRequest.java:178)
    [junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel$ResponseReceiver.handleResponse(ManagementChannel.java:375)
    [junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel$ResponseReceiver.access$400(ManagementChannel.java:357)
    [junit] 	at org.jboss.as.protocol.mgmt.ManagementChannel.doHandle(ManagementChannel.java:120)
    [junit] 	at org.jboss.as.protocol.ProtocolChannel.handleMessage(ProtocolChannel.java:158)
    [junit] 	at org.jboss.remoting3.remote.RemoteConnectionChannel$4.run(RemoteConnectionChannel.java:224)
    [junit] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    [junit] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    [junit] 	at java.lang.Thread.run(Thread.java:619)
    [junit] "main":
    [junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
    [junit] 	- waiting to lock &lt;0x00002aaadfb10e38&gt; (a sun.misc.Launcher$AppClassLoader)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    [junit] 	at java.net.URL.getURLStreamHandler(URL.java:1144)
    [junit] 	at java.net.URL.&lt;init&gt;(URL.java:393)
    [junit] 	at java.net.URL.&lt;init&gt;(URL.java:283)
    [junit] 	at java.net.URL.&lt;init&gt;(URL.java:306)
    [junit] 	at sun.net.www.protocol.file.Handler.openConnection(Handler.java:74)
    [junit] 	- locked &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
    [junit] 	at sun.net.www.protocol.file.Handler.openConnection(Handler.java:55)
    [junit] 	- locked &lt;0x00002aaadfb10fd8&gt; (a sun.net.www.protocol.file.Handler)
    [junit] 	at java.net.URL.openConnection(URL.java:945)
    [junit] 	at sun.net.www.protocol.jar.JarURLConnection.&lt;init&gt;(JarURLConnection.java:66)
    [junit] 	at sun.net.www.protocol.jar.Handler.openConnection(Handler.java:24)
    [junit] 	at java.net.URL.openConnection(URL.java:945)
    [junit] 	at org.apache.cxf.common.logging.JDKBugHacks.doHacks(JDKBugHacks.java:67)
    [junit] 	at org.apache.cxf.common.logging.LogUtils.&lt;clinit&gt;(LogUtils.java:66)
    [junit] 	at org.apache.cxf.jaxws.spi.ProviderImpl.&lt;clinit&gt;(ProviderImpl.java:61)
    [junit] 	at java.lang.Class.forName0(Native Method)
    [junit] 	at java.lang.Class.forName(Class.java:247)
    [junit] 	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
    [junit] 	at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
    [junit] 	at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
    [junit] 	at javax.xml.ws.spi.Provider.provider(Provider.java:106)
    [junit] 	at javax.xml.ws.Service.&lt;init&gt;(Service.java:57)
    [junit] 	at javax.xml.ws.Service.create(Service.java:687)
    [junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionEJB3Helper.getProxy(ExceptionEJB3Helper.java:48)
    [junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionHelper.testRuntimeException(ExceptionHelper.java:81)
    [junit] 	at org.jboss.test.ws.jaxws.samples.exception.ExceptionTestCase.testRuntimeException(ExceptionTestCase.java:45)
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] 	at java.lang.reflect.Method.invoke(Method.java:597)
    [junit] 	at junit.framework.TestCase.runTest(TestCase.java:154)
    [junit] 	at junit.framework.TestCase.runBare(TestCase.java:127)
    [junit] 	at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit] 	at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit] 	at junit.framework.TestResult.run(TestResult.java:109)
    [junit] 	at junit.framework.TestCase.run(TestCase.java:118)
    [junit] 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit] 	at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit] 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    [junit] 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    [junit] 	at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit] 	at junit.extensions.TestSetup.run(TestSetup.java:23)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
    [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
    [junit]
    [junit] Found 1 deadlock.
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2011/07/11/chasing-reason-for-a-deadlock-in-jdk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JBossWS talk @JBUG Munich</title>
		<link>http://www.javalinux.it/wordpress/2011/05/11/jbossws-talk-jbug-munich/</link>
		<comments>http://www.javalinux.it/wordpress/2011/05/11/jbossws-talk-jbug-munich/#comments</comments>
		<pubDate>Wed, 11 May 2011 13:21:28 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jbossws]]></category>
		<category><![CDATA[webserice]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=500</guid>
		<description><![CDATA[I&#8217;m having a talk on JBossWS project next Monday (May, 16th) in Munich. More details, as well as the presentation abstract, available on the JBUG Munich website. If you&#8217;re interested and happen to be around&#8230;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m having a talk on JBossWS project next Monday (May, 16th) in Munich.</p>
<p>More details, as well as the presentation abstract, available on the <a href="http://jbug-munich.org/">JBUG Munich website</a>. If you&#8217;re interested and happen to be around&#8230; <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2011/05/11/jbossws-talk-jbug-munich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iron Jacamar Beta3 is out</title>
		<link>http://www.javalinux.it/wordpress/2010/10/27/iron-jacamar-beta3-is-out/</link>
		<comments>http://www.javalinux.it/wordpress/2010/10/27/iron-jacamar-beta3-is-out/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 06:37:35 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=452</guid>
		<description><![CDATA[Just a cross post to announce that my full time job project has been released http://in.relation.to/17567.lace As said in the original post we have worked mainly on AS7 integration in this release, ad it was a lot of fun]]></description>
			<content:encoded><![CDATA[<p>Just a  cross post to announce that my full time job project has been released</p>
<p><a href="http://in.relation.to/17567.lace" target="_blank">http://in.relation.to/17567.lace</a></p>
<p>As said in the original post we have worked mainly on <a href="http://github.com/jbossas/jboss-as" target="_blank">AS7</a> integration in this release, ad it was a lot of fun <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/10/27/iron-jacamar-beta3-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sibilla first release: experience a new approach to unit testing</title>
		<link>http://www.javalinux.it/wordpress/2010/10/12/sibilla-first-release-experince-a-new-approach-to-unit-testing/</link>
		<comments>http://www.javalinux.it/wordpress/2010/10/12/sibilla-first-release-experince-a-new-approach-to-unit-testing/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 22:16:05 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[testedby]]></category>
		<category><![CDATA[sibilla]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=390</guid>
		<description><![CDATA[abstract: [...] collecting metadata set that represent links between classes under test and test classes (and eventually more fine grained links between methods) and using them for a lot of purposes. Metadata can be collected from different sources: annotations on classes under test, instrumentation of test classes during tests&#8217; execution (in future perhaps even from [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><span style="font-size: small;"><br />
</span></p>
<p>abstract:</p>
<blockquote><p><span style="color: #800000;">[...] <span style="font-size: large;">c</span><em><span style="font-size: large;">ollecting metadata set that represent links between classes under test and test classes (and eventually more fine grained links between methods) and using them for a lot of purposes. Metadata can be collected from different sources: annotations on classes under test, instrumentation of test classes during tests&#8217; execution (in future perhaps even from a dedicated user interface). These metadata can be used for various goals: f</span></em><strong><em><span style="font-size: large;">irst of all it becomes possible to run only the tests that stress just a particular set of classes (for instance the classes changed since last compilation) <span style="font-weight: normal;">[...] We have a Maven plugin, while Eclipse and Hudson ones are in our roadmap.</span></span></em></strong></span></p></blockquote>
<p>Full story:</p>
<p><a href="http://www.javalinux.it/wordpress/2008/10/20/a-new-approach-to-unit-tests/" target="_blank">A while ago I&#8217;ve written a post about a new approach to unit tests</a>; it has been a quite read and discussed post and it gives the momentum for starting a new community discussing about the idea and working on a software project implementing this idea. The project was named TestedBy and  hosted in google code.</p>
<p>That idea has evolved and changed and we have decided to change also the name of the project as a remark of these changes, calling it <a href="http://sibilla.javalinux.it" target="_blank">SibillaTest</a>. Why Sibilla? Because, as you can read in this post and you can get trying our samples, Sibilla (italian name for Cumae Sybil) is always able to prophesy and predict which tests you need to run.</p>
<p>This post has been written to announce the release of a first beta version of <a href="http://sibilla.javalinux.it" target="_blank">SibillaTest</a> and describe how our thoughts about the original idea have changed in these months and how they have been  implemented in <a href="http://sibilla.javalinux.it" target="_blank">SibillaTest</a>.<br />
I&#8217;m going to recall the main concepts of the original idea, If you haven&#8217;t read the <a href="http://www.javalinux.it/wordpress/2008/10/20/a-new-approach-to-unit-tests/" target="_blank">original blog would be nice to take a look to it</a>, to its numerous comments and also to the update I&#8217;ve posted few days after. If you are interested in all the genesis of the project you could also have a look to the discussions continued in <a href="http://groups.google.com/group/testedby-dev">our forum</a></p>
<p>Generally speaking what I&#8217;ve depicted in my old blog post was a system to keep annotations in classes under test pointing test classes (or in some case to specific test methods). Advantage of this approach were mainly 2:</p>
<p>• Design By Contract (viewing test as contract definition). The sugar here was the opportunity to put TestedBy annotation also on super classes (even if they are abstract or even interfaces) and inherit test annotations.<br />
• Run only tests stressing a specific class. IOW run test stressing a class of your interest (i.e just compiled) giving you the confidence you aren&#8217;t breaking test suite without running the entire suite itself.</p>
<p>The main concerns about this approach was about code cluttering putting a lot of annotations in production code (of course you could have a lot of test stressing a class or even a method).</p>
<p>So we have changed a bit the focus from an annotation centric approach to a more general metadata<br />
approach. The idea is to collect a set of metadata that represent link between classes under test and test classes (and eventually more fine grained links between methods) and use them for a lot of purposes.<br />
The pluses of this approach are mainly two:</p>
<p>• Metadata can be collected from different sources: annotations , instrumentation of test during test execution, maybe in the future from a dedicated  user interface.<br />
• Metadata can be serialized and/or used in a second step for various goals: run &#8220;right&#8221; tests of course will remain a central feature, but also<br />
&#8220;graphical&#8221; representation, code navigation in IDE, more dynamic use of it</p>
<p style="text-align: center;">
<p style="text-align: left;">I&#8217;m trying to keep this post not too long trying to keep your attention focused on the usefulness of SibillaTest,  I&#8217;m going to describe in this the feature already implemented in SibillaTest. But, of course, we have a lot of ideas that will be developed in next future that we would like to discuss with the community and maybe have some contribution from the community. Here you have a mind map depicting a lot of these working areas to get you an idea. I<a href="http://github.com/maeste/SibillaTest/wiki/IdeasDescription" target="_blank">f you are interested in a more detailed description of them you  can find a page in our wiki describing it.</a></p>
<p><img class="size-full wp-image-396 aligncenter" title="tb" src="http://www.javalinux.it/wordpress/wp-content/uploads/2010/04/tb.png" alt="" width="525" height="194" /></p>
<p>So, what is SibillaTest today?<em><a name="Short_description:"></a></em></p>
<blockquote><p><em><a name="Short_description:"></a></em><em> aims at changing the point of view regarding test classes and classes under test. What </em><em>we get is the focus being moved to the classes under test; from those classes, which of course are the most important ones of your projects, we obtain links to your test classes and test methods. In other words we define the classes and methods&#8217; contract using tests, while also keeping track of tests that need to be run when a class/method under test has been modified. This is possible by collecting metadata sets that represent links between classes under test and test classes (and eventually more fine grained links between methods) and using them for a lot of purposes. Metadata can be collected from different sources: annotations on classes under test, instrumentation of test classes during tests&#8217; execution (in future perhaps even from a dedicated user interface). These metadata can be used for various goals: </em><em><strong>first of all it becomes possible to run only the tests that stress just a particular set of classes (for instance the classes changed since last compilation)</strong></em><em>, moreover a graphical representation of classes&#8217; links can be derived. We have a Maven plugin, while Eclipse and Hudson ones are in our roadmap. Further cool idea around this is supporting generic tests to inject on existing production code (to verify commonly situation like don&#8217;t accept null parameters) and mock verification (are your mocks respecting the contract you have defined on mocked classes with your tests?)</em></p></blockquote>
<p>Practically speaking in this beta release we have:</p>
<ul>
<li><a href="http://github.com/maeste/SibillaTest" target="_blank">a core </a> supporting both annotation based metadata definition and instrumentation of classes during test execution to collect metadata. With annotation we support metadata on test stressing a whole hierarchy of classes/interfaces: you can define tests to be run against all implementation of your interface and SibillaTest take care of it Instrumentation do the magic of knowing which test is stressing particular classes and run only tests needed to validate last changed classes (i.e just compiled)</li>
<li><a href="http://github.com/maeste/SibillaMavenPlugin"> a maven plugin</a> (docs here) you can use to run test stressing only last changed classes.</li>
<li>support of Junit tests (not yet testng or other frameworks)</li>
</ul>
<p><a href="http://github.com/maeste/SibillaMavenPlugin/wiki" target="_blank">In our wiki you can find some documentation of how to include Sibilla into your maven project</a>, how to run it and documentation about our annotations if you decide to give TestedBy design by contract approach a try. <span style="font-size: medium;"><strong><a href="http://github.com/maeste/SibillaSamples" target="_blank">Here you can also find a small project with trivial classes under test and test classes using SibillaTest to run them. Check it out and give it a try&#8230;it&#8217;s the key to understand the idea and to say &#8220;wow it&#8217;s cool!&#8221; <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></strong></span></p>
<p>Have a look and send us comment through this blog or, much better, <a href="http://github.com/maeste/SibillaTest/issues" target="_blank">through our issue tracker</a> and/or <a href="http://groups.google.com/group/sibillatest" target="_blank">our forum</a>. We have also an<a href="irc://irc.freenode.net/sibilla" target="_blank"> IRC channel </a><strong><a href="irc://irc.freenode.net/sibilla" target="_blank">#sibilla</a></strong><a href="irc://irc.freenode.net/sibilla" target="_blank"> active on FreeNode</a> for discussions and suggestions.</p>
<p><a href="http://repo2.maven.org/maven2/it/javalinux/sibilla/" target="_blank">Artifact are available</a> on maven central repository, <a href="http://github.com/maeste/SibillaMavenPlugin/wiki">see the docs too.</a></p>
<p>Some other post with detailed descriptions of instrumentation and annotation based metadata and their use and plans for next versions will follow during next days. Moreover we will discuss on <a href="http://groups.google.com/group/sibillatest" target="_blank">forum</a> and post here also plans of integration with the very cool <a href="http://www.jboss.org/arquillian" target="_blank">Arquillian</a> (<a href="http://twitter.com/aslakknutsen/status/26729527708#" target="_blank">I had a very interesting discussion</a> about that with <a href="http://twitter.com/aslakknutsen" target="_blank">Aslak</a> at last <a href="http://www.jboss.org/events/JUDCon/JUDCon2010Berlin.html" target="_blank">JUDCon</a>)&#8230;.</p>
<p>&#8230;.stay tuned.</p>
<p>Of course if anyone is interested to join us and help (especially for eclipse plugin) please write us.</p>
<p>Stay tuned, join us and show some love around on the net!</p>
<p style="text-align: center;"><a href="http://sibilla.javalinux.it" target="_blank"><span style="font-size: large;">http://sibilla.javalinux.it</span></a></p>
<p style="text-align: center;"><span style="font-size: small;">(</span><a href="http://groups.google.com/group/sibillatest" target="_blank"><span style="font-size: small;">Forum</span></a><span style="font-size: small;"> &#8211; </span><a href="irc://irc.freenode.net/sibilla"><span style="font-size: small;">IRC</span></a><span style="font-size: medium;"><span style="font-size: small;"> &#8211; </span><a href="http://github.com/maeste/SibillaTest"><span style="font-size: small;">GitHub</span></a><span style="font-size: small;"> &#8211; </span><a href="http://github.com/maeste/SibillaSamples" target="_blank"><span style="font-size: small;">Sample(github)</span></a><span style="font-size: small;"> &#8211; </span><a href="http://github.com/maeste/SibillaMavenPlugin" target="_blank"><span style="font-size: small;">Maven Plugin(github)</span></a><span style="font-size: small;"> &#8211; </span><a href="https://twitter.com/SibillaTest"><span style="font-size: small;">@SibillaTest on twitter</span></a><span style="font-size: small;"> &#8211; </span><a href="http://github.com/maeste/SibillaTest/issues" target="_blank"><span style="font-size: small;">issues</span></a><span style="font-size: small;">)</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/10/12/sibilla-first-release-experince-a-new-approach-to-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small open source projects are difficult to keep alive. And what about Wise and TestedBy?</title>
		<link>http://www.javalinux.it/wordpress/2010/09/09/small-open-source-projects-are-difficult-to-keep-alive-and-what-about-wise-and-testedby/</link>
		<comments>http://www.javalinux.it/wordpress/2010/09/09/small-open-source-projects-are-difficult-to-keep-alive-and-what-about-wise-and-testedby/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 10:38:09 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[testedby]]></category>
		<category><![CDATA[wise]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=421</guid>
		<description><![CDATA[Hi all, another time I have to say that a long time has passed since my last post Well, I&#8217;ve been very very busy in last months driving (or at least help a lot to drive) a big change in my former company, leading a key project with more than fifty programmers involved distributed in [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,<br />
another time I have to say that a long time has passed since my last post <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Well, I&#8217;ve been very very busy in last months driving (or at least help a lot to drive) a big change in my former company, leading a key project with more than fifty programmers involved distributed in various team, with a lot of biz analysts and so on. But it&#8217;s another story I&#8217;ll probably tell you at some point. But the important word in last sentence is <strong>former. </strong>Yep, who is following me on <a href="http://www.twitter.com/maeste" target="_blank">twitter</a> (or have recently read <a href="http://www.javalinux.it/wordpress/about/" target="_blank">about_us</a> page or even is linked with me on <a href="http://it.linkedin.com/in/maeste/" target="_blank">linkedin</a>) knows I&#8217;ve joined  <a href="http://www.redhat.com" target="_blank">Red Hat</a> as Principal Software Engineer in <a href="http://www.jboss.org" target="_blank">JBoss</a> division. That&#8217;s a cool interesting job (I&#8217;m working on <a href="http://www.jboss.org/ironjacamar" target="_blank">IronJacamar</a> project and <a href="https://community.jboss.org/en/jbossas/dev/jboss_as7_development" target="_blank">AS7</a> development), but it&#8217;s making me very busy.</p>
<p>Anyway, back to the title of this post. It&#8217;s matter of fact that is very hard to keep alive open source projects in spare time. And maybe in last months some people thought that <a href="http://www.jboss.org/wise">Wise</a> is an almost dead project, and <a href="http://code.google.com/p/testedby/" target="_blank">TestedBy</a> a totally dead one. In fact we had very few time to  work on <a href="http://www.jboss.org/wise">Wise</a> and also on <a href="http://code.google.com/p/testedby/" target="_blank">TestedBy</a> for all the reasons stated above. But they aren&#8217;t dead and we are getting back on them (check last week commits for both!).</p>
<p>In particular Alessio is working on Wise to full support <a href="http://jboss.org/jbossws" target="_blank">JBossWS-CXF</a> container, while I&#8217;m planning to cleanup <a href="http://www.jboss.org/jbossesb">ESB</a> module to support the last version (maybe after Alessio&#8217;s work). After that we will work on our object mapping subsystem needed to continue the implementation of our WebUI.</p>
<p>I&#8217;m refining in the mean time samples of TestedBy to make possible to release the first version of the project. BTW very probably we will leave &#8220;TestedBy&#8221; name and we will launch the first release of the project with a new cool name. I&#8217;ll keep you post here.</p>
<p>As said keeping open source project alive in spare time isn&#8217;t easy, and sometime it&#8217;s very very hard specially if contributors are very few and very busy. Would you be part of a cool open source project, with all the beauty of that? We would need in particular contributions for TestedBy in Eclipse area, but if you would land an hand in other area and/or in Wise we are fine with that too. Please contact us, your help could make the difference!</p>
<p>Last but not least Wise have a new very very cool logo. Thanks to Red Hat Design team and in particular to Cheynne for that! No link here&#8230;it merits a dedicated post!</p>
<p>As said a lot of cool stuffs are coming&#8230;stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/09/09/small-open-source-projects-are-difficult-to-keep-alive-and-what-about-wise-and-testedby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple WS endpoint deployment with JAXWS 2.2 HTTP container abstraction</title>
		<link>http://www.javalinux.it/wordpress/2010/08/26/simple-ws-endpoint-deployment-with-jaxws-2-2-http-container-abstraction/</link>
		<comments>http://www.javalinux.it/wordpress/2010/08/26/simple-ws-endpoint-deployment-with-jaxws-2-2-http-container-abstraction/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 13:03:47 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[webserice]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=415</guid>
		<description><![CDATA[Recently I&#8217;ve been playing with the JAXWS Endpoint.publish(..) API. For those not really involved in WS development, JAXWS includes an API for easily deploying an endpoint in JSE environment while starting a http server just for serving calls to the specified endpoint. Endpoint endpoint = Endpoint.create(new EndpointBean()); endpoint.publish("http://localhost:8080/jaxws-endpoint1"); //invoke endpoint... endpoint.stop(); While from a user [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been playing with the <strong>JAXWS Endpoint.publish(..) API</strong>. For those not really involved in WS development, JAXWS includes an API for easily deploying an endpoint in JSE environment while starting a http server just for serving calls to the specified endpoint.<br />
<code><br />
Endpoint endpoint = Endpoint.create(new EndpointBean());<br />
endpoint.publish("http://localhost:8080/jaxws-endpoint1");<br />
//invoke endpoint...<br />
endpoint.stop();<br />
</code><br />
While from a user point of view this API is of few interest on a JavaEE environment, this is still quite interesting in JSE env as well as whenever having the need for a quick/easy testing of basic endpoints.<br />
Moreover, JAXWS 2.2 added a <a href="https://jax-ws.dev.java.net/nonav/jaxws-api/2.2/javax/xml/ws/spi/http/package-summary.html">HTTP SPI</a> for establishing / fixing the layer between http server containers and JAXWS stack implementations. This basically allows any jaxws 2.2 compliant implementation to be used on top of any &#8220;compatible&#8221; http server.<br />
Jitendra Kotamraju (current JSR-224 spec lead) recently provided a <a href="http://www2.java.net/blog/jitu/archive/2010/07/09/grizzly-transport-using-jax-ws-22-http-spi">bridge project</a> for making Grizzly compatible with the JAXWS 2.2 HTTP SPI. I&#8217;ve done <a href="http://jbossws.blogspot.com/2010/08/comsunnethttpserver-transport-using.html">the same for the httpserver</a> included in the JDK6 <em>com.sun.net.httpserver.HttpServer</em>. There&#8217;s also a <a href="http://docs.codehaus.org/display/JETTY/J2se6HttpServerSPI">similar project</a> for Jetty. So, with the additions of spec 2.2 and the required vendor implementations to comply on that, users can finally do the following with <em><strong>any</strong></em> JAXWS compliant implementation:<br />
<code><br />
import javax.xml.ws.spi.http.HttpContext;<br />
..<br />
HttpContext context = ..;<br />
Endpoint endpoint = Endpoint.create(new EndpointBean());<br />
endpoint.publish(context);<br />
//invoke endpoint<br />
endpoint.stop();<br />
</code><br />
where the context is obtained according to the selected containers, for instance (using my bridge to the JDK6 httpserver):<br />
<code><br />
import com.sun.net.httpserver.HttpServer;<br />
..<br />
HttpServer server = HttpServer.create(new InetSocketAddress(currentPort), 0);<br />
HttpContext context = HttpServerContextFactory.createHttpContext(server, contextPath, path);<br />
server.start();<br />
..<br />
//here comes the endpoint publish and usage as shown above<br />
..<br />
server.stop(0);<br />
</code><br />
Quite handy, isn&#8217;t it? <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/08/26/simple-ws-endpoint-deployment-with-jaxws-2-2-http-container-abstraction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaDay in Rome</title>
		<link>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/</link>
		<comments>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 17:26:34 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=384</guid>
		<description><![CDATA[Just a short note to tell you an interesting event on Java is taking place in Rome next Saturday (Jan, 30th). If you&#8217;re around, you might want to attend that: http://roma.javaday.it/javaday2010/ Most of the talks are going to be in Italian, but at least three of them will be in English. The talks are going [...]]]></description>
			<content:encoded><![CDATA[<p>Just a short note to tell you an interesting event on Java is taking place in Rome next Saturday (Jan, 30th). If you&#8217;re around, you might want to attend that: <a href="http://roma.javaday.it/javaday2010/">http://roma.javaday.it/javaday2010/</a></p>
<p><a href="http://roma.javaday.it/javaday2010/talk-tecnici-in-programma">Most of the talks</a> are going to be in Italian, but at least three of them will be in English. The talks are going to be quite technical and should also cover interesting topics like scalability, concurrency, management and tuning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysing jar dependencies</title>
		<link>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/</link>
		<comments>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 17:50:45 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=296</guid>
		<description><![CDATA[Something like 2 months ago I wrote a post on how different classloaders can potentially cause you problems if you&#8217;re not that careful on where your libs are loaded from. Well, I&#8217;ve just had to face another issue of that type, with a library of mine loaded from the bootstrap classloader and referencing a class [...]]]></description>
			<content:encoded><![CDATA[<p>Something like 2 months ago I wrote a post on how different classloaders can potentially cause you problems if you&#8217;re not that careful on where your libs are loaded from. Well, I&#8217;ve just had to face another issue of that type, with a library of mine loaded from the bootstrap classloader and referencing a class from servlet API that I don&#8217;t want to be loaded by that classloader too. The easy solution of course would have been to pull my lib out of the endorsed dir (the one the bootstrap classloader loads libs from), but how could I be sure that I did not break anything in my app? Besides running tests, I finally decided to give <a href="http://www.jboss.org/tattletale.html">JBoss Tattletale</a> a try&#8230; I saw all the hype around it when it was released some month ago, but I did not have the chance to use it for a practical issue before.</p>
<p>Well, in less than five minutes I checked out he project, built it and ran it against my endorsed lib dir. I got a report and some graphs basically showing no libraries in that dir (hence loaded by the bootstrap classloader) where directly depending on my library, thus it&#8217;s safe to pull it out of the endorsed dir. The easy solution was indeed OK and thanks to this tool I have a theoretical proof of that <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Take a look at <strong>JBoss Tattletale</strong>, it&#8217;s really a cool tool. Perhaps you can start from its author&#8217;s blog: http://blog.hibernate.org/11166.lace</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Application Server Day 2009</title>
		<link>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/</link>
		<comments>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 11:19:18 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=282</guid>
		<description><![CDATA[This post is to let you know a really interesting event that&#8217;s taking place soon in Genoa (Italy): the Java Application Server Day 2009. As you can read on www.serverday.org, the event will be open to the entire Italian Java Community; international experts, developers and students will discuss the state of the art and the [...]]]></description>
			<content:encoded><![CDATA[<p>This post is to let you know a really interesting event that&#8217;s taking place soon in Genoa (Italy): the <strong>Java Application Server Day 2009</strong>.</p>
<p>As you can read on <a href="http://www.serverday.org/index.php" target="_blank">www.serverday.org</a>, the event will be open to the entire Italian Java Community; international experts, developers and students will discuss the state of the art<br />
and the future of Java Application Servers, with a focus on the innovations of<br />
the recently released <strong>JBoss 5.0, Spring dm Server, GlassFish 3.0 &amp; Oracle/WebLogic</strong>.</p>
<p>I&#8217;ve been asked to be there on behalf of JBoss / Red Hat, so I&#8217;ll present the recent changes in JBoss AS 5.</p>
<p>Hope you can join the event on May, 21st. Stay tuned for further updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JBossWS wsconsume error &#8220;undefined element declaration &#8216;sch:schema&#8217;&#8221;</title>
		<link>http://www.javalinux.it/wordpress/2009/03/04/jbossws-wsconsume-error-undefined-element-declaration-schschema/</link>
		<comments>http://www.javalinux.it/wordpress/2009/03/04/jbossws-wsconsume-error-undefined-element-declaration-schschema/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 14:18:39 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[dna]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jbossfeed]]></category>
		<category><![CDATA[jbossws]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=256</guid>
		<description><![CDATA[Today I was importing a .NET generated wsdl and getting this error using JBossWS wsconsume.sh tool (yes I&#8217;m not using Wise for this particular case!! But the problem would be the same in Wise since it use wsconsume under the hood) : [WARNING] src-resolve.4.2: Error resolving component 'sch:schema'. It was detected that 'sch:schema' is in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was importing a .NET generated wsdl and getting this error using JBossWS wsconsume.sh tool (yes I&#8217;m not using <a href="http://www.jboss.org/Wise">Wise</a> for this particular case!! But the problem would be the same in Wise since it use wsconsume under the hood) :</p>
<blockquote>
<pre lang="java">[WARNING] src-resolve.4.2: Error resolving component 'sch:schema'. It was detected that 'sch:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'file:/home/oracle/Desktop/security.asmx#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'sch:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/home/oracle/Desktop/security.asmx#types?schema1'.
  line 85 of file:/home/oracle/Desktop/security.asmx#types?schema1
[ERROR] undefined element declaration 'sch:schema'
  line 85 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 178 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 217 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 231 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 245 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 259 of file:/home/oracle/Desktop/security.asmx
[ERROR] undefined element declaration 'sch:schema'
  line 273 of file:/home/oracle/Desktop/security.asmx

Failed to invoke WsImport
java.lang.NullPointerException
        at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237)
        at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:518)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
        at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:134)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2244)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:187)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:133)
        at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:182)
        at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:217)
        at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:223)
        at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)</pre>
</blockquote>
<p>After some search Alessio pointed me t<a href="http://weblogs.java.net/blog/vivekp/archive/2007/05/how_to_deal_wit_1.html" target="_blank">o this excellent post where the problem is well explained and solution provided</a>. The &#8220;problem&#8221; is not specific to JBossWS and solution explained there is fine for JBossWS too.</p>
<p>Hoping this cross post could help someone looking for the error in relation to JBossWS in google <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/03/04/jbossws-wsconsume-error-undefined-element-declaration-schschema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

