Bug 31339 - admin app throwing struts exceptions
Summary: admin app throwing struts exceptions
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Administration (show other bugs)
Version: 5.0.28
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-21 12:07 UTC by Blake Binkley
Modified: 2006-09-06 19:44 UTC (History)
0 users



Attachments
use the domain parameter instead of TomcatTreeBuilder.DEFAULT_DOMAIN (698 bytes, patch)
2006-01-30 05:55 UTC, Amila
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blake Binkley 2004-09-21 12:07:55 UTC
when a service is clicked on in the left navigaiton frame:
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

javax.servlet.ServletException: Define tag cannot set a null value
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException
(PageContextImpl.java:825)
	org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:758)
	admin.service.service_jsp._jspService(service_jsp.java:864)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:1069)
	org.apache.struts.action.RequestProcessor.processForwardConfig
(RequestProcessor.java:455)
	org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:279)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause 

javax.servlet.jsp.JspException: Define tag cannot set a null value
	org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:272)
	admin.service.service_jsp._jspService(service_jsp.java:253)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:1069)
	org.apache.struts.action.RequestProcessor.processForwardConfig
(RequestProcessor.java:455)
	org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:279)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache 
Tomcat/5.0 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0

************************************************************
************************************************************
************************************************************

when a host is clicked on on the left navigation frame:

HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

java.lang.NullPointerException
	org.apache.struts.taglib.logic.CompareTagBase.condition
(CompareTagBase.java:179)
	org.apache.struts.taglib.logic.NotEqualTag.condition
(NotEqualTag.java:90)
	org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag
(ConditionalTagBase.java:218)
	admin.host.host_jsp._jspService(host_jsp.java:450)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:1069)
	org.apache.struts.action.RequestProcessor.processForwardConfig
(RequestProcessor.java:455)
	org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:279)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache 
Tomcat/5.0 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0
Comment 1 Yoav Shapira 2004-09-27 22:58:55 UTC
This is a bit mysterious, as neither host.jsp nor the 
Edit/Add/SaveHostAction.java files have changed in more than six months.  I'll 
have to dig a bit deeper it seems ;)
Comment 2 Yoav Shapira 2004-09-27 23:03:53 UTC
You must have some weird configuration error, because it works for me.  I'm 
unable to reproduce your issue.

Here are the steps I took and other details:
- Download jakarta-tomcat-5.0.28.zip from the Jakarta binaries download page, 
unzip to c:\ (I'm running Windows XP SP2, Sun JDK 1.4.2_04).
- Edit conf/tomcat-users.xml to add an admin user, startup the server using 
statup.bat.
- Go to the Administration link, login to the admin webapp, click around 
server, service, host (in fact I clicked on every link I could find, all 
worked).
- I even add a brand new host, saved, committed changed, then deleted, no 
problem.  Same with adding a service.

I suggest you use the tomcat-user mailing list to ask for help if you do a 
clean installation and still get this issue.
Comment 3 Amila 2006-01-30 05:55:14 UTC
Created attachment 17533 [details]
use the domain parameter instead of TomcatTreeBuilder.DEFAULT_DOMAIN

this bug is caused by the following method in 
org.apache.webapp.admin.Lists.java class

The method is : 

public static String getAdminAppService (MBeanServer mbserver, String domain,
HttpServletRequest
request)
	throws Exception {

	String adminDomain = TomcatTreeBuilder.DEFAULT_DOMAIN;
	// Get the admin app's service name
	StringBuffer sb = new StringBuffer(adminDomain);
	sb.append(":type=Service,*");
	ObjectName search = new ObjectName(sb.toString());
	 // other parts
	return service;

    }

as you can see it always uses the TomcatTreeBuilder.DEFAULT_DOMAIN to find the
service. but this value is hard coded as "Catalina"

so if someone rename the Engine name(defuaul Catalina) in server.xml it causes
this error.

some we have to use the domain paramenter as follows
 StringBuffer sb = new StringBuffer(domain);
Comment 4 Yoav Shapira 2006-04-14 15:16:13 UTC
Blake, does Amila's patch fix your issue?

The relevant code is still intact in the 5.5 branch as of 5.5.16, so this is not
just a 5.0 issue.
Comment 5 Mark Thomas 2006-09-07 02:44:28 UTC
This has been fixed in 5.5.x and will be included in 5.5.19 onwards.

Thanks for the report and the patch.