Fixed by re-installing Axis using the nightly drop
http://cvs.apache.org/dist/axis/nightly/
instead of 1.0. Many thanks Steve.
Regards,
-Rey
----- Original Message -----
From: "Steve Loughran" <[EMAIL PROTECTED]>
Date: Fri, 22 Nov 2002 09:42:55 -0800
To: <[EMAIL PROTECTED]>
Subject: Re: Happyaxis.jsp fails when upgrading to Java 1.4
>
> ----- Original Message -----
> From: " Reynardine" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 22, 2002 7:39 AM
> Subject: Happyaxis.jsp fails when upgrading to Java 1.4
>
>
> > Hello,
> >
> > Please can someone help. My axis 1.0 installation was fine under Tomcat
> 4.0.4 and Java 1.3. Then because of some JSTL problems with Java 1.3 I
> upgraded to Java 1.4. Tomcat 4.0.4 is still ok and I can compile and run
> jsp's and servlets. However, Axis is now broken when I validate and I can't
> work out why. I've read the Axis installation guide concerning Java 1.4 and
> have copied all available jars to Tomcat/common/lib without success.
> >
> > Has anyone else suffered from and then solved this problem ?
> >
> > Any help gratefully received and my happyaxis,jsp errors are below ..
> >
>
> try this version of happyaxis instead, that has better error handling (its
> the current CVS version). The key point to know is yes, you have some
> problems.
>
jaxrpc.jar and saaj.jar are two such libraries."; return hint; } /** * 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 description, String errorText, String homePage) throws IOException { try { Class clazz = classExists(classname); if(clazz == null) { String url=""; if(homePage!=null) { url=""+homePage+">"+homePage+""; } out.write("
"+category+": could not find class "+classname
+" from file "+jarFile
+"
"+errorText
+url
+"
");
return 1;
} else {
String location = getLocation(out, clazz);
if(location == null) {
out.write("Found "+ description + " (" + classname + ")
");
}
else {
out.write("Found "+ description + " (" + classname + ") at " + location + "
");
}
return 0;
}
} catch(NoClassDefFoundError ncdfe) {
String url="";
if(homePage!=null) {
url=""+homePage+">"+homePage+"";
}
out.write("
"+category+": could not find a dependency"
+" of class "+classname
+" from file "+jarFile
+"
"+errorText
+url
+"
The root cause was: "+ncdfe.getMessage()
+"
This can happen e.g. if "+classname+" is in"
+" the 'common' classpath, but a dependency like "
+" activation.jar is only in the webapp classpath."
+"
"); return 1; } } /** * get the location of a class * @param out * @param clazz * @return the jar file or path where a class was found * @throws IOException */ String getLocation(JspWriter out, Class clazz) throws IOException { try { java.net.URL url = "" String location = url.toString(); if(location.startsWith("jar")) { url = "" location = url.toString(); } if(location.startsWith("file")) { java.io.File file = new java.io.File(url.getFile()); return file.getAbsolutePath(); } else { return url.toString(); } } catch (Throwable t){ } return null; } /** * a class we need if a class is missing * @param out stream to print stuff * @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 * @throws IOException when needed * @return the number of missing libraries (0 or 1) */ int needClass(JspWriter out, String classname, String jarFile, String description, String errorText, String homePage) throws IOException { return probeClass(out, "Error", classname, jarFile, description, errorText, homePage); } /** * print warning message if a class is missing * @param out stream to print stuff * @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 * @throws IOException when needed * @return the number of missing libraries (0 or 1) */ int wantClass(JspWriter out, String classname, String jarFile, String description, String errorText, String homePage) throws IOException { return probeClass(out, "Warning", classname, jarFile, description, errorText, homePage); } /** * probe for a resource existing, * @param out * @param resource * @param errorText * @throws Exception */ int wantResource(JspWriter out, String resource, String errorText) throws Exception { if(!resourceExists(resource)) { out.write("
Warning: could not find resource "+resource
+"
"
+errorText);
return 0;
} else {
out.write("found "+resource+"
");
return 1;
}
}
/**
* get servlet version string
*
*/
public String getServletVersion() {
ServletContext context=getServletConfig().getServletContext();
int major = context.getMajorVersion();
int minor = context.getMinorVersion();
return Integer.toString(major) + '.' + Integer.toString(minor);
}
/**
*
* @return the classname of the parser
*/
public String getParserName() throws Exception {
// Create a JAXP SAXParser
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
if(saxParserFactory==null) {
return "no XML parser factory found";
}
SAXParser saxParser = saxParserFactory.newSAXParser();
if(saxParser==null) {
return "Could not create an XML Parser";
}
// check to what is in the classname
String saxParserName = saxParser.getClass().getName();
return saxParserName;
}
%>
Axis Happiness Page
Examining webapp configuration
Needed Components
<% int needed=0,wanted=0; /** * the essentials, without these Axis is not going to work */ needed=needClass(out, "javax.xml.soap.SOAPMessage", "saaj.jar", "SAAJ API", "Axis will not work", "http://xml.apache.org/axis/"); needed+=needClass(out, "javax.xml.rpc.Service", "jaxrpc.jar", "JAX-RPC API", "Axis will not work", "http://xml.apache.org/axis/"); needed+=needClass(out, "org.apache.axis.transport.http.AxisServlet", "axis.jar", "Apache-Axis", "Axis will not work", "http://xml.apache.org/axis/"); needed+=needClass(out, "org.apache.commons.discovery.Resource", "commons-discovery.jar", "Jakarta-Commons Discovery", "Axis will not work", "http://jakarta.apache.org/commons/discovery.html"); needed+=needClass(out, "org.apache.commons.logging.Log", "commons-logging.jar", "Jakarta-Commons Logging", "Axis will not work", "http://jakarta.apache.org/commons/logging.html"); //should we search for a javax.wsdl file here, to hint that it needs //to go into an approved directory? because we dont seem to need to do that. needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl", "wsdl4j.jar", "IBM's WSDL4Java", "Axis will not work", null); needed+=needClass(out, "javax.xml.parsers.SAXParserFactory", "xerces.jar", "JAXP implementation", "Axis will not work", "http://xml.apache.org/xerces-j/"); needed+=needClass(out,"javax.activation.DataHandler", "activation.jar", "Activation API", "Axis will not work", "http://java.sun.com/products/javabeans/glasgow/jaf.html"); %>Optional Components
<% /* * now the stuff we can live without */ wanted+=wantClass(out,"javax.mail.internet.MimeMessage", "mail.jar", "Mail API", "Attachments will not work", "http://java.sun.com/products/javamail/"); wanted+=wantClass(out,"org.apache.xml.security.Init", "xmlsec.jar", "XML Security API", "XML Security is not supported", "http://xml.apache.org/security/"); /* * resources on the classpath path */ /* broken; this is a file, not a resource wantResource(out,"/server-config.wsdd", "There is no server configuration file;" +"run AdminClient to create one"); */ /* add more libraries here */ out.write(""); //is everythng we need here if(needed==0) { //yes, be happy out.write("The core axis libraries are present. "); } else { //no, be very unhappy response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); out.write("" +needed +" core axis librar" +(needed==1?"y is":"ies are") +" missing"); } //now look at wanted stuff if(wanted>0) { out.write("" +wanted +" optional axis librar" +(wanted==1?"y is":"ies are") +" missing"); } else { out.write("The optional components are present."); } out.write("
"); //hint if anything is missing if(needed>0 || wanted>0 ) { out.write(getInstallHints(request)); } %>Note: Even if everything this page probes for is present, there is no guarantee your web service will work, because there are many configuration options that we do not check for. These tests are necessary but not sufficient
Examining Application Server
<% String servletVersion=getServletVersion(); String xmlParser=getParserName(); %>Servlet version | <%= servletVersion %> |
XML Parser | <%= xmlParser %> |
We recommend Xerces 2 over Crimson as the XML parser for Axis
<% } %>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(""); for (;e.hasMoreElements();) { String key = (String) e.nextElement(); out.write(key + "=" + System.getProperty(key)+"\n"); } out.write("
"); } else { out.write("System properties are not accessible
"); } %>
Platform: <%= getServletConfig().getServletContext().getServerInfo() %> --
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
One click access to the Top Search Engines