Bug 1401565 - Attempt to navigate to REST interface while server is not still started causes NullPointerException in the server.log file
Summary: Attempt to navigate to REST interface while server is not still started cause...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Core Server, REST
Version: JON 3.3.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: CR01
: JON 3.3.9
Assignee: Ruben Vargas Palma
QA Contact: Jeeva Kandasamy
URL:
Whiteboard:
Depends On: 1401568
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-05 15:04 UTC by bkramer
Modified: 2020-01-17 16:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-02 17:21:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2846 0 normal SHIPPED_LIVE Red Hat JBoss Operations Network 3.3.9 bug fix update 2017-10-02 21:21:28 UTC

Description bkramer 2016-12-05 15:04:22 UTC
Description of problem:
Attempt to navigate to the REST page (<jon_server>:7080/rest) while JBoss ON server is still starting will cause ERROR message and NullPointerException:

**********************************
14:25:06,861 ERROR [org.jboss.as.ejb3] (http-10.33.24.113:7080-1) JBAS014268: Failure in caller transaction.: java.lang.NullPointerException
	at org.rhq.enterprise.server.util.QueryUtility.init(QueryUtility.java:423) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.QueryUtility.getEscapeClause(QueryUtility.java:388) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryGenerator.getQueryString(CriteriaQueryGenerator.java:601) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryGenerator.getQuery(CriteriaQueryGenerator.java:924) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryRunner.execute(CriteriaQueryRunner.java:79) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.auth.SubjectManagerBean.findSubjectsByCriteria(SubjectManagerBean.java:887) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.auth.SubjectManagerBean.getSubjectByName(SubjectManagerBean.java:315) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
...
	at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:156) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
...
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:561) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:543) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:128) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
...
	at org.rhq.enterprise.rest.JsonPFilter.doFilter(JsonPFilter.java:97)
...
14:25:06,866 ERROR [org.jboss.as.ejb3.invocation] (http-10.33.24.113:7080-1) JBAS014134: EJB Invocation failed on component SubjectManagerBean for method public abstract org.rhq.core.domain.auth.Subject org.rhq.enterprise.server.auth.SubjectManagerRemote.getSubjectByName(java.lang.String): javax.ejb.EJBTransactionRolledbackException
...
	at org.rhq.enterprise.server.auth.SubjectManagerLocal$$$view128.getSubjectByName(Unknown Source) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.rest.SetCallerInterceptor.setCaller(SetCallerInterceptor.java:76) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
...
	at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:156) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
...
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:561) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:543) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:128) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
...
Caused by: java.lang.NullPointerException
	at org.rhq.enterprise.server.util.QueryUtility.init(QueryUtility.java:423) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.QueryUtility.getEscapeClause(QueryUtility.java:388) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryGenerator.getQueryString(CriteriaQueryGenerator.java:601) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryGenerator.getQuery(CriteriaQueryGenerator.java:924) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.util.CriteriaQueryRunner.execute(CriteriaQueryRunner.java:79) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.auth.SubjectManagerBean.findSubjectsByCriteria(SubjectManagerBean.java:887) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
	at org.rhq.enterprise.server.auth.SubjectManagerBean.getSubjectByName(SubjectManagerBean.java:315) [rhq-server.jar:4.12.0.JON330GA-redhat-6]
...
**********************************

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

How reproducible:
Always

Steps to Reproduce:
1. Stop JBoss ON Server;
2. Start JBoss ON Server and monitor JBoss ON server.log file;
3. As soon as the following line is logged:

********************************************
INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.8.GA (AS 7.5.8.Final-redhat-2) started in 15970ms - Started 6078 of 6120 services (115 services are lazy, passive or on-demand)
********************************************

attempt to navigate to <jon_server>:7080/rest page;

Actual results:
Above error messages will be logged

Expected results:
No error message is logged but only INFO or WARN that should let users know that they are trying to use REST before the server is actually up.


Additional info:

Comment 3 Simeon Pinder 2017-09-19 11:33:22 UTC
Moving to ON_QA.

JON 3.3.9 CR01 artifacts are available for test from here:
http://download.eng.bos.redhat.com/brewroot/packages/org.jboss.on-jboss-on-parent/3.3.0.GA/135/maven/org/jboss/on/jon-server-patch/3.3.0.GA/jon-server-patch-3.3.0.GA.zip
 *Note: jon-server-patch-3.3.0.GA.zip maps to CR01 build of
 jon-server-3.3.0.GA-update-09.zip.

Comment 4 Jeeva Kandasamy 2017-09-20 18:26:36 UTC
I do not see any error log in the server.log file. but I see the response message as "Tried to call REST endpoint but the server is not ready - still booting up" with error code "503 - Service unavailable".


Version info:
-------------
Server OS: RHEL 7.4 64 bit
JBoss Operations Network	
Version: 3.3.0.GA Update 09
Build Number: 44ba698:204e925
GWT Version: 2.5.0
SmartGWT Version: 3.0p

Comment 5 errata-xmlrpc 2017-10-02 17:21:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:2846


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