]
Kevin Conner updated JBESB-1550:
--------------------------------
Fix Version/s: 4.2.1 CP2
4.3
Affects Version/s: 4.2.1 CP1
NullPointerException in NamingContextPool
-----------------------------------------
Key: JBESB-1550
URL:
http://jira.jboss.com/jira/browse/JBESB-1550
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Rosetta
Affects Versions: 4.2.1, 4.2.1 CP1
Reporter: Pavel Kadlec
Assigned To: Kevin Conner
Fix For: 4.3, 4.2.1 CP2
I got this exception while there were a lot of messages in ESB.
22:05:52,765 WARN [ServiceInvoker] Unexpected exception during attempted message
delivery over Courier for EPR [JMSEpr [ PortReference < <wsa:Address
jms://10.0.0.2:1099/queue/quickstart_Aggregator/>
<wsa:ReferenceProperties jbossesb:java.naming.factory.initial :
org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties
jbossesb:java.naming.provider.url : 10.0.0.2/>, <wsa:ReferenceProp
erties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties
jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties
jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceP
roperties jbossesb:persistent : false/>, <wsa:ReferenceProperties
jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties
jbossesb:transacted : false/>, <wsa:ReferenceProperties jboss
esb:type : urn:jboss/esb/epr/type/jms/> > ]] for Service [Example:Aggregator] and
Message [header: [ To: JMSEpr [ PortReference < <wsa:Address
jms://10.0.0.2:1099/queue/quickstart_Aggregator/>, <wsa:R
eferenceProperties jbossesb:java.naming.factory.initial :
org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties
jbossesb:java.naming.provider.url : 10.0.0.2/>, <wsa:ReferenceProperties j
bossesb:destination-type : queue/>, <wsa:ReferenceProperties
jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties
jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferencePropertie
s jbossesb:persistent : false/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode
: AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>,
<wsa:ReferenceProperties jbossesb:type
: urn:jboss/esb/epr/type/jms/> > ] MessageID: ID:11-1203195911358401 RelatesTo:
jms:correlationID#81925235-a61b-4c87-b158-54232c623dee ]].
java.lang.NullPointerException
at
org.jboss.soa.esb.helpers.NamingContextPool.getContext(NamingContextPool.java:286)
at
org.jboss.soa.esb.helpers.NamingContextPool.getContext(NamingContextPool.java:150)
at
org.jboss.soa.esb.helpers.NamingContextPool.getNamingContext(NamingContextPool.java:400)
at
org.jboss.internal.soa.esb.couriers.JmsCourier.createMessageProducer(JmsCourier.java:340)
at org.jboss.internal.soa.esb.couriers.JmsCourier.deliver(JmsCourier.java:199)
at
org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.deliver(TwoWayCourierImpl.java:188)
at
org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.attemptDelivery(ServiceInvoker.java:508)
at
org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.access$200(ServiceInvoker.java:430)
at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:307)
at org.jboss.soa.esb.client.ServiceInvoker.deliverAsync(ServiceInvoker.java:216)
at
org.jboss.soa.esb.client.MessageMulticaster.sendToSubset(MessageMulticaster.java:144)
at
org.jboss.soa.esb.client.MessageMulticaster.sendToAll(MessageMulticaster.java:106)
at org.jboss.soa.esb.actions.StaticWiretap.process(StaticWiretap.java:58)
at org.jboss.soa.esb.actions.StaticRouter.process(StaticRouter.java:48)
at cz.flynet.esb.actions.StaticRouter.process(StaticRouter.java:68)
at
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
at
org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:566)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
When I looked at the class org.jboss.soa.esb.helpers.NamingContextPool I could see that
there is something wrong in method private Context getContext(final Properties env, final
String key).
If I studied code well, I thing that there is bad key put as a parameter, below is fixed
method getContext.
Please check if the fix is ok.
private Context getContext(final Properties env, final String key)
throws NamingContextException
{
final Context context = getFreeContext(key) ;
if (context != null)
{
return context ;
}
if (numContexts == POOL_SIZE)
{
if (freeContextOrder.size() == 0)
{
return null ;
}
final Iterator<Entry<Context, String>> freeContextIter =
freeContextOrder.entrySet().iterator() ;
final Entry<Context, String> freeContextEntry = freeContextIter.next()
;
final Context freeContext = freeContextEntry.getKey() ;
final String freeContextKey = freeContextEntry.getValue() ;
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Ejecting Naming Context from pool, key: " +
freeContextKey) ;
}
freeContextOrder.remove(freeContext) ;
final List<Context> contexts = freeContexts.get(freeContextKey) ; //
FIXED KEY
contexts.remove(freeContext) ;
if (contexts.size() == 0)
{
freeContexts.remove(freeContextKey) ; // FIXED KEY
}
numContexts-- ;
closeContext(freeContext) ;
}
return createContext(env, key) ;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: