DO NOT REPLY [Bug 4275] - java.lang.NullPointerException

2001-10-22 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275

java.lang.NullPointerException

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID



--- Additional Comments From [EMAIL PROTECTED]  2001-10-22 13:18 ---
This seems like a NPE in xalan, not in tomcat. What xalan version ? Can't guess. Does 
it also fail in 3.3 ? 
The only possible problem tomcat can cause to xalan is the class loader, which is 
quite broken in 3.2.x. You must set Jdk12Interceptor manually in your 
server.xml, and make sure you replace jaxp.jar, parser.jar in lib/ with  xalan,xerces, 
etc



DO NOT REPLY [Bug 4275] - java.lang.NullPointerException

2001-10-18 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275

java.lang.NullPointerException

[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|java.lang.NullPointerExcepti|java.lang.NullPointerExcepti
   |on  |on



--- Additional Comments From [EMAIL PROTECTED]  2001-10-18 12:25 ---
//
 // for ease of reading i have removed all indenting :) 
//
//

// jdbc api
import java.sql.*;
//reflect api
import java.lang.reflect.*;
//xml api
import org.w3c.dom.*;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.transform.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
//javax.xml.parsers.ParserConfigurationException
import javax.xml.parsers.*;


//standard packages
import java.io.*;

//exceptionz
import org.xml.sax.*;
import org.xml.sax.SAXException;
import java.io.IOException;

/*

?xml version=1.0 encoding=UTF-8 ?
results
result type=AllUsers
record number=1
column name=username /
column name=password /
column name=address1 /
column name=address2 /
column name=city /
column name=state /
column name=zip /
column name=country /
/record
/result
/results

*/

public class serRS implements java.io.Serializable
{


/* Empty Constructor */
public void serRS() {}

public String writetoString (ResultSet rs, String typeid) {

// return string
String returnstr = new String();

try{

//XML
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();

//results/ Root element
Element results = (Element) document.createElement(results);
document.appendChild(results);

//result/
Element result = (Element) document.createElement(result);
results.appendChild(result);

//result type=AllUsers/
Attr type =(Attr) document.createAttribute(type);
Node attrtextnode = (Node) document.createTextNode(typeid);
type.appendChild(attrtextnode);
result.setAttributeNode(type);

Element record;
Element column;
Node countnode ;
Attr number;
Attr name;
Attr valuetype;
Attr tablename;
Node columnnametext;
Node columnvaluetext;
Node valuetypetext;
Node tablenametext;

int count = 1;

// JDBC-ODBC Calls
java.sql.ResultSetMetaData md = rs.getMetaData();

while(rs.next()) {
// record

record = (Element) document.createElement(record);
result.appendChild(record);

// record number=ixxx/coulmn
number =(Attr) document.createAttribute(number);
countnode = (Node) document.createTextNode(String.valueOf(count));
count ++ ;
number.appendChild(countnode);
record.setAttributeNode(number);


System.out.print(\nTUPLE: | );
for(int i=1; i= md.getColumnCount(); i++) {
// column name=value/value
column = (Element) document.createElement(column);
record.appendChild(column);

name =(Attr) document.createAttribute(name);
//columnnametext = (Node) document.createTextNode(md.getColumnLabel(i));
columnnametext = (Node) document.createTextNode(md.getColumnName(i));
name.appendChild(columnnametext);
column.setAttributeNode(name);

valuetype =(Attr) document.createAttribute(type);
valuetypetext = (Node) document.createTextNode(md.getColumnTypeName(i));
valuetype.appendChild(valuetypetext);
column.setAttributeNode(valuetype);

tablename =(Attr) document.createAttribute(table);
tablenametext = (Node) document.createTextNode(md.getCatalogName(i));
tablename.appendChild(tablenametext);
column.setAttributeNode(tablename);


/*
System.out.print(md.getColumnType(i) +  | );
System.out.print(md.getColumnTypeName(i) +  | );
System.out.print(md.getColumnLabel(i) +  | );
//System.out.print(rs.getString(i) +  | \n);
*/

try
{
Object o = rs.getObject(md.getColumnLabel(i));
if (!o.equals(null)){
String s = o.toString();
System.out.print(s + \n);
columnvaluetext = (Node) document.createTextNode(s);
column.appendChild(columnvaluetext);
}
}
catch (SQLException sqe ){
sqe.printStackTrace();
}
catch (NullPointerException n ){
System.out.print(Null pointer hui gava!!);
n.printStackTrace();
}

// new line
System.out.print(\n);

}
}


/*
File f = new File(local.xml);
//document = builder.parse(f);
// Use a Transformer for output
*/

/*
TransformerFactory 

DO NOT REPLY [Bug 4275] - java.lang.NullPointerException

2001-10-18 Thread bugzilla

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4275

java.lang.NullPointerException





--- Additional Comments From [EMAIL PROTECTED]  2001-10-18 12:34 ---
*** Bug 4274 has been marked as a duplicate of this bug. ***