|
What this is
Other links
The source code
<html>
<%@ page import="org.apache.axiom.om.OMAbstractFactory,
org.apache.axiom.om.OMElement,
org.apache.axiom.om.OMFactory,
org.apache.axiom.om.OMNamespace,
org.apache.axis2.AxisFault,
org.apache.axis2.Constants,
org.apache.axis2.addressing.EndpointReference,
org.apache.axis2.client.Options,
org.apache.axis2.client.ServiceClient,
org.apache.axis2.context.ConfigurationContext,
org.apache.axis2.context.ConfigurationContextFactory,
javax.servlet.ServletContext,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse,
javax.servlet.jsp.JspWriter,
javax.xml.parsers.SAXParser,
javax.xml.parsers.SAXParserFactory"
session="false" %>
<%@ page import="javax.xml.stream.XMLOutputFactory" %>
<%@ page import="javax.xml.stream.XMLStreamException" %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.StringWriter" %>
<%@ page import="java.lang.Class" %>
<%@ page import="java.lang.ClassNotFoundException"%>
<%@ page import="java.lang.Exception" %>
<%@ page import="java.lang.Integer" %>
<%@ page import="java.lang.NoClassDefFoundError" %>
<%@ page import="java.lang.SecurityException" %>
<%@ page import="java.lang.String" %>
<%@ page import="java.lang.System" %>
<%@ page import="java.lang.Throwable" %>
<%--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
--%>
<head>
<jsp:include page="include/httpbase.jsp"/>
<title>Axis2 Happiness Page
<link href="axis2-web/css/axis-style.css" rel="stylesheet" type="text/css">
</head>
<body>
<jsp:include page="include/header.inc"/>
<jsp:include page="include/link-footer.jsp"/>
<%IP = request.getRequestURL().toString();%>
<%!
/*
* Happiness tests for axis2. These look at the classpath and warn if things
* are missing. Normally addng this much code in a JSP page is mad
* but here we want to validate JSP compilation too, and have a drop-in
* page for easy re-use
*/
String IP;
/**
* Get a string providing install information.
* TODO: make this platform aware and give specific hints
*/
public String getInstallHints(HttpServletRequest request) {
return "<B>Note: On Tomcat 4.x and Java1.4, you may need to put libraries that contain "
+ "java.* or javax.* packages into CATALINA_HOME/common/lib"
+ "<br>jaxrpc.jar and saaj.jar are two such libraries.";
}
/**
* test for a class existing
* @param classname
* @return class iff present
*/
Class classExists(String classname) {
try {
return Class.forName(classname);
} catch (ClassNotFoundException e) {
return null;
}
}
/**
* test for resource on the classpath
* @param resource
* @return true iff present
*/
boolean resourceExists(String resource) {
boolean found;
InputStream instream = this.getClass().getResourceAsStream(resource);
found = instream != null;
if (instream != null) {
try {
instream.close();
} catch (IOException e) {
}
}
return found;
}
/**
* probe for a class, print an error message is missing
* @param out stream to print stuff
* @param category text like "warning" or "error"
* @param classname class to look for
* @param jarFile where this class comes from
* @param errorText extra error text
* @param homePage where to d/l the library
* @return the number of missing classes
* @throws IOException
*/
int probeClass(JspWriter out,
String category,
String classname,
String jarFile,
String axisOperation,
String errorText,
String homePage) throws IOException {
try {
Class clazz = classExists(classname);
if (clazz == null) {
String url = "";
if (homePage != null) {
url = "<br> See " + homePage + "";
}
out.write("<p>" + category + ": could not find class " + classname
+ " from file <b>" + jarFile
+ "</b> | Platform | <td><%=getServletConfig().getServletContext().getServerInfo()%> </tr> </table> </blockquote> <h2>Examining System Properties <% /** * Dump the system properties */ java.util.Enumeration e = null; try { e = System.getProperties().propertyNames(); } catch (SecurityException se) { } if (e != null) { out.write("<pre>"); out.write("<table cellpadding='5px' cellspacing='0px' style='border: .5px blue solid;'>"); for (; e.hasMoreElements();) { out.write("<tr>"); String key = (String) e.nextElement(); out.write("<th style='border: .5px #A3BBFF solid;'>" + key + ""); out.write("<td style='border: .5px #A3BBFF solid;'>" + getFormatedSystemProperty(System.getProperty(key)) + " "); out.write("<tr>"); } out.write("</table>"); out.write("</pre>
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.