java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java | 61
++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java | 56
+++++++++
java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp | 16
++
3 files changed, 133 insertions(+)
New commits:
commit fe5154b6a09d2af1a5dde8651512c9d314a0e1da
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Mar 31 17:09:44 2009 -0400
458838 - adding new files for kickstart exception 404
diff --git
a/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
b/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
new file mode 100644
index 0000000..e47e7f7
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ *
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.common.errors;
+
+import com.redhat.rhn.common.messaging.MessageQueue;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.events.TraceBackEvent;
+import com.redhat.rhn.frontend.struts.RequestContext;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ExceptionHandler;
+import org.apache.struts.config.ExceptionConfig;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * PermissionExceptionHandler
+ * @version $Rev$
+ */
+public class NoSuchKickstartExceptionHandler extends ExceptionHandler {
+
+ /**
+ * Custom Handler for HibernateLookupExceptions
+ * {@inheritDoc}
+ */
+ public ActionForward execute(Exception ex, ExceptionConfig exConfig,
+ ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse
response)
+ throws ServletException {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ request.setAttribute("error", ex);
+
+
+ TraceBackEvent evt = new TraceBackEvent();
+ RequestContext requestContext = new RequestContext(request);
+ User usr = requestContext.getLoggedInUser();
+ evt.setUser(usr);
+ evt.setRequest(request);
+ evt.setException(ex);
+ MessageQueue.publish(evt);
+
+ return super.execute(ex, exConfig, mapping, form, request, response);
+ }
+
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
new file mode 100644
index 0000000..2170ae4
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ *
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+
+/*
+ * AUTOMATICALLY GENERATED FILE, DO NOT EDIT.
+ */
+package com.redhat.rhn.frontend.xmlrpc;
+
+import com.redhat.rhn.FaultException;
+
+/**
+ * no such package
+ * <p>
+
+ *
+ * @version definition($Rev: 76724 $)/template($Rev: 67725 $)
+ */
+public class NoSuchKickstartException extends FaultException {
+
+
+ /////////////////////////
+ // Constructors
+ /////////////////////////
+ /**
+ * Constructor
+ */
+ public NoSuchKickstartException() {
+ super(2764 , "noSuchKickstart" , "The kickstart could not be
found");
+ // begin member variable initialization
+ }
+
+ /**
+ * Constructor
+ * @param cause the cause (which is saved for later retrieval
+ * by the Throwable.getCause() method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ */
+ public NoSuchKickstartException(Throwable cause) {
+ super(2764 , "noSuchKickstart" , "The kickstart could not be
found" , cause);
+ // begin member variable initialization
+ }
+
+}
diff --git a/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
b/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
new file mode 100644
index 0000000..738831f
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
@@ -0,0 +1,16 @@
+<%@ taglib
uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean" %>
+<html:xhtml/>
+<html>
+<body>
+
+<h1>
+ <img src="/img/rhn-icon-warning.gif"
+ alt="<bean:message key='error.common.errorAlt' />" />
+ <bean:message key="unknown.kickstart" />:
+</h1>
+
+<p><bean:message key="unknown.kickstart.message" /></p>
+
+</body>
+</html>