It was a simple bug in the proxy code. "equals" is handled separately to normal method calls (to allow for proxy unwrapping) and was not safe for calls like:
proxyObject.equals(null); Regards, Tim ---------------------------------------- > Date: Mon, 7 Feb 2011 19:17:32 +0100 > Subject: Re: svn commit: r1066828 - > /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > From: [email protected] > To: [email protected] > > Thx for investigating, I was gonna look at it when I saw your message. > Do you think this is related to the NS handler changes somehow ? Is a > null value expected in the proxy impl ? > > On Mon, Feb 7, 2011 at 18:46, Timothy Ward wrote: > > > > With some further investigation I found the offending code and have fixed > > it under commit 1068021 > > > > Tim > > > > ---------------------------------------- > >> From: [email protected] > >> To: [email protected]; [email protected] > >> Subject: RE: svn commit: r1066828 - > >> /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> Date: Mon, 7 Feb 2011 16:47:37 +0000 > >> > >> > >> Hi, > >> > >> Since accepting this commmit I have seen failures in > >> org.apache.aries.samples.blog.itests.QuiesceBlogSampleWithEbaTest > >> > >> I tried reverting the changes to this file and rebuilding my stream and > >> things started passing again. I see the following exception generated in > >> the test log. > >> > >> java.lang.NullPointerException > >> at > >> org.apache.aries.proxy.impl.AsmProxyManager.getInvocationHandler(AsmProxyManager.java:99) > >> at > >> org.apache.aries.proxy.impl.AbstractProxyManager.isProxy(AbstractProxyManager.java:73) > >> at > >> org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:70) > >> at > >> org.apache.aries.jpa.blueprint.aries.impl.$NSHandler2115075601.equals(Unknown > >> Source) > >> at > >> org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.getSchema(NamespaceHandlerRegistryImpl.java:219) > >> at > >> org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl$NamespaceHandlerSetImpl.getSchema(NamespaceHandlerRegistryImpl.java:329) > >> at > >> org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:276) > >> at > >> org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:228) > >> at > >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452) > >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314) > >> at java.util.concurrent.FutureTask.run(FutureTask.java:149) > >> at > >> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:109) > >> at > >> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:218) > >> at > >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897) > >> at > >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) > >> at java.lang.Thread.run(Thread.java:736) > >> > >> > >> Regards, > >> > >> Tim > >> > >> ---------------------------------------- > >> > Subject: svn commit: r1066828 - > >> > /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> > Date: Thu, 3 Feb 2011 15:13:59 +0000 > >> > To: [email protected] > >> > From: [email protected] > >> > > >> > Author: gnodet > >> > Date: Thu Feb 3 15:13:58 2011 > >> > New Revision: 1066828 > >> > > >> > URL: http://svn.apache.org/viewvc?rev=1066828&view=rev > >> > Log: > >> > [ARIES-563] The NamespaceHandlerRegistryImpl does not actually reuse > >> > parsed schemas > >> > > >> > Modified: > >> > aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> > > >> > Modified: > >> > aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> > URL: > >> > http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java?rev=1066828&r1=1066827&r2=1066828&view=diff > >> > ============================================================================== > >> > --- > >> > aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> > (original) > >> > +++ > >> > aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java > >> > Thu Feb 3 15:13:58 2011 > >> > @@ -214,7 +214,14 @@ public class NamespaceHandlerRegistryImp > >> > // If it contains additional namespaces, it should not be a problem since > >> > // they won't be used at all > >> > for (Map key : schemas.keySet()) { > >> > - if (key.equals(handlers)) { > >> > + boolean found = true; > >> > + for (URI uri : handlers.keySet()) { > >> > + if (!handlers.get(uri).equals(key.get(uri))) { > >> > + found = false; > >> > + break; > >> > + } > >> > + } > >> > + if (found) { > >> > schema = schemas.get(key).get(); > >> > break; > >> > } > >> > @@ -234,6 +241,22 @@ public class NamespaceHandlerRegistryImp > >> > } > >> > } > >> > schema = getSchemaFactory().newSchema(schemaSources.toArray(new > >> > Source[schemaSources.size()])); > >> > + // Remove schemas that are fully included > >> > + for (Iterator> iterator = schemas.keySet().iterator(); > >> > iterator.hasNext();) { > >> > + Map key = iterator.next(); > >> > + boolean found = true; > >> > + for (URI uri : key.keySet()) { > >> > + if (!key.get(uri).equals(handlers.get(uri))) { > >> > + found = false; > >> > + break; > >> > + } > >> > + } > >> > + if (found) { > >> > + iterator.remove(); > >> > + break; > >> > + } > >> > + } > >> > + // Add our new schema > >> > schemas.put(handlers, new SoftReference(schema)); > >> > } finally { > >> > for (StreamSource s : schemaSources) { > >> > > >> > > >> > > > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com
