cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Exception in thread "default-workqueue-x" java.lang.NullPointerException
Date Tue, 12 Nov 2013 17:31:53 GMT

Honestly, I have no idea what could possibly be causing this.

That line in the code (assuming recent version of CXF) is just:

BusHolder h =  threadBus.get();

so the only possible way to get an NPE there is if threadBus is null.   However, that variable
is set via the static initializer:

protected static ThreadLocal<BusHolder> threadBus = new ThreadLocal<BusHolder>();

and not ever set anyplace else.   Thus, there should be no way for that to be null.   

I DID just change it to be a “final” variable since it should only be set once and never
set again.   That should allow the jit to optimize the access better since it doesn’t have
to check any of the address lines and such from core to core, but that still shouldn’t have
any impact on this.


Dan




On Nov 12, 2013, at 12:36 AM, 影子传说 <ppm10103@qq.com> wrote:

> how can i solve the problem,I can't find the answer in google.
> 
> 
> Exception in thread "default-workqueue-2" java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> Exception in thread "default-workqueue-7" java.lang.NullPointerException
> Exception in thread "default-workqueue-13" 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> Exception in thread "default-workqueue-17" 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> Exception in thread "default-workqueue-21" java.lang.NullPointerException
> Exception in thread "default-workqueue-11" Exception in thread "default-workqueue-19"
	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> Exception in thread "default-workqueue-9" java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)
> java.lang.NullPointerException
> 	at org.apache.cxf.BusFactory.getThreadBusHolder(BusFactory.java:117)
> 	at org.apache.cxf.BusFactory.getAndSetThreadDefaultBus(BusFactory.java:202)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:64)
> 	at org.apache.cxf.transport.udp.UDPDestination$MCastListener$2.run(UDPDestination.java:106)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:662)

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message