Bug 1185496 - NPE on deployment caused by BlockingNotificationMBeanServer with 'expressionsDomain' being null
Summary: NPE on deployment caused by BlockingNotificationMBeanServer with 'expressions...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMX
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER2
: EAP 6.4.0
Assignee: Brian Stansberry
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-23 22:45 UTC by Sanne Grinovero
Modified: 2019-08-19 12:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:41:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFCORE-522 0 Major Open BlockingNotificationMBeanServer will NPE if resolvedDomain or expressionsDomain are not configured 2015-01-24 00:39:37 UTC

Description Sanne Grinovero 2015-01-23 22:45:11 UTC
Description of problem:

I'm running an Arquillian/Shrinkwrap based integration test, which used to work with EAP 6.3 and older versions. With some minor version changes the same test works fine in WildFly {8,9} too.

Stacktrace:
Thread [pool-2-thread-1] (Suspended (exception NullPointerException))	
	owns: ServerProxy$RemoteNotificationManager  (id=337)	
	Matcher.getTextLength() line: 1234 [local variables unavailable]	
	Matcher.reset() line: 308 [local variables unavailable]	
	Matcher.<init>(Pattern, CharSequence) line: 228	
	Pattern.matcher(CharSequence) line: 1088	
	BlockingNotificationMBeanServer.isInExposedModelControllerDomains(ObjectName) line: 319	
	BlockingNotificationMBeanServer.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) line: 183	
	ServerProxy$RemoteNotificationManager.addNotificationListener(ObjectName, int, NotificationFilter, Object) line: 208	
	ServerProxy$RemoteNotificationManager.access$3200(ServerProxy$RemoteNotificationManager, ObjectName, int, NotificationFilter, Object) line: 201	
	ServerProxy$AddNotificationListenerHandler.handle(DataInput, int) line: 430	
	ServerCommon$MessageReciever$1$1.run() line: 153	
	ServerInterceptorFactory$Interceptor$1.run() line: 75	
	ServerInterceptorFactory$Interceptor$1.run() line: 70	
	AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]	
	Subject.doAs(Subject, PrivilegedExceptionAction<T>) line: 415	
	AccessAuditContext.doAs(Subject, PrivilegedExceptionAction<T>) line: 94	
	ServerInterceptorFactory$Interceptor.handleEvent(ServerMessageInterceptor$Event) line: 70	
	ServerCommon$MessageReciever$1.run() line: 149	
	ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1145	
	ThreadPoolExecutor$Worker.run() line: 615	
	Thread.run() line: 745	

By debugging, I can see that variable 'expressionsDomain' at org.jboss.as.jmx.BlockingNotificationMBeanServer.isInExposedModelControllerDomains(ObjectName):319 is null, which causes the NPE in the Matcher.



Version-Release number of selected component (if applicable):

JBAS015899: JBoss EAP 6.4.0.Alpha1 (AS 7.5.0.Final-redhat-15) starting

How reproducible:
I'm having a rather complex test which triggers this, but I'm not sure how to isolate this specific problem. I can try isolate it if more details are needed.

Expected results:
A successful deployment.

Comment 1 Brian Stansberry 2015-01-24 00:30:01 UTC
My guess is the jmx subsystem configuration doesn't have <expose-expression-model/>. I don't see any difference in code between the EAP 6.x branch and what we have in WildFly, and I doubt its different in 6.3, so I suspect that config was missing for whatever reason when you ran the test.

Of course not having that completely optional config shouldn't result in an NPE.

Comment 3 Sanne Grinovero 2015-01-25 23:18:24 UTC
(In reply to Brian Stansberry from comment #1)
> My guess is the jmx subsystem configuration doesn't have
> <expose-expression-model/>. I don't see any difference in code between the
> EAP 6.x branch and what we have in WildFly, and I doubt its different in
> 6.3, so I suspect that config was missing for whatever reason when you ran
> the test.
> 
> Of course not having that completely optional config shouldn't result in an
> NPE.

Hi Brian, thanks for the quick reply!

We're indeed using an outdated configuration file, for integration testing with EAP we use this one (in our older maintenance branch 4.4):

https://github.com/hibernate/hibernate-search/blob/4.4/integrationtest/as/src/as7config/standalone/configuration/standalone-securedjms.xml

So I guess copying that configuration file would make it easy to reproduce.
I've just checked: our same test just works fine if I update the configuration file by copying the default as provided by the EAP 6.4.0(.Alpha) distribution.

On branch master we run the same integration tests but targeting WildFly 8.2; on this branch though we had updated the configuration files to use the base one used by WildFly, patching only the few lines we need.

So indeed our testing conditions on WildFly are different; but the above file 'standalone-securedjms.xml' worked fine on previous versions of JBoss EAP - I'm not sure on which range exactly but it definitely works fine with version 6.3.

Comment 4 Brian Stansberry 2015-01-26 11:00:10 UTC
Thanks Sanne. That config document uses an old style xml config that results in a running configuration equivalent to a newer-style one without the <expose-expression-model/> element. So the scenario in my Comment 1 applies and my patch will fix this.

Comment 6 Martin Simka 2015-02-17 13:42:38 UTC
verified on EAP 6.4.0.ER2

Steps to reproduce:
1. comment out <expose-expression-model/> in jmx subsystem configuration
2. start server
3. open jconsole and connect to remote process: service:jmx:remoting-jmx://localhost:9999  =>  exception in server output console


Note You need to log in before you can comment on or make changes to this bug.