Bug 1169862

Summary: Vague ERROR message "invalid null input" appears when wrong alias given for the keystore configured in security realm.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Paramvir jindal <pjindal>
Component: SecurityAssignee: Tomas Hofman <thofman>
Status: CLOSED CURRENTRELEASE QA Contact: Josef Cacek <jcacek>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.3.2CC: anmiller, bbaranow, bdawidow, cdewolf, jawilson, mchoma, pskopek, rsvoboda, thofman
Target Milestone: CR2   
Target Release: EAP 6.4.1   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1221885 (view as bug list) Environment:
Last Closed: 2017-01-17 09:59:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1207953    

Description Paramvir jindal 2014-12-02 15:04:25 UTC
Description of problem:

When the security realm is configured to use SSL certificate and the alias given doesn't exist in the keystore provided then it should throw some wrong alias or alias not found exception instead of "invalid null input" exception.


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


How reproducible: Everytime


Steps to Reproduce:
1. Configure your ManagementRealm to use SSL certificate.
2. Provide correct name, path, password but wrong alias for the keystore
3. Start the EAP

Actual results:

20:13:24,809 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.server.controller.management.security_realm.ManagementRealm.key-manager: org.jboss.msc.service.StartException in service jboss.server.controller.management.security_realm.ManagementRealm.key-manager: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1936) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
Caused by: java.lang.NullPointerException: invalid null input
	at java.security.KeyStore.setEntry(KeyStore.java:1292) [rt.jar:1.6.0_45]
	at org.jboss.as.domain.management.security.JKSKeystore.load(JKSKeystore.java:118)
	at org.jboss.as.domain.management.security.JKSKeyManagerService.start(JKSKeyManagerService.java:100)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	... 3 more


Expected results:

Should throw some useful full exception.


Additional info:

Comment 1 Tomas Hofman 2015-03-19 11:48:47 UTC
PR: https://github.com/jbossas/jboss-eap/pull/2363

Comment 2 Tomas Hofman 2015-04-24 08:06:19 UTC
Added another commit with a test case.

Comment 3 Rostislav Svoboda 2015-04-24 09:31:13 UTC
qa_acking, thank you for the test

Comment 5 mchoma 2015-05-15 06:57:39 UTC
Verified in 6.4.1.CP.CR2

Comment 6 Petr Penicka 2017-01-17 09:59:32 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.

Comment 7 Petr Penicka 2017-01-17 10:00:25 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.